Re: execve

Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
27 Jul 1998 14:04:48 +0200


Koblinger Egmont <egmont@fazekas.hu> 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
problem.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"
schwab@gnu.org

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html