From owner-freebsd-bugs Wed Jan 9 15:54:29 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from skynet.stack.nl (insgate.stack.nl [131.155.140.2]) by hub.freebsd.org (Postfix) with ESMTP id 7C17B37B420; Wed, 9 Jan 2002 15:54:23 -0800 (PST) Received: from toad.stack.nl (toad.stack.nl [2001:610:1108:5010:202:b3ff:fe17:9e1a]) by skynet.stack.nl (Postfix) with ESMTP id 1051B9B15; Thu, 10 Jan 2002 00:54:21 +0100 (CET) Received: by toad.stack.nl (Postfix, from userid 333) id A8CD3961B; Thu, 10 Jan 2002 00:54:20 +0100 (CET) Date: Thu, 10 Jan 2002 00:54:20 +0100 From: Marc Olzheim To: gnats-admin@FreeBSD.org, freebsd-bugs@FreeBSD.org Cc: Marc Olzheim , Serge van den Boom Subject: Re: kern/33738: [PATCH] empty argv Message-ID: <20020110005420.A97745@stack.nl> References: <20020109202852.A61938@stack.nl> <200201091930.g09JU1T85304@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200201091930.g09JU1T85304@freefall.freebsd.org>; from gnats-admin@FreeBSD.org on Wed, Jan 09, 2002 at 11:30:01AM -0800 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --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 #include int main(int argc, char *argv[]) { if (argc != 2) { fprintf(stderr, "Usage: %s \n", argv[0]); return(1); } execv(argv[1], NULL); return(0); } --FL5UXtIhxfXey3p5-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message