|
Posted by Shift on 11/06/06 11:49
I can't execute a program with sudo;
I have wrote this example :
<?
$r1=exec("ls /usr",$lines,$errcod);
echo "r1=$r1, errcod=$errcod<br>";
$r2=exec("/usr/bin/sudo -u user ls /usr",$lines,$errcod);
echo "r2=$r2, errcod=$errcod<br>";
?>
"user" is without password and is in /etc/sudoers
This is the html output :
r1=tmp, errcod=0
r2=, errcod=1
Php version: 5, Apache: 2 on Fedora C4
Any ideas ?
Thanks,
Shift
[Back to original message]
|