public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-auth/libnss-nis/files/, sys-auth/libnss-nis/
@ 2017-11-17 23:20 Andreas Hüttel
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Hüttel @ 2017-11-17 23:20 UTC (permalink / raw
  To: gentoo-commits

commit:     7cf52c674ca56d22b039982de815439c0d102bf2
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 17 19:13:26 2017 +0000
Commit:     Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Fri Nov 17 23:20:43 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7cf52c67

sys-auth/libnss-nis: new package

(Note added- I've made it install into /usr for the moment. dilfridge)

Bug: https://bugs.gentoo.org/637946
Closes: https://github.com/gentoo/gentoo/pull/6214
Package-Manager: Portage-2.3.14_p5, Repoman-2.3.6

 sys-auth/libnss-nis/Manifest                     |   1 +
 sys-auth/libnss-nis/files/map_v4v6_address.patch | 112 +++++++++++++++++++++++
 sys-auth/libnss-nis/libnss-nis-1.3.ebuild        |  49 ++++++++++
 sys-auth/libnss-nis/metadata.xml                 |   7 ++
 4 files changed, 169 insertions(+)

diff --git a/sys-auth/libnss-nis/Manifest b/sys-auth/libnss-nis/Manifest
new file mode 100644
index 00000000000..49a50549026
--- /dev/null
+++ b/sys-auth/libnss-nis/Manifest
@@ -0,0 +1 @@
+DIST libnss-nis-1.3.tar.gz 208580 SHA256 ddf49c60b2eb944929d5b7ffe74d6c95f9df0843e68d450cf5ba0f35b59c906d SHA512 d5af3223da2202f2f3168f127980bb6b3f3c5939e2efe4d68fe3d13b6068898be7a64494f2c80a31afa77fb411c8d360519e5d26709d6aebca2bfb2d0c09cd26 WHIRLPOOL a181277f93183fa33abb07c838a03b3e1373d8471577f85083d0e07cb7a9865c383a073df9d5f9700d56d483c1409cb5b4dfaa2194a8d0db3f7fc78620b348ea

diff --git a/sys-auth/libnss-nis/files/map_v4v6_address.patch b/sys-auth/libnss-nis/files/map_v4v6_address.patch
new file mode 100644
index 00000000000..85a69d71c5b
--- /dev/null
+++ b/sys-auth/libnss-nis/files/map_v4v6_address.patch
@@ -0,0 +1,112 @@
+From df903b621d4010c94129455a3f8d91d66f0fcd1f Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Fri, 17 Nov 2017 13:44:10 -0500
+Subject: [PATCH] Copy the map_v4v6_address function from glibc
+
+Fixes: https://github.com/thkukuk/libnss_nis/issues/1
+---
+ src/Makefile.am        |  3 ++-
+ src/map_v4v6_address.h | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/nis-hosts.c        |  3 +--
+ 3 files changed, 71 insertions(+), 3 deletions(-)
+ create mode 100644 src/map_v4v6_address.h
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 9eb3d35..56108aa 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -27,4 +27,5 @@ libnss_nis_la_LIBADD = @LIBNSL_LIBS@
+ libnss_nis_la_SOURCES = nis-alias.c nis-ethers.c nis-grp.c nis-hosts.c \
+ 			nis-initgroups.c nis-netgrp.c nis-network.c  \
+ 			nis-proto.c nis-publickey.c nis-pwd.c nis-rpc.c \
+-			nis-service.c nis-spwd.c nss-nis.c nss-default.c
++			nis-service.c nis-spwd.c nss-nis.c nss-default.c \
++			map_v4v6_address.h
+diff --git a/src/map_v4v6_address.h b/src/map_v4v6_address.h
+new file mode 100644
+index 0000000..d9a46c9
+--- /dev/null
++++ b/src/map_v4v6_address.h
+@@ -0,0 +1,68 @@
++/*
++ * ++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--
++ */
++
++static void
++map_v4v6_address (const char *src, char *dst)
++{
++	u_char *p = (u_char *)dst;
++	char tmp[INADDRSZ];
++	int i;
++
++	/* Stash a temporary copy so our caller can update in place. */
++	memcpy(tmp, src, INADDRSZ);
++	/* Mark this ipv6 addr as a mapped ipv4. */
++	for (i = 0; i < 10; i++)
++		*p++ = 0x00;
++	*p++ = 0xff;
++	*p++ = 0xff;
++	/* Retrieve the saved copy and we're done. */
++	memcpy((void*)p, tmp, INADDRSZ);
++}
+diff --git a/src/nis-hosts.c b/src/nis-hosts.c
+index ef6bb47..53ab965 100644
+--- a/src/nis-hosts.c
++++ b/src/nis-hosts.c
+@@ -35,8 +35,7 @@
+ #include "libc-lock.h"
+ #include "nss-nis.h"
+ 
+-/* Get implementation for some internal functions. */
+-#include <resolv/mapv4v6addr.h>
++#include "map_v4v6_address.h"
+ 
+ #define ENTNAME         hostent
+ #define DATABASE        "hosts"

diff --git a/sys-auth/libnss-nis/libnss-nis-1.3.ebuild b/sys-auth/libnss-nis/libnss-nis-1.3.ebuild
new file mode 100644
index 00000000000..77a404b8bca
--- /dev/null
+++ b/sys-auth/libnss-nis/libnss-nis-1.3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools multilib-minimal
+
+DESCRIPTION="NSS module to provide NIS support"
+HOMEPAGE="https://github.com/thkukuk/libnss_nis"
+SRC_URI="https://github.com/thkukuk/libnss_nis/archive/libnss_nis-${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1+ BSD ISC"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="
+	net-libs/libnsl:0=[${MULTILIB_USEDEP}]
+	net-libs/libtirpc:0=[${MULTILIB_USEDEP}]
+	!<sys-libs/glibc-2.26
+"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+"
+
+S=${WORKDIR}/libnss_nis-libnss_nis-${PV}
+
+PATCHES=(
+	"${FILESDIR}/map_v4v6_address.patch"
+)
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
+multilib_src_configure() {
+	local myconf=(
+		--enable-shared
+		--disable-static
+	)
+	ECONF_SOURCE=${S} econf "${myconf[@]}"
+}
+
+multilib_src_install_all() {
+	einstalldocs
+	find "${ED}" -name '*.la' -delete || die
+}
+

diff --git a/sys-auth/libnss-nis/metadata.xml b/sys-auth/libnss-nis/metadata.xml
new file mode 100644
index 00000000000..fa331094dd3
--- /dev/null
+++ b/sys-auth/libnss-nis/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>toolchain@gentoo.org</email>
+	</maintainer>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-auth/libnss-nis/files/, sys-auth/libnss-nis/
@ 2020-02-18 15:03 Sergei Trofimovich
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Trofimovich @ 2020-02-18 15:03 UTC (permalink / raw
  To: gentoo-commits

commit:     d5fcf67ae6a2b338b367b8efc2869ba4466fc6fa
Author:     Stephan Hartmann <stha09 <AT> googlemail <DOT> com>
AuthorDate: Tue Feb 18 14:33:16 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 15:03:11 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5fcf67a

sys-auth/libnss-nis: fix build with glibc 2.30

Closes: https://bugs.gentoo.org/692768
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Stephan Hartmann <stha09 <AT> googlemail.com>
Closes: https://github.com/gentoo/gentoo/pull/14691
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../files/libnss-nis-1.4-glibc-2.30.patch          | 157 +++++++++++++++++++++
 sys-auth/libnss-nis/libnss-nis-1.4.ebuild          |   4 +-
 2 files changed, 160 insertions(+), 1 deletion(-)

diff --git a/sys-auth/libnss-nis/files/libnss-nis-1.4-glibc-2.30.patch b/sys-auth/libnss-nis/files/libnss-nis-1.4-glibc-2.30.patch
new file mode 100644
index 00000000000..ac8d497ecb4
--- /dev/null
+++ b/sys-auth/libnss-nis/files/libnss-nis-1.4-glibc-2.30.patch
@@ -0,0 +1,157 @@
+From e9f0f4286d5a923eca1a9c84ff125268d144822e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 25 Jul 2019 12:10:56 -0700
+Subject: [PATCH] nis-hosts: Remove use of RES_USE_INET6
+
+Upstream glibc dropped it starting glibc 2.30
+see
+https://sourceware.org/git/?p=glibc.git;a=commit;h=3f8b44be0a658266adff5ece1e4bc3ce097a5dbe
+
+Fixes issue #6
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/nis-hosts.c | 55 ++++++++++++-------------------------------------
+ 1 file changed, 13 insertions(+), 42 deletions(-)
+
+diff --git a/src/nis-hosts.c b/src/nis-hosts.c
+index 307b46e..bd3c4ad 100644
+--- a/src/nis-hosts.c
++++ b/src/nis-hosts.c
+@@ -35,15 +35,12 @@
+ #include "libc-lock.h"
+ #include "nss-nis.h"
+ 
+-/* Get implementation for some internal functions. */
+-#include "mapv4v6addr.h"
+-
+ #define ENTNAME         hostent
+ #define DATABASE        "hosts"
+ #define NEED_H_ERRNO
+ 
+-#define EXTRA_ARGS      , af, flags
+-#define EXTRA_ARGS_DECL , int af, int flags
++#define EXTRA_ARGS      , af
++#define EXTRA_ARGS_DECL , int af
+ 
+ #define ENTDATA hostent_data
+ struct hostent_data
+@@ -67,19 +64,8 @@ LINE_PARSER
+    /* Parse address.  */
+    if (af != AF_INET6 && inet_pton (AF_INET, addr, entdata->host_addr) > 0)
+      {
+-       assert ((flags & AI_V4MAPPED) == 0 || af != AF_UNSPEC);
+-       if (flags & AI_V4MAPPED)
+-	 {
+-	   map_v4v6_address ((char *) entdata->host_addr,
+-			     (char *) entdata->host_addr);
+-	   result->h_addrtype = AF_INET6;
+-	   result->h_length = IN6ADDRSZ;
+-	 }
+-       else
+-	 {
+-	   result->h_addrtype = AF_INET;
+-	   result->h_length = INADDRSZ;
+-	 }
++       result->h_addrtype = AF_INET;
++       result->h_length = INADDRSZ;
+      }
+    else if (af != AF_INET
+ 	    && inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
+@@ -134,7 +120,7 @@ strong_alias (_nss_nis_sethostent, _nss_nis_endhostent)
+ static enum nss_status
+ internal_nis_gethostent_r (struct hostent *host, char *buffer,
+ 			   size_t buflen, int *errnop, int *h_errnop,
+-			   int af, int flags)
++			   int af)
+ {
+   char *domain;
+   if (yp_get_default_domain (&domain))
+@@ -203,7 +189,7 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer,
+ 	++p;
+       free (result);
+ 
+-      parse_res = parse_line (p, host, data, buflen, errnop, af, flags);
++      parse_res = parse_line (p, host, data, buflen, errnop, af);
+       if (parse_res == -1)
+ 	{
+ 	  free (outkey);
+@@ -232,8 +218,7 @@ _nss_nis_gethostent_r (struct hostent *host, char *buffer, size_t buflen,
+   __libc_lock_lock (lock);
+ 
+   status = internal_nis_gethostent_r (host, buffer, buflen, errnop, h_errnop,
+-			((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET),
+-			((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0 ));
++			AF_INET);
+ 
+   __libc_lock_unlock (lock);
+ 
+@@ -244,7 +229,7 @@ _nss_nis_gethostent_r (struct hostent *host, char *buffer, size_t buflen,
+ static enum nss_status
+ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
+ 			   char *buffer, size_t buflen, int *errnop,
+-			   int *h_errnop, int flags)
++			   int *h_errnop)
+ {
+   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct parser_data);
+   buffer += pad;
+@@ -318,7 +303,7 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
+     ++p;
+   free (result);
+ 
+-  int parse_res = parse_line (p, host, data, buflen, errnop, af, flags);
++  int parse_res = parse_line (p, host, data, buflen, errnop, af);
+ 
+   if (parse_res < 1 || host->h_addrtype != af)
+     {
+@@ -351,8 +336,7 @@ _nss_nis_gethostbyname2_r (const char *name, int af, struct hostent *host,
+     }
+ 
+   return internal_gethostbyname2_r (name, af, host, buffer, buflen, errnop,
+-				    h_errnop,
+-			((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0));
++				    h_errnop);
+ }
+ 
+ 
+@@ -360,18 +344,8 @@ enum nss_status
+ _nss_nis_gethostbyname_r (const char *name, struct hostent *host, char *buffer,
+ 			  size_t buflen, int *errnop, int *h_errnop)
+ {
+-  if (_res.options & RES_USE_INET6)
+-    {
+-      enum nss_status status;
+-
+-      status = internal_gethostbyname2_r (name, AF_INET6, host, buffer, buflen,
+-					  errnop, h_errnop, AI_V4MAPPED);
+-      if (status == NSS_STATUS_SUCCESS)
+-	return status;
+-    }
+-
+   return internal_gethostbyname2_r (name, AF_INET, host, buffer, buflen,
+-				    errnop, h_errnop, 0);
++				    errnop, h_errnop);
+ }
+ 
+ 
+@@ -433,9 +407,7 @@ _nss_nis_gethostbyaddr_r (const void *addr, socklen_t addrlen, int af,
+     ++p;
+   free (result);
+ 
+-  int parse_res = parse_line (p, host, data, buflen, errnop, af,
+-			      ((_res.options & RES_USE_INET6)
+-			       ? AI_V4MAPPED : 0));
++  int parse_res = parse_line (p, host, data, buflen, errnop, af);
+   if (parse_res < 1)
+     {
+       if (parse_res == -1)
+@@ -532,8 +504,7 @@ _nss_nis_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+   buflen -= pad;
+ 
+   struct hostent host;
+-  int parse_res = parse_line (result, &host, data, buflen, errnop, AF_UNSPEC,
+-			      0);
++  int parse_res = parse_line (result, &host, data, buflen, errnop, AF_UNSPEC);
+   if (parse_res < 1)
+     {
+       if (parse_res == -1)

diff --git a/sys-auth/libnss-nis/libnss-nis-1.4.ebuild b/sys-auth/libnss-nis/libnss-nis-1.4.ebuild
index 2e568b159b3..859bbcea81f 100644
--- a/sys-auth/libnss-nis/libnss-nis-1.4.ebuild
+++ b/sys-auth/libnss-nis/libnss-nis-1.4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -24,6 +24,8 @@ DEPEND="${RDEPEND}
 
 S=${WORKDIR}/libnss_nis-${PV}
 
+PATCHES=( "${FILESDIR}/${P}-glibc-2.30.patch" )
+
 src_prepare() {
 	default
 	eautoreconf


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-18 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-17 23:20 [gentoo-commits] repo/gentoo:master commit in: sys-auth/libnss-nis/files/, sys-auth/libnss-nis/ Andreas Hüttel
  -- strict thread matches above, loose matches on Subject: below --
2020-02-18 15:03 Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox