suidperl broken

Erik P. Skaalerud erik at pentadon.com
Mon May 10 17:45:03 PDT 2004


Suidperl doesnt seem to work on DragonFly.

DragonFly:

[erik at dragon:~/public_html]$ perl -v
This is perl, v5.6.1 built for i386-freebsd

[erik at dragon:~]$ ls -la /usr/local/bin/suidperl
-rws--x--x  2 root  wheel  706148 May 10 17:52 /usr/local/bin/suidperl
[erik at dragon:~]$ ls -la /usr/local/bin/testsuid
-rwsr-xr-x  1 root  wheel  271 May 10 20:52 /usr/local/bin/testsuid
[erik at dragon:~]$ cat /usr/local/bin/testsuid
#!/usr/bin/suidperl

use strict;
undef %ENV;
$ENV{'PATH'} = '/sbin:/bin';

print "real UID: $< \n";
print "effective UID: $> \n";

$< = $>; # set realuid to effective uid (root)

print "Set real to effective uid\n";
print "real UID: $< \n";
print "effective UID: $> \n";

[erik at dragon:~]$ testsuid
Can't reswap uid and euid.



FreeBSD (4.9):
[erik at staid:~]$ perl -v
This is perl, v5.6.1 built for i386-freebsd [erik at staid:~]$ ls -la 
/usr/local/bin/suidperl-rws--x--x  2 root  wheel  705508 Dec 18 11:05 
/usr/local/bin/suidperl[erik at staid:~]$ ls -la 
/usr/local/bin/testsuid-rwsr-xr-x  1 root  wheel  271 May 10 21:04 
/usr/local/bin/testsuid[erik at staid:~]$ cat 
/usr/local/bin/testsuid#!/usr/bin/suidperluse strict;undef %ENV;$ENV{'PATH'} 
= '/sbin:/bin';print "real UID: $< \n";print "effective UID: $> \n";$< = $>; 
# set realuid to effective uid (root)print "Set real to effective 
uid\n";print "real UID: $< \n";print "effective UID: $> \n";[erik at staid:~]$ 
testsuidreal UID: 1000effective UID: 0Set real to effective uidreal UID: 
0effective UID: 0 







More information about the Bugs mailing list