1 |
commit: 0b221c4343840a141621811e896da9f4fa359869 |
2 |
Author: Jory Pratt <anarchy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 28 21:55:50 2019 +0000 |
4 |
Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 28 21:55:50 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=0b221c43 |
7 |
|
8 |
sys-auth/polkit: sync with tree, update netgroup patch |
9 |
|
10 |
Package-Manager: Portage-2.3.65, Repoman-2.3.12 |
11 |
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org> |
12 |
|
13 |
sys-auth/polkit/Manifest | 1 + |
14 |
...lkit-0.116-make-netgroup-support-optional.patch | 155 +++++++++++++++++++++ |
15 |
sys-auth/polkit/metadata.xml | 5 +- |
16 |
sys-auth/polkit/polkit-0.116.ebuild | 143 +++++++++++++++++++ |
17 |
4 files changed, 302 insertions(+), 2 deletions(-) |
18 |
|
19 |
diff --git a/sys-auth/polkit/Manifest b/sys-auth/polkit/Manifest |
20 |
index 3883c90..9a71461 100644 |
21 |
--- a/sys-auth/polkit/Manifest |
22 |
+++ b/sys-auth/polkit/Manifest |
23 |
@@ -1,2 +1,3 @@ |
24 |
DIST polkit-0.113.tar.gz 1448865 BLAKE2B 93cb6abf03d0de193e9f64b953bee40faf3bd07cf6f86beb4f84edd740dedc0bcf7a1ffd6b3a1a816e5adad0ee59536dacae3d991add4c4965cc6a98566b7470 SHA512 ab177c89a20eeb2978ddbe28afb205d3619f9c5defe833eb68a85e71a0f2c905367f1295cbbfb85da5eafdd661bce474d5d84aca9195cd425a18c9b4170eb5f9 |
25 |
DIST polkit-0.115.tar.gz 1550932 BLAKE2B 3185ebed46209f88a9ffccbbcaf1bf180d1ae6d5ec53cf3c66d867ad43910b47a1123a3db190991ebb382a0d28fc5a119ea4bab942db324e9af5663056cf6ee1 SHA512 1153011fa93145b2c184e6b3446d3ca21b38918641aeccd8fac3985ac3e30ec6bc75be6973985fde90f2a24236592f1595be259155061c2d33358dd17c4ee4fc |
26 |
+DIST polkit-0.116.tar.gz 1548311 BLAKE2B e9761a2934136d453a47b81dd1f132f9fc96c45b731d5fceb2aa7706f5325b6499f6acbb68032befc1b21878b1b54754685607c916ca8e02a8accca3ca014b31 SHA512 b66b01cc2bb4349de70147f41f161f0f6f41e7230b581dfb054058b48969ec57041ab05b51787c749ccfc36aa5f317952d7e7ba337b4f6f6c0a923ed5866c2d5 |
27 |
|
28 |
diff --git a/sys-auth/polkit/files/polkit-0.116-make-netgroup-support-optional.patch b/sys-auth/polkit/files/polkit-0.116-make-netgroup-support-optional.patch |
29 |
new file mode 100644 |
30 |
index 0000000..0b4b698 |
31 |
--- /dev/null |
32 |
+++ b/sys-auth/polkit/files/polkit-0.116-make-netgroup-support-optional.patch |
33 |
@@ -0,0 +1,155 @@ |
34 |
+From 6a46ff1b969a7109c6f5f25ebabaa943bbd5bdaf Mon Sep 17 00:00:00 2001 |
35 |
+From: |
36 |
+Date: Sun, 28 Apr 2019 16:46:26 -0500 |
37 |
+Subject: [PATCH] make netgroup support optional |
38 |
+ |
39 |
+--- |
40 |
+ configure.ac | 2 +- |
41 |
+ src/polkitbackend/init.js | 5 ++++- |
42 |
+ src/polkitbackend/polkitbackendinteractiveauthority.c | 4 ++++ |
43 |
+ src/polkitbackend/polkitbackendjsauthority.cpp | 8 ++++++-- |
44 |
+ test/polkitbackend/test-polkitbackendjsauthority.c | 6 ++++-- |
45 |
+ 5 files changed, 19 insertions(+), 6 deletions(-) |
46 |
+ |
47 |
+diff --git a/configure.ac b/configure.ac |
48 |
+index 5cedb4e..88ce2a6 100644 |
49 |
+--- a/configure.ac |
50 |
++++ b/configure.ac |
51 |
+@@ -99,7 +99,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"], |
52 |
+ [AC_MSG_ERROR([Can't find expat library. Please install expat.])]) |
53 |
+ AC_SUBST(EXPAT_LIBS) |
54 |
+ |
55 |
+-AC_CHECK_FUNCS(clearenv fdatasync) |
56 |
++AC_CHECK_FUNCS(clearenv fdatasync getnetgrent) |
57 |
+ |
58 |
+ if test "x$GCC" = "xyes"; then |
59 |
+ LDFLAGS="-Wl,--as-needed $LDFLAGS" |
60 |
+diff --git a/src/polkitbackend/init.js b/src/polkitbackend/init.js |
61 |
+index 79c80b6..2065cff 100644 |
62 |
+--- a/src/polkitbackend/init.js |
63 |
++++ b/src/polkitbackend/init.js |
64 |
+@@ -29,7 +29,10 @@ function Subject() { |
65 |
+ }; |
66 |
+ |
67 |
+ this.isInNetGroup = function(netGroup) { |
68 |
+- return polkit._userIsInNetGroup(this.user, netGroup); |
69 |
++ if (polkit._userIsInNetGroup) |
70 |
++ return polkit._userIsInNetGroup(this.user, netGroup); |
71 |
++ else |
72 |
++ return false; |
73 |
+ }; |
74 |
+ |
75 |
+ this.toString = function() { |
76 |
+diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c |
77 |
+index 056d9a8..559cd06 100644 |
78 |
+--- a/src/polkitbackend/polkitbackendinteractiveauthority.c |
79 |
++++ b/src/polkitbackend/polkitbackendinteractiveauthority.c |
80 |
+@@ -2225,6 +2225,7 @@ get_users_in_group (PolkitIdentity *group, |
81 |
+ return ret; |
82 |
+ } |
83 |
+ |
84 |
++#ifdef HAVE_GETNETGRENT |
85 |
+ static GList * |
86 |
+ get_users_in_net_group (PolkitIdentity *group, |
87 |
+ gboolean include_root) |
88 |
+@@ -2284,6 +2285,7 @@ get_users_in_net_group (PolkitIdentity *group, |
89 |
+ endnetgrent (); |
90 |
+ return ret; |
91 |
+ } |
92 |
++#endif |
93 |
+ |
94 |
+ /* ---------------------------------------------------------------------------------------------------- */ |
95 |
+ |
96 |
+@@ -2369,10 +2371,12 @@ authentication_agent_initiate_challenge (AuthenticationAgent *agent, |
97 |
+ { |
98 |
+ user_identities = g_list_concat (user_identities, get_users_in_group (identity, FALSE)); |
99 |
+ } |
100 |
++#ifdef HAVE_GETNETGRENT |
101 |
+ else if (POLKIT_IS_UNIX_NETGROUP (identity)) |
102 |
+ { |
103 |
+ user_identities = g_list_concat (user_identities, get_users_in_net_group (identity, FALSE)); |
104 |
+ } |
105 |
++#endif |
106 |
+ else |
107 |
+ { |
108 |
+ g_warning ("Unsupported identity"); |
109 |
+diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp |
110 |
+index 9b752d1..dcff711 100644 |
111 |
+--- a/src/polkitbackend/polkitbackendjsauthority.cpp |
112 |
++++ b/src/polkitbackend/polkitbackendjsauthority.cpp |
113 |
+@@ -192,13 +192,17 @@ static JSClass js_polkit_class = { |
114 |
+ |
115 |
+ static bool js_polkit_log (JSContext *cx, unsigned argc, JS::Value *vp); |
116 |
+ static bool js_polkit_spawn (JSContext *cx, unsigned argc, JS::Value *vp); |
117 |
++#ifdef HAVE_GETNETGRENT |
118 |
+ static bool js_polkit_user_is_in_netgroup (JSContext *cx, unsigned argc, JS::Value *vp); |
119 |
++#endif |
120 |
+ |
121 |
+ static JSFunctionSpec js_polkit_functions[] = |
122 |
+ { |
123 |
+ JS_FN("log", js_polkit_log, 0, 0), |
124 |
+ JS_FN("spawn", js_polkit_spawn, 0, 0), |
125 |
++#ifdef HAVE_GETNETGRENT |
126 |
+ JS_FN("_userIsInNetGroup", js_polkit_user_is_in_netgroup, 0, 0), |
127 |
++#endif |
128 |
+ JS_FS_END |
129 |
+ }; |
130 |
+ |
131 |
+@@ -1488,7 +1492,7 @@ js_polkit_spawn (JSContext *cx, |
132 |
+ |
133 |
+ /* ---------------------------------------------------------------------------------------------------- */ |
134 |
+ |
135 |
+- |
136 |
++#ifdef HAVE_GETNETGRENT |
137 |
+ static bool |
138 |
+ js_polkit_user_is_in_netgroup (JSContext *cx, |
139 |
+ unsigned argc, |
140 |
+@@ -1526,7 +1530,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx, |
141 |
+ |
142 |
+ return ret; |
143 |
+ } |
144 |
+- |
145 |
++#endif |
146 |
+ |
147 |
+ |
148 |
+ /* ---------------------------------------------------------------------------------------------------- */ |
149 |
+diff --git a/test/polkitbackend/test-polkitbackendjsauthority.c b/test/polkitbackend/test-polkitbackendjsauthority.c |
150 |
+index 71aad23..2b2a5d4 100644 |
151 |
+--- a/test/polkitbackend/test-polkitbackendjsauthority.c |
152 |
++++ b/test/polkitbackend/test-polkitbackendjsauthority.c |
153 |
+@@ -137,12 +137,14 @@ test_get_admin_identities (void) |
154 |
+ "unix-group:users" |
155 |
+ } |
156 |
+ }, |
157 |
++#ifdef HAVE_GETNETGRENT |
158 |
+ { |
159 |
+ "net.company.action3", |
160 |
+ { |
161 |
+ "unix-netgroup:foo" |
162 |
+ } |
163 |
+ }, |
164 |
++#endif |
165 |
+ }; |
166 |
+ guint n; |
167 |
+ |
168 |
+@@ -266,7 +268,7 @@ static const RulesTestCase rules_test_cases[] = { |
169 |
+ NULL, |
170 |
+ POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED, |
171 |
+ }, |
172 |
+- |
173 |
++#if HAVE_GETNETGRENT |
174 |
+ /* check netgroup membership */ |
175 |
+ { |
176 |
+ /* john is a member of netgroup 'foo', see test/etc/netgroup */ |
177 |
+@@ -284,7 +286,7 @@ static const RulesTestCase rules_test_cases[] = { |
178 |
+ NULL, |
179 |
+ POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED, |
180 |
+ }, |
181 |
+- |
182 |
++#endif |
183 |
+ /* spawning */ |
184 |
+ { |
185 |
+ "spawning_non_existing_helper", |
186 |
+-- |
187 |
+2.21.0 |
188 |
+ |
189 |
|
190 |
diff --git a/sys-auth/polkit/metadata.xml b/sys-auth/polkit/metadata.xml |
191 |
index 348a315..c60e1e3 100644 |
192 |
--- a/sys-auth/polkit/metadata.xml |
193 |
+++ b/sys-auth/polkit/metadata.xml |
194 |
@@ -5,7 +5,8 @@ |
195 |
<email>freedesktop-bugs@g.o</email> |
196 |
</maintainer> |
197 |
<use> |
198 |
- <flag name="elogind">Use <pkg>sys-auth/elogind</pkg> instead of <pkg>sys-auth/consolekit</pkg> for session tracking</flag> |
199 |
- <flag name="systemd">Use <pkg>sys-apps/systemd</pkg> instead of <pkg>sys-auth/consolekit</pkg> for session tracking</flag> |
200 |
+ <flag name="consolekit">Use <pkg>sys-auth/consolekit</pkg> for session tracking</flag> |
201 |
+ <flag name="elogind">Use <pkg>sys-auth/elogind</pkg> for session tracking</flag> |
202 |
+ <flag name="systemd">Use <pkg>sys-apps/systemd</pkg> for session tracking</flag> |
203 |
</use> |
204 |
</pkgmetadata> |
205 |
|
206 |
diff --git a/sys-auth/polkit/polkit-0.116.ebuild b/sys-auth/polkit/polkit-0.116.ebuild |
207 |
new file mode 100644 |
208 |
index 0000000..3cdf6ba |
209 |
--- /dev/null |
210 |
+++ b/sys-auth/polkit/polkit-0.116.ebuild |
211 |
@@ -0,0 +1,143 @@ |
212 |
+# Copyright 1999-2019 Gentoo Authors |
213 |
+# Distributed under the terms of the GNU General Public License v2 |
214 |
+ |
215 |
+EAPI=7 |
216 |
+ |
217 |
+inherit autotools pam pax-utils systemd user xdg-utils |
218 |
+ |
219 |
+DESCRIPTION="Policy framework for controlling privileges for system-wide services" |
220 |
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/polkit https://gitlab.freedesktop.org/polkit/polkit" |
221 |
+SRC_URI="https://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz" |
222 |
+ |
223 |
+LICENSE="LGPL-2" |
224 |
+SLOT="0" |
225 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" |
226 |
+IUSE="consolekit elogind examples gtk +introspection jit kde nls pam selinux systemd test" |
227 |
+ |
228 |
+REQUIRED_USE="^^ ( consolekit elogind systemd )" |
229 |
+ |
230 |
+BDEPEND=" |
231 |
+ app-text/docbook-xml-dtd:4.1.2 |
232 |
+ app-text/docbook-xsl-stylesheets |
233 |
+ dev-libs/gobject-introspection-common |
234 |
+ dev-libs/libxslt |
235 |
+ dev-util/glib-utils |
236 |
+ dev-util/gtk-doc-am |
237 |
+ dev-util/intltool |
238 |
+ sys-devel/gettext |
239 |
+ virtual/pkgconfig |
240 |
+ introspection? ( dev-libs/gobject-introspection ) |
241 |
+" |
242 |
+DEPEND=" |
243 |
+ dev-lang/spidermonkey:60[-debug] |
244 |
+ dev-libs/glib:2 |
245 |
+ dev-libs/expat |
246 |
+ elogind? ( sys-auth/elogind ) |
247 |
+ pam? ( |
248 |
+ sys-auth/pambase |
249 |
+ virtual/pam |
250 |
+ ) |
251 |
+ systemd? ( sys-apps/systemd:0=[policykit] ) |
252 |
+" |
253 |
+RDEPEND="${DEPEND} |
254 |
+ selinux? ( sec-policy/selinux-policykit ) |
255 |
+" |
256 |
+PDEPEND=" |
257 |
+ consolekit? ( sys-auth/consolekit[policykit] ) |
258 |
+ gtk? ( || ( |
259 |
+ >=gnome-extra/polkit-gnome-0.105 |
260 |
+ >=lxde-base/lxsession-0.5.2 |
261 |
+ ) ) |
262 |
+ kde? ( kde-plasma/polkit-kde-agent ) |
263 |
+" |
264 |
+ |
265 |
+DOCS=( docs/TODO HACKING NEWS README ) |
266 |
+ |
267 |
+PATCHES=( |
268 |
+ # bug 660880 |
269 |
+ "${FILESDIR}"/polkit-0.115-elogind.patch |
270 |
+ |
271 |
+ "${FILESDIR}"/polkit-0.116-make-netgroup-support-optional.patch |
272 |
+) |
273 |
+ |
274 |
+QA_MULTILIB_PATHS=" |
275 |
+ usr/lib/polkit-1/polkit-agent-helper-1 |
276 |
+ usr/lib/polkit-1/polkitd" |
277 |
+ |
278 |
+pkg_setup() { |
279 |
+ local u=polkitd |
280 |
+ local g=polkitd |
281 |
+ local h=/var/lib/polkit-1 |
282 |
+ |
283 |
+ enewgroup ${g} |
284 |
+ enewuser ${u} -1 -1 ${h} ${g} |
285 |
+ esethome ${u} ${h} |
286 |
+} |
287 |
+ |
288 |
+src_prepare() { |
289 |
+ default |
290 |
+ |
291 |
+ sed -i -e 's|unix-group:wheel|unix-user:0|' src/polkitbackend/*-default.rules || die #401513 |
292 |
+ |
293 |
+ # Workaround upstream hack around standard gtk-doc behavior, bug #552170 |
294 |
+ sed -i -e 's/@ENABLE_GTK_DOC_TRUE@\(TARGET_DIR\)/\1/' \ |
295 |
+ -e '/install-data-local:/,/uninstall-local:/ s/@ENABLE_GTK_DOC_TRUE@//' \ |
296 |
+ -e 's/@ENABLE_GTK_DOC_FALSE@install-data-local://' \ |
297 |
+ docs/polkit/Makefile.in || die |
298 |
+ |
299 |
+ # disable broken test - bug #624022 |
300 |
+ sed -i -e "/^SUBDIRS/s/polkitbackend//" test/Makefile.am || die |
301 |
+ |
302 |
+ # Fix cross-building, bug #590764, elogind patch, bug #598615 |
303 |
+ eautoreconf |
304 |
+} |
305 |
+ |
306 |
+src_configure() { |
307 |
+ xdg_environment_reset |
308 |
+ |
309 |
+ local myeconfargs=( |
310 |
+ --localstatedir="${EPREFIX}"/var |
311 |
+ --disable-static |
312 |
+ --enable-man-pages |
313 |
+ --disable-gtk-doc |
314 |
+ --disable-examples |
315 |
+ $(use_enable elogind libelogind) |
316 |
+ $(use_enable introspection) |
317 |
+ $(use_enable nls) |
318 |
+ $(usex pam "--with-pam-module-dir=$(getpam_mod_dir)" '') |
319 |
+ --with-authfw=$(usex pam pam shadow) |
320 |
+ $(use_enable systemd libsystemd-login) |
321 |
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" |
322 |
+ $(use_enable test) |
323 |
+ --with-os-type=gentoo |
324 |
+ ) |
325 |
+ econf "${myeconfargs[@]}" |
326 |
+} |
327 |
+ |
328 |
+src_compile() { |
329 |
+ default |
330 |
+ |
331 |
+ # Required for polkitd on hardened/PaX due to spidermonkey's JIT |
332 |
+ pax-mark mr src/polkitbackend/.libs/polkitd test/polkitbackend/.libs/polkitbackendjsauthoritytest |
333 |
+} |
334 |
+ |
335 |
+src_install() { |
336 |
+ default |
337 |
+ |
338 |
+ fowners -R polkitd:root /{etc,usr/share}/polkit-1/rules.d |
339 |
+ |
340 |
+ diropts -m0700 -o polkitd -g polkitd |
341 |
+ keepdir /var/lib/polkit-1 |
342 |
+ |
343 |
+ if use examples; then |
344 |
+ insinto /usr/share/doc/${PF}/examples |
345 |
+ doins src/examples/{*.c,*.policy*} |
346 |
+ fi |
347 |
+ |
348 |
+ find "${ED}" -name '*.la' -delete || die |
349 |
+} |
350 |
+ |
351 |
+pkg_postinst() { |
352 |
+ chown -R polkitd:root "${EROOT}"/{etc,usr/share}/polkit-1/rules.d |
353 |
+ chown -R polkitd:polkitd "${EROOT}"/var/lib/polkit-1 |
354 |
+} |