From owner-freebsd-bugs Fri Dec 1 14:13:43 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id OAA28654 for bugs-outgoing; Fri, 1 Dec 1995 14:13:43 -0800 Received: from mv.mv.com (lopez@mv.MV.COM [192.80.84.1]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id OAA28628 for ; Fri, 1 Dec 1995 14:13:33 -0800 Received: (lopez@localhost) by mv.mv.com (8.7.1/mem-940616) id RAA04139 for bugs@freebsd.org; Fri, 1 Dec 1995 17:13:19 -0500 (EST) Date: Fri, 1 Dec 1995 17:13:19 -0500 (EST) From: Lawrence Lopez Message-Id: <199512012213.RAA04139@mv.mv.com> To: bugs@freebsd.org Subject: Seconds Yellow Pages Bug Sender: owner-bugs@freebsd.org Precedence: bulk Fri Dec 1 16:22:11 EST 1995 off of gatekeeper.dec.com: yp_passwd Garbage passed to yppasswdd As a result of not terminating a string garbage is being passwd to yppasswdd. FreeBSD 2.0.5 from walnut creek and ftp://gatekeeper.dec.com /pub/BSD/FreeBSD/FreeBSD-current /src/usr.bin/passwd/local_passwd.c I have shown the correction for the later version. In: char * getnewpasswd(pw, nis) struct passwd *pw; int nis; The code: #ifdef NEWSALT salt[0] = _PASSWORD_EFMT1; to64(&salt[1], (long)(29 * 25), 4); to64(&salt[5], random(), 4); #else /* Make a good size salt for algoritms that can use it. */ to64(&salt[0], random(), 3); gettimeofday(&tv,0); to64(&salt[3], tv.tv_usec, 3); to64(&salt[6], tv.tv_sec, 2); salt[8] = '\0'; #endif Appears at the end. It needs the following: salt[9] = '\0'; After: to64(&salt[5], random(), 4); Thank you! Larry Lopez. If a better submission method exists or a straight update then tell me.