Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 May 2001 00:50:04 -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:  <200105110750.f4B7o4N41605@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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: 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105110750.f4B7o4N41605>