Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-type: text/plain');
- foreach (array('index', 'mcp', 'ucp', 'config', 'adm/index') as $file)
- {
- if (!file_exists("./$file.php"))
- {
- die(sprintf('Sure this is in your phpBB directory? "%s" is missing', $file));
- }
- }
- $test_file = './cache/phpbb_chmod_debug.test';
- touch($test_file);
- $code = array(
- "php_uname()",
- "function_exists('fileowner')",
- "function_exists('filegroup')",
- "function_exists('posix_getuid')",
- "function_exists('posix_getgroups')",
- "function_exists('posix_getpwuid')",
- "function_exists('posix_getgrgid')",
- );
- if (function_exists('fileowner'))
- {
- $code = array_merge($code, array(
- "fileowner('./common.php')",
- "fileowner('$test_file')",
- ));
- }
- if (function_exists('filegroup'))
- {
- $code = array_merge($code, array(
- "filegroup('./common.php')",
- "filegroup('$test_file')",
- ));
- }
- if (function_exists('posix_getuid'))
- {
- $code = array_merge($code, array(
- "posix_getuid()",
- ));
- }
- if (function_exists('posix_getgroups'))
- {
- $code = array_merge($code, array(
- "posix_getgroups()",
- ));
- }
- if (function_exists('posix_getuid') && function_exists('posix_getpwuid'))
- {
- $code = array_merge($code, array(
- "posix_getpwuid(posix_getuid())",
- ));
- }
- if (function_exists('posix_getgroups') && function_exists('posix_getgrgid'))
- {
- $code = array_merge($code, array(
- "array_map('posix_getgrgid', posix_getgroups())",
- ));
- }
- foreach ($code as $line)
- {
- echo sprintf("`%1\$s` yeilds:\n%2\$s\n\n", $line, eval(sprintf('return var_export(%s, true);', $line)));
- }
- unlink($test_file);
Add Comment
Please, Sign In to add comment