Hi,
I'm trying to chroot and drop privileges in a perl script. But somehow
I'm not even able to run it setuid root. The setuid bit gets ignored
completely. But as I understand sys/sys/exec_script.h. The
SETUIDSCRIPTS feature is enabled by default. What am I missing?
/tmp% ls -l test.pl
-rwsrwx--- 1 root wheel 165 Apr 24 21:07 test.pl
/tmp% cat test.pl
#!/usr/bin/perl -wT
use strict;
sub ids () { print "RUID=$< EUID=$> RGID=$( EGID=$)\n" }
ids;
$< = $> = 1000;
ids;
$> = $< = 0;
ids;
/tmp% ./test.pl
RUID=1000 EUID=1000 RGID=10 10 0 5 9 117 501 1001 EGID=10 10 0 5 9 117 501 1001
RUID=1000 EUID=1000 RGID=10 10 0 5 9 117 501 1001 EGID=10 10 0 5 9 117 501 1001
RUID=1000 EUID=1000 RGID=10 10 0 5 9 117 501 1001 EGID=10 10 0 5 9 117 501 1001