Thread $0 und chmod: "Set user ID"-Bit (19 answers)
Opened by docsnyder at 2006-06-09 12:59

murphy
 2006-06-12 23:54
#67182 #67182
User since
2004-07-19
1776 Artikel
HausmeisterIn
[Homepage]
user image
@betterworld: Ich habe vor meinem letzten Beitrag auf einer Sun-Kiste getestet und festgestellt, dass bei Verwendung von FindBin so ein setuid Skript gleich beim Kompilieren abschmiert:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
% uname -a
SunOS herdubreid.rhi.hi.is 5.9 Generic_118558-27 sun4u sparc SUNW,Sun-Fire-880
% cat test.pl
#!/usr/bin/perl

use strict;
use warnings;

use FindBin;

print "zeroth argument: $0\n";
print "path to binary : $FindBin::RealScript\n";
% ls -l test.pl
-rwx------ 1 tcc1 enem 138 Jun 12 15:58 test.pl
% ./test.pl
zeroth argument: ./test.pl
path to binary : test.pl
% chmod u+s test.pl
% ./test.pl
Cannot find current script '/dev/fd/4' at /usr/perl5/5.6.1/lib/FindBin.pm line 166
BEGIN failed--compilation aborted at /usr/perl5/5.6.1/lib/FindBin.pm line 166.
Compilation failed in require at /dev/fd/4 line 6.
BEGIN failed--compilation aborted at /dev/fd/4 line 6.
When C++ is your hammer, every problem looks like your thumb.

View full thread $0 und chmod: "Set user ID"-Bit