Date: Tue, 15 May 2001 02:40:02 -0700 (PDT) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/27258: getty didn't check if if= isn't empty Message-ID: <200105150940.f4F9e2419654@freefall.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR bin/27258; it has been noted by GNATS.
From: Bruce Evans <bde@zeta.org.au>
To: Cyrille Lefevre <clefevre@poboxes.com>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/27258: getty didn't check if if= isn't empty
Date: Tue, 15 May 2001 19:35:36 +1000 (EST)
On 15 May 2001, Cyrille Lefevre wrote:
> Bruce Evans <bde@zeta.org.au> writes:
>
> > On 14 May 2001, Cyrille Lefevre wrote:
> >
> > > Bruce Evans <bde@zeta.org.au> 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 ?
No. The null test is faster than a simple test.
Bruce
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105150940.f4F9e2419654>
