Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

RE: Re: How do I execute as root?

by le (Friar)
on Nov 14, 2000 at 03:15 UTC ( [id://41469]=note: print w/replies, xml ) Need Help??


in reply to Re: How do I execute as root?
in thread How do I execute as root?

On Unix systems (OK, I just can tell about FreeBSD and Linux) a script can't be setuid root.

(Was there something concerning kernel security level...?)

Replies are listed 'Best First'.
RE: RE: Re: How do I execute as root?
by Fastolfe (Vicar) on Nov 14, 2000 at 03:18 UTC
    Works for me:
    (fastolfe) eddie:~$ ls -l test -rwsrwxr-x 1 root fastolfe 53 Nov 13 16:17 test (fastolfe) eddie:~$ ./test uid=500 euid=0 (fastolfe) eddie:~$ cat test #!/usr/bin/perl printf("uid=%d euid=%d\n", $<, $>); (fastolfe) eddie:~$ uname -a Linux eddie.intranet 2.2.16 #1 Thu Jun 8 17:46:12 CDT 2000 i586 unknow +n
    You may have to swap uid/euid as needed, though:
    ($<, $>) = ($>, $<);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://41469]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-20 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found