phpscript as command line with setuid, weird result
| From: | Patric de Waha | Date: | Thu, 12 Sep 2002 20:51:40 +0000 |
| Subject: | phpscript as command line with setuid, weird result | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116201@lists.php.net to get a copy of this message | ||
Hi,
I wrote a command line script which makes some administration things on my server.
The script is setuid (set uid to root).
I call the script simply through its name.
I've put a >>print getuid()." ".get_current_user();<<< in the script
to see under which
user it is running.
When I su to nobody and run the script it returns "0 root".
apparently it has got root rights at that moment.
But the script can't execute anything it should be able to,
example: creating a file in root's directory, cat-ing the /etc/shadow..
It always says: "No permission etc"
Is it a security switch in the php.ini or what can this be?
thanks in advance
patric de waha