Gentoo Archives: gentoo-commits

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