Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 6090

Summary: glibc getwpent() calls don't handle HP-UX NIS password aging
Product: [Retired] Red Hat Linux Reporter: baz
Component: glibcAssignee: Cristian Gafton <gafton>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-01-05 03:04:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description baz 1999-10-19 17:16:29 UTC
HP-UX implements password aging information as an extension
to the encrypted password field - eg "oMTEeSwfFGf8I,F/FM".

pwdb/pam would now appear to have been updated to handle
this, but the core glibc calls are still broken when called
from legacy applications.

Comment 1 Cristian Gafton 2000-01-05 03:04:59 UTC
I don't see how glibc can handle any of that. This is a HP-UX extension designed
to be used and dealt with at the application level, not in the library.

Comment 2 baz 2000-01-05 09:12:59 UTC
Duh! The encrypted password returned by getpwent() inlcudes the aging info -
this causes applications to break. How to handle the password aging is a
separate issue, but the inability to login is a problem.

Supplied patch is against RH6.0 Source RPM.

*** glibc/pwd/fgetpwent_r.c.orig        Sat Apr 10 06:57:43 1999
--- glibc/pwd/fgetpwent_r.c     Sat Apr 10 07:33:08 1999
***************
*** 53,58 ****
--- 53,63 ----
   else
     {
       STRING_FIELD (result->pw_passwd, ISCOLON, 0);
+      /* truncate password at ',' in 14th character */
+      if ((result->pw_passwd != NULL) && (result->pw_passwd[13] == ','))
+        {
+          result->pw_passwd[13] = '\0';
+        }
       if (result->pw_name[0] == '+' || result->pw_name[0] == '-')
         {
         INT_FIELD_MAYBE_NULL (result->pw_uid, ISCOLON, 0, 10, , 0)