On Mon, Feb 10, 2003 at 09:01:05AM -0600, Spencer Ogden wrote:
> Seems like a good solution, I will give it a try. 
> 
> If Linux does not honor the setuid bit, then how come there are perl man 
> pages about how to write safe setuid scripts in perl? like perldoc 
> perlsec.
 
possibly because there is an 'suidperl' interpreter that does the right
thing in this case:

chrism@tinkertoy:[39:0]:/tmp > ls -l bob.pl
-rwsr-xr-x    1 root     ftp            83 Feb 10 09:25 bob.pl*
chrism@tinkertoy:[40:0]:/tmp > cat bob.pl
#!/usr/bin/suidperl

$ENV{PATH}="";          # $PATH is tainted, untaint or unset..
system("/bin/ls -al /root");
chrism@tinkertoy:[41:0]:/tmp > ./bob.pl
total 72
[...]
chrism@tinkertoy:[42:0]:/tmp > ls -ld /root
drwx------    8 root     root         4096 Feb  5 12:11 /root/

suidperl's functionality depends on how you compiled it.  i use the
standard rh7.2 shipped/updated perl and it works out of the box as
demonstrated.  the useful binary may be called 'sperl' if you have a
different/older distro.
_______________________________________________
Siglinux mailing list
[EMAIL PROTECTED]
http://www.utacm.org/mailman/listinfo/siglinux

Reply via email to