Fix yppasswd password check when using passwd.adjunct

Patch by Gilbert E. Detillieux

Resolves: 1297955
This commit is contained in:
Petr Kubat 2016-11-28 14:14:30 +01:00
parent 3542e5e4c7
commit 68801fc7e2
2 changed files with 15 additions and 5 deletions

View File

@ -1,12 +1,19 @@
diff -up yp-tools-2.12/src/yppasswd.c.adjunct yp-tools-2.12/src/yppasswd.c
--- yp-tools-2.12/src/yppasswd.c.adjunct 2012-04-23 13:17:47.000988833 +0200
+++ yp-tools-2.12/src/yppasswd.c 2012-04-23 13:18:01.209802938 +0200
@@ -449,7 +449,7 @@ verifypassword (struct passwd *pwd, char
@@ -450,6 +450,7 @@
passwdlen = get_passwd_len (pwd->pw_passwd);
if (pwd->pw_passwd[0]
- && 0 != strcmp (pwd->pw_passwd, "x") /* don't check shadow passwords */
+ && 0 != strcmp (pwd->pw_passwd, "##") /* don't check passwords using passwd.adjunct feature */
&& 0 != strcmp (pwd->pw_passwd, "x") /* don't check shadow passwords */
+ && 0 != strncmp (pwd->pw_passwd, "##", 2) /* don't check passwords using passwd.adjunct feature */
&& uid)
{
char *crypted = crypt(pwdstr, pwd->pw_passwd);
@@ -774,6 +775,7 @@
/* 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 &&
+ 0 != strncmp (pwd->pw_passwd, "##", 2) && /* don't check passwords using passwd.adjunct feature */
strcmp (pwd->pw_passwd, hashpass ) != 0)
{
int passwdlen = get_passwd_len (pwd->pw_passwd);

View File

@ -1,7 +1,7 @@
Summary: NIS (or YP) client programs
Name: yp-tools
Version: 2.14
Release: 6%{?dist}
Release: 7%{?dist}
License: GPLv2
Group: System Environment/Base
Source: http://www.linux-nis.org/download/yp-tools/yp-tools-%{version}.tar.bz2
@ -60,6 +60,9 @@ make DESTDIR="$RPM_BUILD_ROOT" INSTALL_PROGRAM=install install
/var/yp/nicknames
%changelog
* Mon Nov 28 2016 Petr Kubat <pkubat@redhat.com> - 2.14-7
- Modified passwd.adjunct patch by Gilbert E. Detillieux (#1297955)
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.14-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild