Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jan 2002 00:20:02 -0800 (PST)
From:      Marc Olzheim <marcolz@stack.nl>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/33738: [PATCH] empty argv
Message-ID:  <200201100820.g0A8K2t34335@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/33738; it has been noted by GNATS.

From: Marc Olzheim <marcolz@stack.nl>
To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc: Marc Olzheim <marcolz@stack.nl>,
	freebsd-gnats-submit@FreeBSD.ORG, Serge van den Boom <svdb@stack.nl>
Subject: Re: kern/33738: [PATCH] empty argv
Date: Thu, 10 Jan 2002 09:16:36 +0100

 [snip]
 
 > If the Standard does not say that a list must be non-empty, then it
 > may be empty.
 
 Hmmm, then programs like passwd, lpr, etc. should probably be fixed, or
 checked for potential abuse of (argc == 0).
 
 Marc
 __
 /* noargv.c */
 #include	<stdio.h>
 #include	<unistd.h>
 
 int
 main(int argc, char *argv[])
 {
 	const char	*bar[] = { "/tmp/foo", NULL };
 	if (argc != 2)
 	{
 		fprintf(stderr, "Usage: %s <prog>\n", argv[0]);
 		return(1);
 	}
 
 	execve(argv[1], NULL, bar);
 	perror("execve");
 
 	return(0);
 }
 __

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201100820.g0A8K2t34335>