#22890 [Opn]: CLI setuid scripts don't run setuid
| From: | gavin at itmerge dot com | Date: | Wed, 26 Mar 2003 10:05:30 +0000 |
| Subject: | #22890 [Opn]: CLI setuid scripts don't run setuid | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-36454@lists.php.net to get a copy of this message | ||
ID: 22890
User updated by: gavin at itmerge dot com
Reported By: gavin at itmerge dot com
Status: Open
Bug Type: CGI related
Operating System: Linux 2.4.18
PHP Version: 4.3.1
New Comment:
whoops spelt posix_geteuid(); wrong :P
Previous Comments:
------------------------------------------------------------------------
[2003-03-26 03:27:23] gavin at itmerge dot com
/* my sample script is */
#!/usr/local/bin/php
<?php
echo posix_getmyeuid()."\n";
?>
/*
root#chown root.vhost /scripts/myscript
root#chmod 4710 /scripts/myscript
root#useradd -u 1001 gavin
root#usermod gavin -G vhost
root#logout
gavin$/scripts/myscript
1001
gavin$
i had to create /usr/local/bin/setuid_php
and chmod 4710 it to be able to make my php scripts run setuid root
(i'm not a perl person i don't know if perl supports setuid but I know
scripts that i pass thru
/bin/zsh support setuid)
I don't really like having that script there :0
because A, I'm learning but i'm learing quickly
that the more "permissions" you have the
more you're likely to get a stuck up the rear end
and essentially that lets anyone become god on my system who might find
it, I think i'm going to go move it outside of /usr/local/bin right
now
*/
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22890&edit=1