1 |
commit: ad858cef5d3bd1903ab5fe60a77bd11786ed8da7 |
2 |
Author: Dagg <daggs <AT> gmx <DOT> com> |
3 |
AuthorDate: Sat Jan 10 14:37:00 2015 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 31 21:50:25 2015 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=ad858cef |
7 |
|
8 |
net-libs/libnfsidmap: include <sys/types.h> |
9 |
|
10 |
--- |
11 |
.../files/0001-add_missing_header_musl.patch | 12 +++ |
12 |
.../files/libnfsidmap-0.19-getgrouplist.patch | 115 +++++++++++++++++++++ |
13 |
.../files/libnfsidmap-0.21-headers.patch | 22 ++++ |
14 |
net-libs/libnfsidmap/libnfsidmap-0.24-r99.ebuild | 48 +++++++++ |
15 |
net-libs/libnfsidmap/metadata.xml | 5 + |
16 |
5 files changed, 202 insertions(+) |
17 |
|
18 |
diff --git a/net-libs/libnfsidmap/files/0001-add_missing_header_musl.patch b/net-libs/libnfsidmap/files/0001-add_missing_header_musl.patch |
19 |
new file mode 100644 |
20 |
index 0000000..c94748e |
21 |
--- /dev/null |
22 |
+++ b/net-libs/libnfsidmap/files/0001-add_missing_header_musl.patch |
23 |
@@ -0,0 +1,12 @@ |
24 |
+--- cfg.h 2015-01-10 14:25:50.384148769 +0000 |
25 |
++++ cfg.h 2015-01-10 14:28:23.062148769 +0000 |
26 |
+@@ -33,6 +33,9 @@ |
27 |
+ #ifndef _CONF_H_ |
28 |
+ #define _CONF_H_ |
29 |
+ |
30 |
++#if ! defined(__GLIBC__) || ! defined(__UCLIBC__) |
31 |
++#include <sys/types.h> |
32 |
++#endif |
33 |
+ #include "queue.h" |
34 |
+ |
35 |
+ struct conf_list_node { |
36 |
|
37 |
diff --git a/net-libs/libnfsidmap/files/libnfsidmap-0.19-getgrouplist.patch b/net-libs/libnfsidmap/files/libnfsidmap-0.19-getgrouplist.patch |
38 |
new file mode 100644 |
39 |
index 0000000..0d5d367 |
40 |
--- /dev/null |
41 |
+++ b/net-libs/libnfsidmap/files/libnfsidmap-0.19-getgrouplist.patch |
42 |
@@ -0,0 +1,115 @@ |
43 |
+http://bugs.gentoo.org/169909 |
44 |
+ |
45 |
+--- libnfsidmap-0.19/configure.in |
46 |
++++ libnfsidmap-0.19/configure.in |
47 |
+@@ -38,7 +38,7 @@ |
48 |
+ |
49 |
+ # Checks for library functions. |
50 |
+ AC_FUNC_MALLOC |
51 |
+-AC_CHECK_FUNCS([strchr strdup]) |
52 |
++AC_CHECK_FUNCS([strchr strdup getgrouplist]) |
53 |
+ |
54 |
+ AC_CONFIG_FILES([Makefile]) |
55 |
+ AC_OUTPUT(libnfsidmap.pc) |
56 |
+--- libnfsidmap-0.19/nss.c |
57 |
++++ libnfsidmap-0.19/nss.c |
58 |
+@@ -49,6 +49,8 @@ |
59 |
+ #include "cfg.h" |
60 |
+ #include <syslog.h> |
61 |
+ |
62 |
++#include "getgrouplist.c" |
63 |
++ |
64 |
+ /* |
65 |
+ * NSS Translation Methods |
66 |
+ * |
67 |
+--- libnfsidmap-0.19/getgrouplist.c |
68 |
++++ libnfsidmap-0.19/getgrouplist.c |
69 |
+@@ -0,0 +1,88 @@ |
70 |
++/* |
71 |
++ * getgrouplist.c |
72 |
++ * |
73 |
++ * if system does not provide the non-standard getgrouplist, we will emulate |
74 |
++ * it via POSIX standard functions |
75 |
++ * |
76 |
++ * Copyright (c) 1991, 1993 |
77 |
++ * The Regents of the University of California. All rights reserved. |
78 |
++ * |
79 |
++ * Redistribution and use in source and binary forms, with or without |
80 |
++ * modification, are permitted provided that the following conditions |
81 |
++ * are met: |
82 |
++ * 1. Redistributions of source code must retain the above copyright |
83 |
++ * notice, this list of conditions and the following disclaimer. |
84 |
++ * 2. Redistributions in binary form must reproduce the above copyright |
85 |
++ * notice, this list of conditions and the following disclaimer in the |
86 |
++ * documentation and/or other materials provided with the distribution. |
87 |
++ * 4. Neither the name of the University nor the names of its contributors |
88 |
++ * may be used to endorse or promote products derived from this software |
89 |
++ * without specific prior written permission. |
90 |
++ * |
91 |
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
92 |
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
93 |
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
94 |
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
95 |
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
96 |
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
97 |
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
98 |
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
99 |
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
100 |
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
101 |
++ * SUCH DAMAGE. |
102 |
++ */ |
103 |
++ |
104 |
++#ifdef HAVE_CONFIG_H |
105 |
++#include "config.h" |
106 |
++#endif |
107 |
++#include <sys/types.h> |
108 |
++#include <grp.h> |
109 |
++#include <string.h> |
110 |
++#include <unistd.h> |
111 |
++ |
112 |
++#ifndef HAVE_GETGROUPLIST |
113 |
++static |
114 |
++int |
115 |
++getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt) |
116 |
++{ |
117 |
++ const struct group *grp; |
118 |
++ int i, maxgroups, ngroups, ret; |
119 |
++ |
120 |
++ ret = 0; |
121 |
++ ngroups = 0; |
122 |
++ maxgroups = *grpcnt; |
123 |
++ /* |
124 |
++ * When installing primary group, duplicate it; |
125 |
++ * the first element of groups is the effective gid |
126 |
++ * and will be overwritten when a setgid file is executed. |
127 |
++ */ |
128 |
++ groups[ngroups++] = agroup; |
129 |
++ if (maxgroups > 1) |
130 |
++ groups[ngroups++] = agroup; |
131 |
++ /* |
132 |
++ * Scan the group file to find additional groups. |
133 |
++ */ |
134 |
++ setgrent(); |
135 |
++ while ((grp = getgrent()) != NULL) { |
136 |
++ for (i = 0; i < ngroups; i++) { |
137 |
++ if (grp->gr_gid == groups[i]) |
138 |
++ goto skip; |
139 |
++ } |
140 |
++ for (i = 0; grp->gr_mem[i]; i++) { |
141 |
++ if (!strcmp(grp->gr_mem[i], uname)) { |
142 |
++ if (ngroups >= maxgroups) { |
143 |
++ ret = -1; |
144 |
++ break; |
145 |
++ } |
146 |
++ groups[ngroups++] = grp->gr_gid; |
147 |
++ break; |
148 |
++ } |
149 |
++ } |
150 |
++skip: |
151 |
++ ; |
152 |
++ } |
153 |
++ endgrent(); |
154 |
++ *grpcnt = ngroups; |
155 |
++ return (ret); |
156 |
++} |
157 |
++#endif |
158 |
|
159 |
diff --git a/net-libs/libnfsidmap/files/libnfsidmap-0.21-headers.patch b/net-libs/libnfsidmap/files/libnfsidmap-0.21-headers.patch |
160 |
new file mode 100644 |
161 |
index 0000000..6ef12d4 |
162 |
--- /dev/null |
163 |
+++ b/net-libs/libnfsidmap/files/libnfsidmap-0.21-headers.patch |
164 |
@@ -0,0 +1,22 @@ |
165 |
+for toupper and such |
166 |
+ |
167 |
+--- a/nss.c |
168 |
++++ b/nss.c |
169 |
+@@ -34,6 +34,7 @@ |
170 |
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
171 |
+ */ |
172 |
+ |
173 |
++#include <ctype.h> |
174 |
+ #include <sys/types.h> |
175 |
+ #include <errno.h> |
176 |
+ #include <unistd.h> |
177 |
+--- a/libnfsidmap.c |
178 |
++++ b/libnfsidmap.c |
179 |
+@@ -37,6 +37,7 @@ |
180 |
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
181 |
+ */ |
182 |
+ |
183 |
++#include <ctype.h> |
184 |
+ #include <sys/types.h> |
185 |
+ #include <errno.h> |
186 |
+ #include <unistd.h> |
187 |
|
188 |
diff --git a/net-libs/libnfsidmap/libnfsidmap-0.24-r99.ebuild b/net-libs/libnfsidmap/libnfsidmap-0.24-r99.ebuild |
189 |
new file mode 100644 |
190 |
index 0000000..4cab199 |
191 |
--- /dev/null |
192 |
+++ b/net-libs/libnfsidmap/libnfsidmap-0.24-r99.ebuild |
193 |
@@ -0,0 +1,48 @@ |
194 |
+# Copyright 1999-2014 Gentoo Foundation |
195 |
+# Distributed under the terms of the GNU General Public License v2 |
196 |
+# $Header: /var/cvsroot/gentoo-x86/net-libs/libnfsidmap/libnfsidmap-0.24.ebuild,v 1.8 2014/01/18 04:50:16 vapier Exp $ |
197 |
+ |
198 |
+EAPI="2" |
199 |
+ |
200 |
+inherit autotools eutils |
201 |
+ |
202 |
+DESCRIPTION="NFSv4 ID <-> name mapping library" |
203 |
+HOMEPAGE="http://www.citi.umich.edu/projects/nfsv4/linux/" |
204 |
+SRC_URI="http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${P}.tar.gz" |
205 |
+ |
206 |
+LICENSE="BSD" |
207 |
+SLOT="0" |
208 |
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86" |
209 |
+IUSE="ldap static-libs" |
210 |
+ |
211 |
+DEPEND="ldap? ( net-nds/openldap )" |
212 |
+RDEPEND="${DEPEND} |
213 |
+ !<net-fs/nfs-utils-1.2.2 |
214 |
+ !net-fs/idmapd" |
215 |
+ |
216 |
+src_prepare() { |
217 |
+ epatch "${FILESDIR}"/${PN}-0.19-getgrouplist.patch #169909 |
218 |
+ epatch "${FILESDIR}"/${PN}-0.21-headers.patch |
219 |
+ epatch "${FILESDIR}"/0001-add_missing_header_musl.patch |
220 |
+ epatch_user |
221 |
+ eautoreconf |
222 |
+} |
223 |
+ |
224 |
+src_configure() { |
225 |
+ econf \ |
226 |
+ --disable-dependency-tracking \ |
227 |
+ $(use_enable static-libs static) \ |
228 |
+ $(use_enable ldap) |
229 |
+} |
230 |
+ |
231 |
+src_install() { |
232 |
+ emake install DESTDIR="${D}" || die |
233 |
+ dodoc AUTHORS ChangeLog NEWS README |
234 |
+ |
235 |
+ insinto /etc |
236 |
+ doins idmapd.conf || die |
237 |
+ |
238 |
+ # remove useless files |
239 |
+ rm -f "${D}"/usr/lib*/libnfsidmap/*.{a,la} |
240 |
+ use static-libs || rm -f "${D}"/usr/lib*/*.la |
241 |
+} |
242 |
|
243 |
diff --git a/net-libs/libnfsidmap/metadata.xml b/net-libs/libnfsidmap/metadata.xml |
244 |
new file mode 100644 |
245 |
index 0000000..ca66751 |
246 |
--- /dev/null |
247 |
+++ b/net-libs/libnfsidmap/metadata.xml |
248 |
@@ -0,0 +1,5 @@ |
249 |
+<?xml version="1.0" encoding="UTF-8"?> |
250 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
251 |
+<pkgmetadata> |
252 |
+<herd>net-fs</herd> |
253 |
+</pkgmetadata> |