From owner-freebsd-bugs@FreeBSD.ORG Wed Jun 8 03:10:10 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85B8316A41C for ; Wed, 8 Jun 2005 03:10:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 46CBA43D48 for ; Wed, 8 Jun 2005 03:10:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j583AAaD099970 for ; Wed, 8 Jun 2005 03:10:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j583AA0e099969; Wed, 8 Jun 2005 03:10:10 GMT (envelope-from gnats) Date: Wed, 8 Jun 2005 03:10:10 GMT Message-Id: <200506080310.j583AA0e099969@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Rostislav Krasny Cc: Subject: Re: bin/80732 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rostislav Krasny List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2005 03:10:10 -0000 The following reply was made to PR bin/80732; it has been noted by GNATS. From: Rostislav Krasny To: bug-followup@freebsd.org Cc: Maxim Konovalov 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--