Re: execve

Andreas Schwab (
27 Jul 1998 14:04:48 +0200

Koblinger Egmont <> writes:

|> Hi there!
|> The execve() call allows to execute a process with no arguments at all,
|> so argc==0, argv[0]==NULL. Most of the programs, even setuid ones such as
|> sendmail, suidperl etc. behave very strange way if they are called with no
|> arguments since their programmer except that argc>=1. Usually they exit
|> with segmentation fault.
|> Does anyone need this feature (or bug) ? I think disabling this would
|> increase security.

This was usefull once upon the time (in the a.out days, argc==0 told the
dynamic linker to do the ldd things). Apart from that neither ANSI C nor
POSIX forbid argc == 0, thus it's a bug in the applications (they
shouldn't be dereferencing argv[0] if it's NULL). So it's not a kernel

Andreas Schwab                                      "And now for something              completely different"

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at