in reply to Process owner
When it comes to suid and perl, running on the command line is different than running from a real file. In unix there's a race condition running scripts, #! files, between the time the kernel detects what script program to use and when the script actually reads the file. Using a compiled wrapper or sudo are common work-arounds.# cat s.c main(int ac, char **av) { execv("/home/thayer/foo.pl", av); } # gcc s.c -o s # chown root s; chmod a+rx,u+s s ; ls -l s -rwsrwxr-x 1 root users 11394 Dec 15 11:43 s # cat foo.pl #!/usr/local/bin/perl -T print "$< $>\n"; # ls -l foo.pl -r-xr-xr-x 1 thayer users 43 Dec 15 11:42 foo.pl $ ./s 3068 0
|
|---|