From mrg@eterna.com.au Mon May 18 07:50:25 1998 Received: from eterna.com.au (splode.eterna.com.au [203.15.111.1]) by repsec.com (9.0.1a/7.7.4.nospam) with SMTP id HAA09130 for ; Mon, 18 May 1998 07:50:21 -0700 Received: (qmail 14430 invoked from network); 18 May 1998 12:49:26 -0000 Received: from splode.eterna.com.au (HELO eterna.com.au) (203.15.111.1) by splode.eterna.com.au with SMTP; 18 May 1998 12:49:26 -0000 To: Brian Martin cc: Security Alert From: matthew green Subject: Re: Greetings.. In-reply-to: Your message of "Thu, 14 May 1998 02:07:01 MST." Date: Mon, 18 May 1998 22:49:24 +1000 Message-ID: <14419.895495764@eterna.com.au> Sender: mrg@eterna.com.au Status: RO X-Status: A Index: uucpd.c =================================================================== RCS file: /cvsroot/src/libexec/uucpd/uucpd.c,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** uucpd.c 1998/02/13 23:15:16 1.8 - --- uucpd.c 1998/05/18 12:41:30 1.9 *************** *** 1,4 **** ! /* $NetBSD: uucpd.c,v 1.8 1998/02/13 23:15:16 tron Exp $ */ /* * Copyright (c) 1985 The Regents of the University of California. - --- 1,4 ---- ! /* $NetBSD: uucpd.c,v 1.9 1998/05/18 12:41:30 mrg Exp $ */ /* * Copyright (c) 1985 The Regents of the University of California. *************** *** 43,49 **** #if 0 static char sccsid[] = "from: @(#)uucpd.c 5.10 (Berkeley) 2/26/91"; #else ! __RCSID("$NetBSD: uucpd.c,v 1.8 1998/02/13 23:15:16 tron Exp $"); #endif #endif /* not lint */ - --- 43,49 ---- #if 0 static char sccsid[] = "from: @(#)uucpd.c 5.10 (Berkeley) 2/26/91"; #else ! __RCSID("$NetBSD: uucpd.c,v 1.9 1998/05/18 12:41:30 mrg Exp $"); #endif #endif /* not lint */ *************** *** 187,196 **** user[8] = '\0'; pw = getpwnam(user); if (pw == NULL) { ! fprintf(stderr, "user unknown\n"); ! return; ! } ! if (strcmp(pw->pw_shell, _PATH_UUCICO)) { fprintf(stderr, "Login incorrect."); return; } - --- 187,193 ---- user[8] = '\0'; pw = getpwnam(user); if (pw == NULL) { ! (void) crypt("dummy password", "PA"); /* must always crypt */ fprintf(stderr, "Login incorrect."); return; } *************** *** 206,211 **** - --- 203,212 ---- return; } } + if (strcmp(pw->pw_shell, _PATH_UUCICO)) { + fprintf(stderr, "Login incorrect."); + return; + } alarm(0); sprintf(Username, "USER=%s", user); dologin(pw, sinp); *************** *** 239,244 **** - --- 240,246 ---- return(-1); } + /* Note that SCPYN is only used on strings that may not be nul terminated */ #define SCPYN(a, b) strncpy(a, b, sizeof (a)) struct utmp utmp; *************** *** 302,309 **** time(&ll.ll_time); lseek(f, pw->pw_uid * sizeof(struct lastlog), 0); ! strcpy(line, remotehost); ! SCPYN(ll.ll_line, line); SCPYN(ll.ll_host, remotehost); (void) write(f, (char *) &ll, sizeof ll); (void) close(f); - --- 304,310 ---- time(&ll.ll_time); lseek(f, pw->pw_uid * sizeof(struct lastlog), 0); ! SCPYN(ll.ll_line, remotehost); SCPYN(ll.ll_host, remotehost); (void) write(f, (char *) &ll, sizeof ll); (void) close(f); -----BEGIN PGP SIGNATURE----- Version: 2.6.1 iQCVAwUBNWAt5T5Ru2/4N2IFAQEV/wP+JnygFaca7/z/s6v2GhbtOjx4AQ/qy/O1 bZWk21Nm1Rv5FJ99RdVBQqkNbIAw4Ul7uY4puXuYHvjCzyNIzhdomdzV+8zbK6pr q/sV9pqsnM1Luqr9c0KInuNsl4oVWOtvvYoqcauOFXWHlv/DX4lQY3kSXen9xked fe4mWIZVo9M= =e1Oo -----END PGP SIGNATURE-----