druidmatrix has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I have a simple setuid script:
#!/usr/bin/perl -T # use POSIX qw(setuid setgid); if ($<) { $( = $) = 0; $< = $> = 0; print "Could not setuid ".$<." \n" if ($<); POSIX::setuid(0) if ($<); print "Posix could not setuid either ".$<." \n" if ($<); }
I have the sticky bit set and the file is owned by root:
The output to the above is:-rwsrwx--- 1 root csit 237 2010-04-30 01:16 setuid.pl
Could not setuid 500 Posix could not setuid either 500
My perl version is v5.10.1 and this is running on Fedora 10. I have also set selinux enforcing to "permissive".
TIA.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Setuid script not working
by afoken (Chancellor) on Apr 30, 2010 at 05:57 UTC | |
by druidmatrix (Acolyte) on Apr 30, 2010 at 06:06 UTC | |
by Anonymous Monk on Apr 30, 2010 at 07:03 UTC | |
by afoken (Chancellor) on Apr 30, 2010 at 07:51 UTC | |
by ikegami (Patriarch) on Apr 30, 2010 at 21:12 UTC | |
by druidmatrix (Acolyte) on Apr 30, 2010 at 07:53 UTC | |
by Anonymous Monk on Apr 30, 2010 at 08:44 UTC | |
by druidmatrix (Acolyte) on Apr 30, 2010 at 08:50 UTC | |
Re: Setuid script not working
by MidLifeXis (Monsignor) on Apr 30, 2010 at 13:32 UTC | |
by druidmatrix (Acolyte) on Apr 30, 2010 at 18:49 UTC | |
Re: Setuid script not working
by Khen1950fx (Canon) on Apr 30, 2010 at 05:41 UTC | |
by druidmatrix (Acolyte) on Apr 30, 2010 at 06:11 UTC | |
by Anonymous Monk on Apr 30, 2010 at 07:00 UTC | |
by druidmatrix (Acolyte) on Apr 30, 2010 at 07:48 UTC | |
by Anonymous Monk on Apr 30, 2010 at 08:38 UTC | |
|