Je cherche a faire un script PHP, lance depuis le shell, que je souhaite lancer en temps que root grace a son bit 'set-uid'.
Par exemple,
#!/usr/bin/php
<?
... bla bla bla ...
chown('toto', 'root');
?>
Mon script se nome Upload et j'ai donc fait :
root_AT_chose:~/projets/Geppetto/Client/TasksScripts# chown root Upload root_AT_chose:~/projets/Geppetto/Client/TasksScripts# chmod u+s Upload root_AT_chose:~/projets/Geppetto/Client/TasksScripts# ll total 32 -rwsr-xr-x 1 root www-data 1798 2011-06-17 00:38 Upload
Sauf que ca ne marche pas lorsque je le lance en temps d'un user lambda :
Warning: chown(): Operation not permitted in /home/laurent/projets/Geppetto/Client/TasksScripts/Upload on line 67
Quelqu'un saurait-il pourquoi ?
Merci,
Laurent



Haut














