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

Re: Setting effective UID for a shell script



On Wed, May 15, 2002 at 05:17:41PM +0930, Tom Cook wrote:

> However, you are not entirely correct.  This does, in fact, compile,
> with the exception of the type of execve for execv.  It also, funnily
> enough, doesn't loop infinitely, which makes me think that the execv
> call is just failing.  I am Interested, but not enough to figure out
> Why.

$ gcc -g -Wall -o suidscript suidscript.c
suidscript.c: In function `main':
suidscript.c:4: warning: passing arg 2 of `execve' from incompatible
pointer type
suidscript.c:4: too few arguments to function `execve'
$ ls suidscript
ls: suidscript: No such file or directory

Note: I said "semantically", since you pass argv[0] as the command to
execute, the program will keep executing itself (if argv[0] is fully
qualified).  But, if you managed to get it to compile, it no doubt is
segfaulting due to noted errors above.

-- 
Eric G. Miller <egm2@jps.net>


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: