From owner-freebsd-bugs Mon May 14 17:40: 5 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id C100C37B422 for ; Mon, 14 May 2001 17:40:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f4F0e2c38877; Mon, 14 May 2001 17:40:02 -0700 (PDT) (envelope-from gnats) Date: Mon, 14 May 2001 17:40:02 -0700 (PDT) Message-Id: <200105150040.f4F0e2c38877@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Cyrille Lefevre Subject: Re: bin/27258: getty didn't check if if= isn't empty Reply-To: Cyrille Lefevre Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/27258; it has been noted by GNATS. From: Cyrille Lefevre To: Bruce Evans Cc: Cyrille Lefevre , FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/27258: getty didn't check if if= isn't empty Date: 15 May 2001 02:32:11 +0200 Bruce Evans writes: > On 14 May 2001, Cyrille Lefevre wrote: > > > Bruce Evans writes: > > > > [snip] > > > > - if (first_time && IF) { > > > > + if (first_time && IF && *IF) { > > > > int fd; > > > > > > > > if ((fd = open(IF, O_RDONLY)) != -1) { > > > > > > This is safer than `:if=/bin/sh:'. It just causes the open to fail > > > just like for any other nonexistent file (POSIX standard). > > > > yes, but this syscall isn't needed, so, why not to get rid of it if > > if= is empty ? > > It takes more code, and takes longer in the usual case. are you joking ? a syscall faster than a simple test like this ? Cyrille. -- home: mailto:clefevre@poboxes.com UNIX is user-friendly; it's just particular work: mailto:Cyrille.Lefevre@edf.fr about who it chooses to be friends with. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message