From fac3f524477c6760157be23f77683066398858b6 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Fri, 19 Nov 2010 18:40:21 +0100 Subject: [PATCH 1/4] rhbz#653921 - Can't change NIS password with yppasswd --- yp-tools-2.11-shadow.patch | 11 +++++++++++ yp-tools.spec | 14 +++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 yp-tools-2.11-shadow.patch diff --git a/yp-tools-2.11-shadow.patch b/yp-tools-2.11-shadow.patch new file mode 100644 index 0000000..1813ac4 --- /dev/null +++ b/yp-tools-2.11-shadow.patch @@ -0,0 +1,11 @@ +diff -up yp-tools-2.11/src/yppasswd.c.shadow yp-tools-2.11/src/yppasswd.c +--- yp-tools-2.11/src/yppasswd.c.shadow 2010-04-20 15:31:59.000000000 +0200 ++++ yp-tools-2.11/src/yppasswd.c 2010-11-19 18:37:14.931766315 +0100 +@@ -449,6 +449,7 @@ verifypassword (struct passwd *pwd, char + + passwdlen = get_passwd_len (pwd->pw_passwd); + if (pwd->pw_passwd[0] ++ && 0 != strcmp (pwd->pw_passwd, "x") /* don't check shadow passwords */ + && !strncmp (pwd->pw_passwd, crypt (pwdstr, pwd->pw_passwd), passwdlen) + && uid) + { diff --git a/yp-tools.spec b/yp-tools.spec index 2a50ab8..5838937 100644 --- a/yp-tools.spec +++ b/yp-tools.spec @@ -1,10 +1,11 @@ Summary: NIS (or YP) client programs Name: yp-tools Version: 2.11 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/yp-tools-%{version}.tar.bz2 +Patch0: yp-tools-2.11-shadow.patch Url: http://www.linux-nis.org/nis/yp-tools/index.html Requires: ypbind @@ -30,6 +31,7 @@ you'll need to install the ypserv package on one machine on the network. %prep %setup -q +%patch0 -p1 -b .shadow %build %configure --disable-domainname @@ -41,9 +43,6 @@ make DESTDIR="$RPM_BUILD_ROOT" INSTALL_PROGRAM=install install %find_lang %name -%clean -rm -rf $RPM_BUILD_ROOT - %files -f %{name}.lang %defattr(-,root,root,-) %doc AUTHORS COPYING README ChangeLog NEWS etc/nsswitch.conf @@ -54,13 +53,18 @@ rm -rf $RPM_BUILD_ROOT /var/yp/nicknames %changelog +* Fri Nov 19 2010 Karel Klic - 2.11-2 +- Added patch to fix yppasswd utility when used with shadow + passwords (rhbz#653921) +- Removed %%clean section + * Tue Apr 20 2010 Karel Klic - 2.11-1 - New upstream release - MD5, SHA-2 passwords patch merged by upstream - Removed BuildRoot tag * Thu Apr 15 2010 Karel Klic - 2.10-3 -- Added a new patch -passwords, which merges -md5 and -sha-2 patches +- Added a new patch -passwords, which merges -md5 and -sha-2 patches together, and adds proper MD5/SHA support to verifypassword() #514061 From 3846a90092052d82e6a3db604118c4772369ee86 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Tue, 23 Nov 2010 13:59:42 +0100 Subject: [PATCH 2/4] Do not compile ypmatch with ypclnt.c, use glibc's implementation instead of it --- yp-tools-2.12-noypclnt.patch | 11 +++++++++++ yp-tools.spec | 13 ++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 yp-tools-2.12-noypclnt.patch diff --git a/yp-tools-2.12-noypclnt.patch b/yp-tools-2.12-noypclnt.patch new file mode 100644 index 0000000..77fa1d3 --- /dev/null +++ b/yp-tools-2.12-noypclnt.patch @@ -0,0 +1,11 @@ +diff -up yp-tools-2.12/src/Makefile.am.noypclnt yp-tools-2.12/src/Makefile.am +--- yp-tools-2.12/src/Makefile.am.noypclnt 2010-11-23 13:32:54.328891585 +0100 ++++ yp-tools-2.12/src/Makefile.am 2010-11-23 13:33:02.167767691 +0100 +@@ -21,7 +21,6 @@ yppasswd_SOURCES = yppasswd.c yppasswd_x + yppasswd_LDADD = ${LDADD} @LIBCRYPT@ @LIBCRACK@ + yppasswd_CFLAGS = -DPASSWD_PROG=\"${PASSWD_PROG}\" \ + -DCHFN_PROG=\"${CHFN_PROG}\" -DCHSH_PROG=\"${CHSH_PROG}\" +-ypmatch_SOURCES = ypmatch.c ypclnt.c + + install-exec-hook: + ln -f ${DESTDIR}${bindir}/yppasswd ${DESTDIR}${bindir}/ypchsh diff --git a/yp-tools.spec b/yp-tools.spec index 5838937..2c28e65 100644 --- a/yp-tools.spec +++ b/yp-tools.spec @@ -1,13 +1,18 @@ Summary: NIS (or YP) client programs Name: yp-tools Version: 2.11 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/yp-tools-%{version}.tar.bz2 +# Not sent to upstream Patch0: yp-tools-2.11-shadow.patch +# Not sent to upstream +Patch1: yp-tools-2.12-noypclnt.patch Url: http://www.linux-nis.org/nis/yp-tools/index.html Requires: ypbind +# We need autoreconf for Patch1. +BuildRequires: autoconf, automake %description The Network Information Service (NIS) is a system which provides @@ -32,8 +37,10 @@ you'll need to install the ypserv package on one machine on the network. %prep %setup -q %patch0 -p1 -b .shadow +%patch1 -p1 -b .noypclnt %build +autoreconf %configure --disable-domainname make @@ -53,6 +60,10 @@ make DESTDIR="$RPM_BUILD_ROOT" INSTALL_PROGRAM=install install /var/yp/nicknames %changelog +* Tue Nov 23 2010 Karel Klic - 2.11-3 +- Added patch that removes ypclnt.c from being compiled into + ypmatch (rhbz#546149) + * Fri Nov 19 2010 Karel Klic - 2.11-2 - Added patch to fix yppasswd utility when used with shadow passwords (rhbz#653921) From bb22e4a153cc3d87c4fc86e93777b05e7ea12e96 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Tue, 23 Nov 2010 14:39:26 +0100 Subject: [PATCH 3/4] Reverted previous change --- yp-tools-2.12-noypclnt.patch | 11 ----------- yp-tools.spec | 11 ++++------- 2 files changed, 4 insertions(+), 18 deletions(-) delete mode 100644 yp-tools-2.12-noypclnt.patch diff --git a/yp-tools-2.12-noypclnt.patch b/yp-tools-2.12-noypclnt.patch deleted file mode 100644 index 77fa1d3..0000000 --- a/yp-tools-2.12-noypclnt.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up yp-tools-2.12/src/Makefile.am.noypclnt yp-tools-2.12/src/Makefile.am ---- yp-tools-2.12/src/Makefile.am.noypclnt 2010-11-23 13:32:54.328891585 +0100 -+++ yp-tools-2.12/src/Makefile.am 2010-11-23 13:33:02.167767691 +0100 -@@ -21,7 +21,6 @@ yppasswd_SOURCES = yppasswd.c yppasswd_x - yppasswd_LDADD = ${LDADD} @LIBCRYPT@ @LIBCRACK@ - yppasswd_CFLAGS = -DPASSWD_PROG=\"${PASSWD_PROG}\" \ - -DCHFN_PROG=\"${CHFN_PROG}\" -DCHSH_PROG=\"${CHSH_PROG}\" --ypmatch_SOURCES = ypmatch.c ypclnt.c - - install-exec-hook: - ln -f ${DESTDIR}${bindir}/yppasswd ${DESTDIR}${bindir}/ypchsh diff --git a/yp-tools.spec b/yp-tools.spec index 2c28e65..ff68e65 100644 --- a/yp-tools.spec +++ b/yp-tools.spec @@ -1,18 +1,14 @@ Summary: NIS (or YP) client programs Name: yp-tools Version: 2.11 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/yp-tools-%{version}.tar.bz2 # Not sent to upstream Patch0: yp-tools-2.11-shadow.patch -# Not sent to upstream -Patch1: yp-tools-2.12-noypclnt.patch Url: http://www.linux-nis.org/nis/yp-tools/index.html Requires: ypbind -# We need autoreconf for Patch1. -BuildRequires: autoconf, automake %description The Network Information Service (NIS) is a system which provides @@ -37,10 +33,8 @@ you'll need to install the ypserv package on one machine on the network. %prep %setup -q %patch0 -p1 -b .shadow -%patch1 -p1 -b .noypclnt %build -autoreconf %configure --disable-domainname make @@ -60,6 +54,9 @@ make DESTDIR="$RPM_BUILD_ROOT" INSTALL_PROGRAM=install install /var/yp/nicknames %changelog +* Tue Nov 23 2010 Karel Klic - 2.11-4 +- Reverted previous change + * Tue Nov 23 2010 Karel Klic - 2.11-3 - Added patch that removes ypclnt.c from being compiled into ypmatch (rhbz#546149) From 9e38a661d907b446c1b60ead67f642eb7c3a133f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Hor=C3=A1k?= Date: Thu, 5 May 2011 10:15:20 +0200 Subject: [PATCH 4/4] Fixed segmentation fault in yppoll used without hostname (rhbz#698619) Fixed man page typo --- yp-tools-2.11-gethost.patch | 34 ++++++++++++++++++++++++++++++++++ yp-tools-2.11-typo.patch | 12 ++++++++++++ yp-tools.spec | 13 ++++++++++++- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 yp-tools-2.11-gethost.patch create mode 100644 yp-tools-2.11-typo.patch diff --git a/yp-tools-2.11-gethost.patch b/yp-tools-2.11-gethost.patch new file mode 100644 index 0000000..ec8bbdc --- /dev/null +++ b/yp-tools-2.11-gethost.patch @@ -0,0 +1,34 @@ +diff -up yp-tools-2.11/.gethost.orig yp-tools-2.11/.gethost +diff -up yp-tools-2.11/src/yppoll.c.orig yp-tools-2.11/src/yppoll.c +--- yp-tools-2.11/src/yppoll.c.orig 2011-05-05 09:57:26.528805348 +0200 ++++ yp-tools-2.11/src/yppoll.c 2011-05-05 10:00:28.256533438 +0200 +@@ -218,7 +218,10 @@ main (int argc, char **argv) + + hent = gethostbyaddr ((char *)&clnt_saddr.sin_addr.s_addr, + sizeof (clnt_saddr.sin_addr.s_addr), AF_INET); +- hostname = strdup (hent->h_name); ++ if (hent) ++ { ++ hostname = strdup (hent->h_name); ++ } + } + else + { +@@ -261,7 +264,7 @@ main (int argc, char **argv) + &clnt_sock); + if (client == NULL) + { +- fprintf (stderr, _("Can't create connection to %s.\n"), hostname); ++ fprintf (stderr, _("Can't create connection to %s.\n"), hostname ? hostname : "unknown"); + return 1; + } + +@@ -279,7 +282,7 @@ main (int argc, char **argv) + if (clnt_res != TRUE) + { + fprintf (stdout, _("Domain %s is not supported by %s.\n"), domainname, +- hostname); ++ hostname ? hostname : "unknown"); + return 1; + } + diff --git a/yp-tools-2.11-typo.patch b/yp-tools-2.11-typo.patch new file mode 100644 index 0000000..ed50b88 --- /dev/null +++ b/yp-tools-2.11-typo.patch @@ -0,0 +1,12 @@ +diff -up yp-tools-2.11/man/ypmatch.1.in.typo yp-tools-2.11/man/ypmatch.1.in +--- yp-tools-2.11/man/ypmatch.1.in.typo 2011-05-05 09:52:14.754703060 +0200 ++++ yp-tools-2.11/man/ypmatch.1.in 2011-05-05 09:52:25.240571968 +0200 +@@ -5,7 +5,7 @@ + .\" + .\" This program is free software; you can redistribute it and/or modify + .\" it under the terms of the GNU General Public License version 2 as +-.\" published bythe Free Software Foundation. ++.\" published by the Free Software Foundation. + .\" + .\" This program is distributed in the hope that it will be useful, + .\" but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/yp-tools.spec b/yp-tools.spec index ff68e65..b4acb8c 100644 --- a/yp-tools.spec +++ b/yp-tools.spec @@ -1,12 +1,14 @@ Summary: NIS (or YP) client programs Name: yp-tools Version: 2.11 -Release: 4%{?dist} +Release: 6%{?dist} License: GPLv2 Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/yp-tools-%{version}.tar.bz2 # Not sent to upstream Patch0: yp-tools-2.11-shadow.patch +Patch1: yp-tools-2.11-typo.patch +Patch2: yp-tools-2.11-gethost.patch Url: http://www.linux-nis.org/nis/yp-tools/index.html Requires: ypbind @@ -33,6 +35,8 @@ you'll need to install the ypserv package on one machine on the network. %prep %setup -q %patch0 -p1 -b .shadow +%patch1 -p1 -b .typo +%patch2 -p1 -b .gethost %build %configure --disable-domainname @@ -54,6 +58,13 @@ make DESTDIR="$RPM_BUILD_ROOT" INSTALL_PROGRAM=install install /var/yp/nicknames %changelog +* Thu May 05 2011 Honza Horak - 2.11-6 +- Fixed segmentation fault in yppoll used without hostname + (rhbz#698619) + +* Thu May 05 2011 Honza Horak - 2.11-5 +- Fixed man page typo + * Tue Nov 23 2010 Karel Klic - 2.11-4 - Reverted previous change