Subject: bin/11282: /usr/bin/login does not handle HP-UX-style passwd-aging field (patch enclosed)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <pjt@phxlab.honeywell.com>
List: netbsd-bugs
Date: 10/20/2000 15:12:10
>Number:         11282
>Category:       bin
>Synopsis:       /usr/bin/login does not handle HP-UX-style passwd-aging field (patch enclosed)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 20 15:12:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Philip J. Tait
>Release:        NetBSD-current Aug 30 2000
>Organization:
Honeywell Engines & Systems
	
>Environment:
DS5000/240, NetBSD/pmax
	
System: NetBSD phxtst08 1.5_ALPHA2 NetBSD 1.5_ALPHA2 (GENERIC) #0: Wed Aug 30 12:05:02 MDT 2000 mhitch@news.msu.montana.edu:/b/NetBSD-1.5/src/sys/arch/pmax/compile/GENERIC pmax


>Description:
The environment is one where the passwd file is served mostly
to HP-UX 10.20 boxes. The IS dept chose to implement the HP-UX passwd-aging
scheme, whereby a field is appended to the passwd field, separated by a comma.
The enclosed patch detects this field, and deletes it, thus enabling
coexistence of NetBSD client boxes.
	
>How-To-Repeat:
	
>Fix:
Patch against: login.c,v 1.58.2.2 2000/08/06 16:47:19 thorpej Exp

--- src/usr.bin/login/login.c   Mon Aug  7 03:47:17 2000
+++ src/usr.bin/login/login.c.new       Fri Oct 20 14:53:39 2000
@@ -449,6 +449,16 @@
                        goto skip;
                }
 #endif
+               {
+                       /* Remove password-aging field */
+                       char *pwnoage;
+
+                       pwnoage = strchr(pwd->pw_passwd, ',');
+                       if ((pwnoage != NULL) &&
+                           ((pwnoage - pwd->pw_passwd) == 13))
+                               *pwnoage = '\0';
+               }
+                               
                if (!sflag && *pwd->pw_passwd != '\0' &&
                    !strcmp(crypt(p, pwd->pw_passwd), pwd->pw_passwd)) {
                        rval = 0;

	
>Release-Note:
>Audit-Trail:
>Unformatted: