DragonFly BSD
DragonFly bugs List (threaded) for 2004-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

suidperl broken


From: "Erik P. Skaalerud" <erik@xxxxxxxxxxxx>
Date: Tue, 11 May 2004 02:45:03 +0200

Suidperl doesnt seem to work on DragonFly.

DragonFly:

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

[erik@dragon:~]$ ls -la /usr/local/bin/suidperl
-rws--x--x  2 root  wheel  706148 May 10 17:52 /usr/local/bin/suidperl
[erik@dragon:~]$ ls -la /usr/local/bin/testsuid
-rwsr-xr-x  1 root  wheel  271 May 10 20:52 /usr/local/bin/testsuid
[erik@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@dragon:~]$ testsuid
Can't reswap uid and euid.



FreeBSD (4.9):
[erik@staid:~]$ perl -v
This is perl, v5.6.1 built for i386-freebsd [erik@staid:~]$ ls -la 
/usr/local/bin/suidperl-rws--x--x  2 root  wheel  705508 Dec 18 11:05 
/usr/local/bin/suidperl[erik@staid:~]$ ls -la 
/usr/local/bin/testsuid-rwsr-xr-x  1 root  wheel  271 May 10 21:04 
/usr/local/bin/testsuid[erik@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@staid:~]$ 
testsuidreal UID: 1000effective UID: 0Set real to effective uidreal UID: 
0effective UID: 0 





[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]