1 |
commit: d5fcf67ae6a2b338b367b8efc2869ba4466fc6fa |
2 |
Author: Stephan Hartmann <stha09 <AT> googlemail <DOT> com> |
3 |
AuthorDate: Tue Feb 18 14:33:16 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 18 15:03:11 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5fcf67a |
7 |
|
8 |
sys-auth/libnss-nis: fix build with glibc 2.30 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/692768 |
11 |
Package-Manager: Portage-2.3.84, Repoman-2.3.20 |
12 |
Signed-off-by: Stephan Hartmann <stha09 <AT> googlemail.com> |
13 |
Closes: https://github.com/gentoo/gentoo/pull/14691 |
14 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
15 |
|
16 |
.../files/libnss-nis-1.4-glibc-2.30.patch | 157 +++++++++++++++++++++ |
17 |
sys-auth/libnss-nis/libnss-nis-1.4.ebuild | 4 +- |
18 |
2 files changed, 160 insertions(+), 1 deletion(-) |
19 |
|
20 |
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 |
21 |
new file mode 100644 |
22 |
index 00000000000..ac8d497ecb4 |
23 |
--- /dev/null |
24 |
+++ b/sys-auth/libnss-nis/files/libnss-nis-1.4-glibc-2.30.patch |
25 |
@@ -0,0 +1,157 @@ |
26 |
+From e9f0f4286d5a923eca1a9c84ff125268d144822e Mon Sep 17 00:00:00 2001 |
27 |
+From: Khem Raj <raj.khem@×××××.com> |
28 |
+Date: Thu, 25 Jul 2019 12:10:56 -0700 |
29 |
+Subject: [PATCH] nis-hosts: Remove use of RES_USE_INET6 |
30 |
+ |
31 |
+Upstream glibc dropped it starting glibc 2.30 |
32 |
+see |
33 |
+https://sourceware.org/git/?p=glibc.git;a=commit;h=3f8b44be0a658266adff5ece1e4bc3ce097a5dbe |
34 |
+ |
35 |
+Fixes issue #6 |
36 |
+ |
37 |
+Signed-off-by: Khem Raj <raj.khem@×××××.com> |
38 |
+--- |
39 |
+ src/nis-hosts.c | 55 ++++++++++++------------------------------------- |
40 |
+ 1 file changed, 13 insertions(+), 42 deletions(-) |
41 |
+ |
42 |
+diff --git a/src/nis-hosts.c b/src/nis-hosts.c |
43 |
+index 307b46e..bd3c4ad 100644 |
44 |
+--- a/src/nis-hosts.c |
45 |
++++ b/src/nis-hosts.c |
46 |
+@@ -35,15 +35,12 @@ |
47 |
+ #include "libc-lock.h" |
48 |
+ #include "nss-nis.h" |
49 |
+ |
50 |
+-/* Get implementation for some internal functions. */ |
51 |
+-#include "mapv4v6addr.h" |
52 |
+- |
53 |
+ #define ENTNAME hostent |
54 |
+ #define DATABASE "hosts" |
55 |
+ #define NEED_H_ERRNO |
56 |
+ |
57 |
+-#define EXTRA_ARGS , af, flags |
58 |
+-#define EXTRA_ARGS_DECL , int af, int flags |
59 |
++#define EXTRA_ARGS , af |
60 |
++#define EXTRA_ARGS_DECL , int af |
61 |
+ |
62 |
+ #define ENTDATA hostent_data |
63 |
+ struct hostent_data |
64 |
+@@ -67,19 +64,8 @@ LINE_PARSER |
65 |
+ /* Parse address. */ |
66 |
+ if (af != AF_INET6 && inet_pton (AF_INET, addr, entdata->host_addr) > 0) |
67 |
+ { |
68 |
+- assert ((flags & AI_V4MAPPED) == 0 || af != AF_UNSPEC); |
69 |
+- if (flags & AI_V4MAPPED) |
70 |
+- { |
71 |
+- map_v4v6_address ((char *) entdata->host_addr, |
72 |
+- (char *) entdata->host_addr); |
73 |
+- result->h_addrtype = AF_INET6; |
74 |
+- result->h_length = IN6ADDRSZ; |
75 |
+- } |
76 |
+- else |
77 |
+- { |
78 |
+- result->h_addrtype = AF_INET; |
79 |
+- result->h_length = INADDRSZ; |
80 |
+- } |
81 |
++ result->h_addrtype = AF_INET; |
82 |
++ result->h_length = INADDRSZ; |
83 |
+ } |
84 |
+ else if (af != AF_INET |
85 |
+ && inet_pton (AF_INET6, addr, entdata->host_addr) > 0) |
86 |
+@@ -134,7 +120,7 @@ strong_alias (_nss_nis_sethostent, _nss_nis_endhostent) |
87 |
+ static enum nss_status |
88 |
+ internal_nis_gethostent_r (struct hostent *host, char *buffer, |
89 |
+ size_t buflen, int *errnop, int *h_errnop, |
90 |
+- int af, int flags) |
91 |
++ int af) |
92 |
+ { |
93 |
+ char *domain; |
94 |
+ if (yp_get_default_domain (&domain)) |
95 |
+@@ -203,7 +189,7 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer, |
96 |
+ ++p; |
97 |
+ free (result); |
98 |
+ |
99 |
+- parse_res = parse_line (p, host, data, buflen, errnop, af, flags); |
100 |
++ parse_res = parse_line (p, host, data, buflen, errnop, af); |
101 |
+ if (parse_res == -1) |
102 |
+ { |
103 |
+ free (outkey); |
104 |
+@@ -232,8 +218,7 @@ _nss_nis_gethostent_r (struct hostent *host, char *buffer, size_t buflen, |
105 |
+ __libc_lock_lock (lock); |
106 |
+ |
107 |
+ status = internal_nis_gethostent_r (host, buffer, buflen, errnop, h_errnop, |
108 |
+- ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET), |
109 |
+- ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0 )); |
110 |
++ AF_INET); |
111 |
+ |
112 |
+ __libc_lock_unlock (lock); |
113 |
+ |
114 |
+@@ -244,7 +229,7 @@ _nss_nis_gethostent_r (struct hostent *host, char *buffer, size_t buflen, |
115 |
+ static enum nss_status |
116 |
+ internal_gethostbyname2_r (const char *name, int af, struct hostent *host, |
117 |
+ char *buffer, size_t buflen, int *errnop, |
118 |
+- int *h_errnop, int flags) |
119 |
++ int *h_errnop) |
120 |
+ { |
121 |
+ uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct parser_data); |
122 |
+ buffer += pad; |
123 |
+@@ -318,7 +303,7 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host, |
124 |
+ ++p; |
125 |
+ free (result); |
126 |
+ |
127 |
+- int parse_res = parse_line (p, host, data, buflen, errnop, af, flags); |
128 |
++ int parse_res = parse_line (p, host, data, buflen, errnop, af); |
129 |
+ |
130 |
+ if (parse_res < 1 || host->h_addrtype != af) |
131 |
+ { |
132 |
+@@ -351,8 +336,7 @@ _nss_nis_gethostbyname2_r (const char *name, int af, struct hostent *host, |
133 |
+ } |
134 |
+ |
135 |
+ return internal_gethostbyname2_r (name, af, host, buffer, buflen, errnop, |
136 |
+- h_errnop, |
137 |
+- ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0)); |
138 |
++ h_errnop); |
139 |
+ } |
140 |
+ |
141 |
+ |
142 |
+@@ -360,18 +344,8 @@ enum nss_status |
143 |
+ _nss_nis_gethostbyname_r (const char *name, struct hostent *host, char *buffer, |
144 |
+ size_t buflen, int *errnop, int *h_errnop) |
145 |
+ { |
146 |
+- if (_res.options & RES_USE_INET6) |
147 |
+- { |
148 |
+- enum nss_status status; |
149 |
+- |
150 |
+- status = internal_gethostbyname2_r (name, AF_INET6, host, buffer, buflen, |
151 |
+- errnop, h_errnop, AI_V4MAPPED); |
152 |
+- if (status == NSS_STATUS_SUCCESS) |
153 |
+- return status; |
154 |
+- } |
155 |
+- |
156 |
+ return internal_gethostbyname2_r (name, AF_INET, host, buffer, buflen, |
157 |
+- errnop, h_errnop, 0); |
158 |
++ errnop, h_errnop); |
159 |
+ } |
160 |
+ |
161 |
+ |
162 |
+@@ -433,9 +407,7 @@ _nss_nis_gethostbyaddr_r (const void *addr, socklen_t addrlen, int af, |
163 |
+ ++p; |
164 |
+ free (result); |
165 |
+ |
166 |
+- int parse_res = parse_line (p, host, data, buflen, errnop, af, |
167 |
+- ((_res.options & RES_USE_INET6) |
168 |
+- ? AI_V4MAPPED : 0)); |
169 |
++ int parse_res = parse_line (p, host, data, buflen, errnop, af); |
170 |
+ if (parse_res < 1) |
171 |
+ { |
172 |
+ if (parse_res == -1) |
173 |
+@@ -532,8 +504,7 @@ _nss_nis_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, |
174 |
+ buflen -= pad; |
175 |
+ |
176 |
+ struct hostent host; |
177 |
+- int parse_res = parse_line (result, &host, data, buflen, errnop, AF_UNSPEC, |
178 |
+- 0); |
179 |
++ int parse_res = parse_line (result, &host, data, buflen, errnop, AF_UNSPEC); |
180 |
+ if (parse_res < 1) |
181 |
+ { |
182 |
+ if (parse_res == -1) |
183 |
|
184 |
diff --git a/sys-auth/libnss-nis/libnss-nis-1.4.ebuild b/sys-auth/libnss-nis/libnss-nis-1.4.ebuild |
185 |
index 2e568b159b3..859bbcea81f 100644 |
186 |
--- a/sys-auth/libnss-nis/libnss-nis-1.4.ebuild |
187 |
+++ b/sys-auth/libnss-nis/libnss-nis-1.4.ebuild |
188 |
@@ -1,4 +1,4 @@ |
189 |
-# Copyright 1999-2019 Gentoo Authors |
190 |
+# Copyright 1999-2020 Gentoo Authors |
191 |
# Distributed under the terms of the GNU General Public License v2 |
192 |
|
193 |
EAPI=6 |
194 |
@@ -24,6 +24,8 @@ DEPEND="${RDEPEND} |
195 |
|
196 |
S=${WORKDIR}/libnss_nis-${PV} |
197 |
|
198 |
+PATCHES=( "${FILESDIR}/${P}-glibc-2.30.patch" ) |
199 |
+ |
200 |
src_prepare() { |
201 |
default |
202 |
eautoreconf |