From 996e4bef29f040466e0a69c612201ee7ea0ab93b Mon Sep 17 00:00:00 2001 From: Matej Muzila Date: Fri, 19 May 2017 16:44:34 +0200 Subject: [PATCH] Update to version 4.2.2 supporting IPv6 --- .gitignore | 3 + sources | 2 +- yp-tools-2.12-crypt.patch | 24 -------- yp-tools-3.3-add_mapv4v6addr.h.patch | 85 ++++++++++++++++++++++++++ yp-tools-3.3-headers.patch | 16 +++++ yp-tools-3.3-no-nss-nis6.patch | 24 ++++++++ yp-tools-4.2.2-strict-prototypes.patch | 11 ++++ yp-tools.spec | 49 +++++++++++---- 8 files changed, 178 insertions(+), 36 deletions(-) create mode 100644 yp-tools-3.3-add_mapv4v6addr.h.patch create mode 100644 yp-tools-3.3-headers.patch create mode 100644 yp-tools-3.3-no-nss-nis6.patch create mode 100644 yp-tools-4.2.2-strict-prototypes.patch diff --git a/.gitignore b/.gitignore index c2fe9dc..51f2cd2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ yp-tools-2.11.tar.bz2 /yp-tools-2.12.tar.bz2 /yp-tools-2.14.tar.bz2 +/yp-tools-3.0.1.tar.bz2 +/yp-tools-3.3.tar.bz2 +/yp-tools-yp-tools-4.2.2.tar.gz diff --git a/sources b/sources index 7c8af04..33928cd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ba1f121c17e3ad65368be173b977cd13 yp-tools-2.14.tar.bz2 +SHA512 (yp-tools-yp-tools-4.2.2.tar.gz) = da60b1be08432f61789cbd62a491996f47bfcbe296723d1984b4d0d2e755022e40e682cfd779597008c823e7fca2f115d85d446893f2b8ce001aba5744c2cfce diff --git a/yp-tools-2.12-crypt.patch b/yp-tools-2.12-crypt.patch index 6d03d52..5e8ca41 100644 --- a/yp-tools-2.12-crypt.patch +++ b/yp-tools-2.12-crypt.patch @@ -1,30 +1,6 @@ diff -up yp-tools-2.12/src/yppasswd.c.crypt yp-tools-2.12/src/yppasswd.c --- yp-tools-2.12/src/yppasswd.c.crypt 2012-04-23 13:01:35.599721168 +0200 +++ yp-tools-2.12/src/yppasswd.c 2012-04-23 13:16:18.251261293 +0200 -@@ -448,13 +448,19 @@ verifypassword (struct passwd *pwd, char - } - - passwdlen = get_passwd_len (pwd->pw_passwd); -- if (pwd->pw_passwd[0] -+ 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) - { -- fputs (_("You cannot reuse the old password.\n"), stderr); -- return 0; -+ char *crypted = crypt(pwdstr, pwd->pw_passwd); -+ if(crypted == NULL) { -+ fputs (_("crypt() call failed.\n"), stderr); -+ return 0; -+ } -+ if(!strncmp (pwd->pw_passwd, crypted, passwdlen)) { -+ fputs (_("You cannot reuse the old password.\n"), stderr); -+ return 0; -+ } - } - - r = 0; @@ -772,9 +778,16 @@ main (int argc, char **argv) { int passwdlen = get_passwd_len (pwd->pw_passwd); diff --git a/yp-tools-3.3-add_mapv4v6addr.h.patch b/yp-tools-3.3-add_mapv4v6addr.h.patch new file mode 100644 index 0000000..f998460 --- /dev/null +++ b/yp-tools-3.3-add_mapv4v6addr.h.patch @@ -0,0 +1,85 @@ +diff -ruN yp-tools-3.3/nss_nis6/mapv4v6addr.h yp-tools-3.3-new/nss_nis6/mapv4v6addr.h +--- yp-tools-3.3/nss_nis6/mapv4v6addr.h 1970-01-01 01:00:00.000000000 +0100 ++++ yp-tools-3.3-new/nss_nis6/mapv4v6addr.h 2014-12-17 16:42:58.983438634 +0100 +@@ -0,0 +1,69 @@ ++/* ++ * ++Copyright++ 1985, 1988, 1993 ++ * - ++ * Copyright (c) 1985, 1988, 1993 ++ * The Regents of the University of California. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 4. Neither the name of the University nor the names of its contributors ++ * may be used to endorse or promote products derived from this software ++ * without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ * - ++ * Portions Copyright (c) 1993 by Digital Equipment Corporation. ++ * ++ * Permission to use, copy, modify, and distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies, and that ++ * the name of Digital Equipment Corporation not be used in advertising or ++ * publicity pertaining to distribution of the document or software without ++ * specific, written prior permission. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL ++ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT ++ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL ++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR ++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ++ * SOFTWARE. ++ * - ++ * --Copyright-- ++ */ ++ ++#include ++#include ++ ++static void ++map_v4v6_address (const char *src, char *dst) ++{ ++ u_char *p = (u_char *) dst; ++ int i; ++ ++ /* Move the IPv4 part to the right position. */ ++ memcpy (dst + 12, src, INADDRSZ); ++ ++ /* Mark this ipv6 addr as a mapped ipv4. */ ++ for (i = 0; i < 10; i++) ++ *p++ = 0x00; ++ *p++ = 0xff; ++ *p = 0xff; ++} +diff -ruN yp-tools-3.3/nss_nis6/nis-hosts.c yp-tools-3.3-new/nss_nis6/nis-hosts.c +--- yp-tools-3.3/nss_nis6/nis-hosts.c 2014-10-29 15:28:02.000000000 +0100 ++++ yp-tools-3.3-new/nss_nis6/nis-hosts.c 2014-12-17 16:43:46.308339552 +0100 +@@ -36,7 +36,7 @@ + #include "nss-nis6.h" + + /* Get implementation for some internal functions. */ +-#include ++#include + + #define ENTNAME hostent + #define DATABASE "hosts" diff --git a/yp-tools-3.3-headers.patch b/yp-tools-3.3-headers.patch new file mode 100644 index 0000000..a0af088 --- /dev/null +++ b/yp-tools-3.3-headers.patch @@ -0,0 +1,16 @@ +diff -rup yp-tools-3.3-orig/lib/yp_xdr.c yp-tools-3.3/lib/yp_xdr.c +--- yp-tools-3.3-orig/lib/yp_xdr.c 2014-10-31 14:00:08.000000000 +0100 ++++ yp-tools-3.3/lib/yp_xdr.c 2015-04-15 15:53:29.854511186 +0200 +@@ -45,9 +45,9 @@ + #define XDRMAXRECORD (16 * 1024 * 1024) + + bool_t +-xdr_ypstat (XDR *xdrs, ypstat *objp) ++xdr_ypstat (XDR *xdrs, enum ypbind_resptype * __objp) + { +- return xdr_enum (xdrs, (enum_t *) objp); ++ return xdr_enum (xdrs, (enum_t *) __objp); + } + + bool_t +Only in yp-tools-3.3/lib: .yp_xdr.c.swp diff --git a/yp-tools-3.3-no-nss-nis6.patch b/yp-tools-3.3-no-nss-nis6.patch new file mode 100644 index 0000000..5abab57 --- /dev/null +++ b/yp-tools-3.3-no-nss-nis6.patch @@ -0,0 +1,24 @@ +diff -ru yp-tools-3.3-orig/Makefile.am yp-tools-3.3/Makefile.am +--- yp-tools-3.3-orig/Makefile.am 2014-10-29 15:28:02.000000000 +0100 ++++ yp-tools-3.3/Makefile.am 2014-12-10 18:47:11.864137423 +0100 +@@ -5,7 +5,7 @@ + # + AUTOMAKE_OPTIONS = 1.5 gnits dist-bzip2 + # +-SUBDIRS = lib src nss_nis6 po man etc ++SUBDIRS = lib src po man etc + + CLEANFILES = *~ + +diff -ru yp-tools-3.3-orig/Makefile.in yp-tools-3.3/Makefile.in +--- yp-tools-3.3-orig/Makefile.in 2014-12-05 12:44:37.000000000 +0100 ++++ yp-tools-3.3/Makefile.in 2014-12-10 18:16:20.996550012 +0100 +@@ -382,7 +382,7 @@ + # + AUTOMAKE_OPTIONS = 1.5 gnits dist-bzip2 + # +-SUBDIRS = lib src nss_nis6 po man etc ++SUBDIRS = lib src po man etc + CLEANFILES = *~ + ACLOCAL_AMFLAGS = -I m4 + M4_FILES = m4/getline.m4 diff --git a/yp-tools-4.2.2-strict-prototypes.patch b/yp-tools-4.2.2-strict-prototypes.patch new file mode 100644 index 0000000..546eb6a --- /dev/null +++ b/yp-tools-4.2.2-strict-prototypes.patch @@ -0,0 +1,11 @@ +--- yp-tools-yp-tools-4.2.2/src/yppasswd.c.strict-protorypes 2017-02-21 15:51:03.452034055 +0100 ++++ yp-tools-yp-tools-4.2.2/src/yppasswd.c 2017-02-21 15:51:14.996030455 +0100 +@@ -547,7 +547,7 @@ create_random_salt (char *salt, int num_ + * If other value is set or it is not set at all, SHA-512 is used. + */ + static int +-get_env_hash_id() ++get_env_hash_id(void) + { + const char *v = getenv("YP_PASSWD_HASH"); + if (!v) diff --git a/yp-tools.spec b/yp-tools.spec index 3946d74..11f4e58 100644 --- a/yp-tools.spec +++ b/yp-tools.spec @@ -1,22 +1,28 @@ Summary: NIS (or YP) client programs Name: yp-tools -Version: 2.14 -Release: 4%{?dist} +Version: 4.2.2 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base -Source: http://www.linux-nis.org/download/yp-tools/yp-tools-%{version}.tar.bz2 +Source: http://www.linux-nis.org/download/yp-tools/yp-tools-yp-tools-%{version}.tar.gz # Not sent to upstream Patch0: yp-tools-2.11-shadow.patch Patch3: yp-tools-2.12-hash.patch Patch4: yp-tools-2.12-crypt.patch Patch5: yp-tools-2.12-adjunct.patch +Patch6: yp-tools-3.3-add_mapv4v6addr.h.patch +Patch7: yp-tools-3.3-headers.patch +Patch8: yp-tools-4.2.2-strict-prototypes.patch Url: http://www.linux-nis.org/nis/yp-tools/index.html -BuildRequires: autoconf, automake, gettext-devel +BuildRequires: autoconf, automake, gettext-devel, libtool, libtirpc-devel, libnsl2-devel Requires: ypbind +Requires: glibc + +%global __filter_GLIBC_PRIVATE 1 %description The Network Information Service (NIS) is a system which provides -network information (login names, passwords, home directories, group +network information (login names, passwords, home directories, groupinformation) to all of the machines on a network. NIS can enable information) to all of the machines on a network. NIS can enable users to login on any machine on the network, as long as the machine has the NIS client programs running and the user's password is @@ -34,17 +40,33 @@ on your network. You will also need to install the ypbind package on every machine running NIS client programs. If you need an NIS server, you'll need to install the ypserv package on one machine on the network. +%package devel +Summary: NIS (or YP) client programs +Group: System Environment/Base +Requires: yp-tools + +%description devel +Install yp-tools-devel package for developing applications that use yp-tools + + %prep -%setup -q -%patch0 -p1 -b .shadow +%setup -q -n %{name}-%{name}-%{version} +#%patch0 -p1 -b .shadow %patch3 -p1 -b .hash %patch4 -p1 -b .crypt -%patch5 -p1 -b .adjunct -autoreconf -i -f +#%patch5 -p1 -b .adjunct +%patch8 -p1 -b .strict-prototypes + + +autoreconf -i -f -v %build + +export CFLAGS="$CFLAGS %{optflags}" + %configure --disable-domainname -make + +%make_build %install make DESTDIR="$RPM_BUILD_ROOT" INSTALL_PROGRAM=install install @@ -53,13 +75,18 @@ make DESTDIR="$RPM_BUILD_ROOT" INSTALL_PROGRAM=install install %files -f %{name}.lang %doc AUTHORS COPYING README ChangeLog NEWS etc/nsswitch.conf -%doc THANKS TODO +%doc THANKS %{_bindir}/* + + %{_mandir}/*/* %{_sbindir}/* /var/yp/nicknames %changelog +* Fri May 19 2017 Matej Mužila - 4.2.2-1 +- Update to version 4.2.2 supporting IPv6 + * Mon Aug 18 2014 Fedora Release Engineering - 2.14-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild