Subject: bin/3255: uucpd should accept leading "\r" during chat
To: None <gnats-bugs@gnats.netbsd.org>
From: Matthias Scheler <tron@lyssa.owl.de>
List: netbsd-bugs
Date: 02/25/1997 10:46:58
>Number:         3255
>Category:       bin
>Synopsis:       uucpd should accept leading "\r" during chat
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 25 02:05:02 1997
>Last-Modified:
>Originator:     Matthias Scheler
>Organization:
Matthias Scheler                                http://home.pages.de/~tron/
>Release:        970207
>Environment:
System: NetBSD lyssa 1.2C NetBSD 1.2C (LYSSA) #2: Wed Feb 19 18:23:15 MET 1997 tron@lyssa:/usr/src/sys/arch/i386/compile/LYSSA i386

>Description:
When I tried to setup an UUCP link for a Linux system using an old
Taylor UUCP 1.05 with an even older configuration style I got into
trouble because it always sends two carriage returns before the
login name. "uucpd" isn't very smart about this and terminates with
an "unknown user" message.

>How-To-Repeat:
telnet machine-with-uucpd-enabled uucp
enter <RETURN>

>Fix:
*** src/libexec/uucpd/uucpd.c.orig	Sun Dec  1 13:13:48 1996
--- src/libexec/uucpd/uucpd.c	Tue Feb 25 10:44:23 1997
*************** struct sockaddr_in *sinp;
*** 162,172 ****
  	struct passwd *pw, *getpwnam();
  
  	alarm(60);
! 	printf("login: "); fflush(stdout);
! 	if (readline(user, sizeof user) < 0) {
! 		fprintf(stderr, "user read\n");
! 		return;
! 	}
  	/* truncate username to 8 characters */
  	user[8] = '\0';
  	pw = getpwnam(user);
--- 162,174 ----
  	struct passwd *pw, *getpwnam();
  
  	alarm(60);
! 	do {
! 		printf("login: "); fflush(stdout);
! 		if (readline(user, sizeof user) < 0) {
! 			fprintf(stderr, "user read\n");
! 			return;
! 		}
! 	} while (user[0] == '\0');
  	/* truncate username to 8 characters */
  	user[8] = '\0';
  	pw = getpwnam(user);
>Audit-Trail:
>Unformatted: