run programm as super-user (*nix):
<?php
function sudoExecute($command)
{
$tmp = array();
preg_match('/^([^ ]+?)( |$)/', trim($command), $tmp);
$command_to_execute = $tmp[1];
$sudo_output = `sudo -l`;
preg_match_all('/ (/[w/]+?)(,|$)/', $sudo_output,
$tmp);
if (count($tmp) > 1) {
$allowed_commands = $tmp[1];
if (array_search($command_to_execute,
$allowed_commands) === false) {
return false;
}
} else {
return false;
}
return system("/usr/local/bin/sudo $command
2>&1");
}
?>
----
Server IP: 195.54.192.44
Probable Submitter: 195.128.50.89
----
Manual Page -- http
://www.php.net/manual/en/function.system.php
Edit -- https://master
.php.net/note/edit/71466
Del: integrated -- h
ttps://master.php.net/note/delete/71466/integrated
Del: useless -- http
s://master.php.net/note/delete/71466/useless
Del: bad code -- htt
ps://master.php.net/note/delete/71466/bad+code
Del: spam -- https:/
/master.php.net/note/delete/71466/spam
Del: non-english --
https://master.php.net/note/delete/71466/non-english
Del: in docs -- http
s://master.php.net/note/delete/71466/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/71466
Reject -- https://mast
er.php.net/note/reject/71466
Search -- https://
master.php.net/manage/user-notes.php
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|