Bug 19045

Summary: yppasswd unable to change passwd on HPUX nis server
Product: [Retired] Red Hat Linux Reporter: Jorit Dorn <jorit>
Component: yp-toolsAssignee: Alexander Larsson <alexl>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2   
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: 2002-03-19 15:43:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The patch file none

Description Jorit Dorn 2000-10-13 13:13:11 UTC
Hi,
I found (and fixed a bug) in Red Hat Linux 6.2 (and possibly in 7.0 as
well).

The yppasswd didn't check for the length of the passwd entry (13 chars).
HPUX appends the
password aging information after the password. That causes an error.

The fix:
** yp-tools-2.4/src/yppasswd.c.orig    Fri Oct 22 12:49:45 1999
--- yp-tools-2.4/src/yppasswd.c Fri Oct 13 14:37:51 2000
***************
*** 581,587 ****
        /* We can't check the password with shadow passwords enabled. We
         * leave the checking to yppasswdd */
        if (uid != 0 && strcmp (pwd->pw_passwd, "x") != 0)
!         if (strcmp (crypt (s, pwd->pw_passwd), pwd->pw_passwd))
            {
              fprintf (stderr, _("Sorry.\n"));
            return 1;
--- 581,587 ----
        /* We can't check the password with shadow passwords enabled. We
         * leave the checking to yppasswdd */
        if (uid != 0 && strcmp (pwd->pw_passwd, "x") != 0)
!         if (strncmp (crypt (s, pwd->pw_passwd), pwd->pw_passwd,13))
            {
              fprintf (stderr, _("Sorry.\n"));
            return 1;

Please fix this. Thanks
Jorit

Comment 1 Jorit Dorn 2000-10-13 13:15:01 UTC
Created attachment 4124 [details]
The patch file

Comment 2 Alexander Larsson 2002-03-25 16:17:32 UTC
That patch is not correct. It breaks e.g. MD5 passwords.

I've added a patch that should work to yp-tools-2.6-4 (in rawhide soon). I'm
fairly sure it works, but please test it and reopen this bug if it is still broken.