bin/80732

Rostislav Krasny rosti.bsd at gmail.com
Wed Jun 8 03:10:10 GMT 2005


The following reply was made to PR bin/80732; it has been noted by GNATS.

From: Rostislav Krasny <rosti.bsd at gmail.com>
To: bug-followup at freebsd.org
Cc: Maxim Konovalov <maxim at macomnet.ru>
Subject: Re: bin/80732
Date: Wed, 08 Jun 2005 06:05:23 +0200

 This is a multi-part message in MIME format.
 --------------030108020503080009020802
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit
 
 During a private discussion with Maxim Konovalov I've realized that the 
 original getty(8) actually does print the IF file (/etc/issue) but only 
 once - before the very first IM message. When I did make the getty(8) 
 and the telnetd(8) patches I thought that the IM is really an initial 
 message and there should be no super-initial message before it; i.e. if 
 the IF file is defined and accessible, its contents should be a 
 replacement of the IM.
 
 I still think so, but also I think getty(8) and telnetd(8) should behave 
 by the same way during a login process. Try doing following experiment 
 with the original getty(8) on any pseudo-terminal:
 
 1. Press the Enter key a few times. After each pressing you'll see the 
 IM message before each "login:" prompt.
 2. Try login with a wrong password or a wrong username and after you get 
 a new "login:" prompt press the Enter key a few times again. Now you'll 
 see only the "login:" prompts, without the IM message before any of them.
 
 If you do the same experiment with the original telnetd(8) you see the 
 IM message only once - before the very first "login:" prompt.
 
 Therefore, in addition to the last version of telnetd(8) patch, I made a 
 new version of getty(8) patch that makes getty(8) to be with the same 
 behavior like telnetd(8).
 
 --------------030108020503080009020802
 Content-Type: text/plain;
  name="main.c.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="main.c.diff"
 
 --- main.c.orig	Mon Jun  6 09:16:37 2005
 +++ main.c	Mon Jun  6 09:21:45 2005
 @@ -312,24 +312,23 @@
  			putpad(CL);
  		edithost(HE);
  
 -		/* if this is the first time through this, and an
 -		   issue file has been given, then send it */
 -		if (first_time && IF) {
 -			int fd;
 +		if (first_time && !(PL && PP)) {
 +			int fd = -1;
  
 -			if ((fd = open(IF, O_RDONLY)) != -1) {
 -				char * cp;
 +			if (IF) {
 +				if ((fd = open(IF, O_RDONLY)) != -1) {
 +					char * cp;
  
 -				while ((cp = getline(fd)) != NULL) {
 -					  putf(cp);
 +					while ((cp = getline(fd)) != NULL)
 +						putf(cp);
 +					close(fd);
  				}
 -				close(fd);
  			}
 +			if (fd == -1 && IM && *IM)
 +				putf(IM);
 +			first_time = 0;
  		}
 -		first_time = 0;
  
 -		if (IM && *IM && !(PL && PP))
 -			putf(IM);
  		if (setjmp(timeout)) {
  			cfsetispeed(&tmode, B0);
  			cfsetospeed(&tmode, B0);
 
 --------------030108020503080009020802--
 


More information about the freebsd-bugs mailing list