From owner-freebsd-bugs Thu Sep 21 09:44:20 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id JAA18674 for bugs-outgoing; Thu, 21 Sep 1995 09:44:20 -0700 Received: from ns1.win.net (ns1.win.net [204.215.209.3]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id JAA18657 for ; Thu, 21 Sep 1995 09:44:18 -0700 Received: (from bugs@localhost) by ns1.win.net (8.6.11/8.6.9) id MAA07319 for bugs@freebsd.org; Thu, 21 Sep 1995 12:48:42 -0400 From: Mark Hittinger Message-Id: <199509211648.MAA07319@ns1.win.net> Subject: chpass -p broken To: bugs@freebsd.org Date: Thu, 21 Sep 1995 12:48:41 -0400 (EDT) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 985 Sender: owner-bugs@freebsd.org Precedence: bulk While experimenting with Guido's pwd_mkdb improvements I noticed that the chpass "-p" option appears to be broken by some of the YP changes around August... The call to use_yp resets the value of pw_pw_passwd to the original value. Below is a patch: *** /usr/src/usr.bin/chpass/chpass.c Sat Aug 26 05:03:10 1995 --- ./chpass.c Thu Sep 21 12:29:45 1995 *************** *** 87,88 **** --- 87,89 ---- char *arg; + char *new_password ; *************** *** 101,103 **** op = NEWPW; ! arg = optarg; break; --- 102,104 ---- op = NEWPW; ! new_password = optarg; break; *************** *** 150,152 **** } ! pw->pw_passwd = arg; } --- 151,153 ---- } ! pw->pw_passwd = new_password ; } *************** *** 168,169 **** --- 169,171 ---- _use_yp = use_yp(pw->pw_name); + if (op == NEWPW) pw->pw_passwd = new_password ; #endif /* YP */ *************** Regards, Mark Hittinger Internet Manager WinNET Communications, Inc. bugs@win.net