From marcolz@stack.nl  Wed Jan  9 12:18:15 2002
Return-Path: <marcolz@stack.nl>
Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140])
	by hub.freebsd.org (Postfix) with ESMTP id 2AC9C37B420
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  9 Jan 2002 12:18:14 -0800 (PST)
Received: from turtle.stack.nl (turtle.stack.nl [2001:610:1108:5010:202:b3ff:fe17:a070])
	by mailhost.stack.nl (Postfix) with ESMTP
	id C74483D837; Wed,  9 Jan 2002 21:18:12 +0100 (CET)
Received: by turtle.stack.nl (Postfix, from userid 333)
	id 252DB35B; Wed,  9 Jan 2002 21:18:11 +0100 (CET)
Message-Id: <20020109211810.A64413@stack.nl>
Date: Wed, 9 Jan 2002 21:18:10 +0100
From: Marc Olzheim <marcolz@stack.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Marc Olzheim <marcolz@stack.nl>,
	Serge van den Boom <svdb@stack.nl>
In-Reply-To: <20020109202852.A61938@stack.nl>; from marcolz@stack.nl on Wed, Jan 09, 2002 at 08:28:52PM +0100
Subject: Re: [PATCH] empty argv
References: <20020109202852.A61938@stack.nl>

>Number:         33740
>Category:       kern
>Synopsis:       Re: [PATCH] empty argv
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 09 12:20:02 PST 2002
>Closed-Date:    Mon Jan 14 14:51:07 PST 2002
>Last-Modified:  Thu Oct 07 18:38:38 GMT 2004
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 --FL5UXtIhxfXey3p5
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 > 	OpenBSD does not allow empty argv, returning -1 and EFAULT in
 > 	errno (the man page says it should return EINVAL, but it
 > 	doesn't).
 
 Hmm, OpenBSD does the same as FreeBSD when argv is (char **) { NULL }.
 (Just replace 'NULL' with '(char **) { NULL }' in noargv.c, which I
 forgot tho attach.
 Perhaps this should be caught as well in execve(2). One could also argue
 that setuid programmers should expect the unexpected, but why not make
 it easier on them...
 
 Marc
 
 --FL5UXtIhxfXey3p5
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="noargv.c"
 
 #include	<stdio.h>
 #include	<unistd.h>
 
 int
 main(int argc, char *argv[])
 {
 	if (argc != 2)
 	{
 		fprintf(stderr, "Usage: %s <prog>\n", argv[0]);
 		return(1);
 	}
 
 	execv(argv[1], NULL);
 
 	return(0);
 }
 
 --FL5UXtIhxfXey3p5--
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: keramida 
State-Changed-When: Mon Jan 14 14:51:07 PST 2002 
State-Changed-Why:  
Not a PR. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=33740 
>Unformatted:
