From owner-freebsd-bugs Fri May 11 0:50: 8 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 3A4FE37B422 for ; Fri, 11 May 2001 00:50:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f4B7o4N41605; Fri, 11 May 2001 00:50:04 -0700 (PDT) (envelope-from gnats) Date: Fri, 11 May 2001 00:50:04 -0700 (PDT) Message-Id: <200105110750.f4B7o4N41605@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: bin/27258: getty didn't check if if= isn't empty Reply-To: Bruce Evans 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: Bruce Evans To: Cyrille Lefevre Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/27258: getty didn't check if if= isn't empty Date: Fri, 11 May 2001 17:43:22 +1000 (EST) On Thu, 10 May 2001, Cyrille Lefevre wrote: > >Description: > > all is in the subject. this is not so important, but be safe. > > >How-To-Repeat: > > :if=: in gettytab > > >Fix: > > Index: main.c > =================================================================== > RCS file: /home/ncvs/src/libexec/getty/main.c,v > retrieving revision 1.28.2.2 > diff -u -r1.28.2.2 main.c > --- main.c 2001/03/05 11:17:08 1.28.2.2 > +++ main.c 2001/03/11 06:02:46 > @@ -324,7 +324,7 @@ > > /* if this is the first time through this, and an > issue file has been given, then send it */ > - 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). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message