aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJory A. Pratt <anarchy@gentoo.org>2016-01-03 10:47:41 -0600
committerJory A. Pratt <anarchy@gentoo.org>2016-01-03 10:47:41 -0600
commit7ca67b391cdbbcb243af5c0b046bedeef40cbdca (patch)
tree11fc6ed14f4a2492f5812ea08b2f9f677e636354 /sys-auth
parentsys-apps/iproute2 - Fix up build to fully with with musl on ~arch (diff)
downloadmusl-7ca67b391cdbbcb243af5c0b046bedeef40cbdca.tar.gz
musl-7ca67b391cdbbcb243af5c0b046bedeef40cbdca.tar.bz2
musl-7ca67b391cdbbcb243af5c0b046bedeef40cbdca.zip
sys-auth/polkit - update netgroup support patch for ~arch
Diffstat (limited to 'sys-auth')
-rw-r--r--sys-auth/polkit/files/polkit-0.113-make-netgroup-support-optional.patch130
-rw-r--r--sys-auth/polkit/polkit-0.113.ebuild117
2 files changed, 247 insertions, 0 deletions
diff --git a/sys-auth/polkit/files/polkit-0.113-make-netgroup-support-optional.patch b/sys-auth/polkit/files/polkit-0.113-make-netgroup-support-optional.patch
new file mode 100644
index 00000000..232cc315
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.113-make-netgroup-support-optional.patch
@@ -0,0 +1,130 @@
+--- polkit-0.113/configure.ac
++++ polkit-0.113-optional-netgroup/configure.ac
+@@ -158,7 +158,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXP
+ [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
+ AC_SUBST(EXPAT_LIBS)
+
+-AC_CHECK_FUNCS(clearenv fdatasync)
++AC_CHECK_FUNCS(clearenv fdatasync getnetgrent)
+
+ if test "x$GCC" = "xyes"; then
+ LDFLAGS="-Wl,--as-needed $LDFLAGS"
+--- polkit-0.113/src/polkitbackend/init.js
++++ polkit-0.113-optional-netgroup/src/polkitbackend/init.js
+@@ -29,7 +29,10 @@ function Subject() {
+ };
+
+ this.isInNetGroup = function(netGroup) {
+- return polkit._userIsInNetGroup(this.user, netGroup);
++ if (polkit._userIsInNetGroup)
++ return polkit._userIsInNetGroup(this.user, netGroup);
++ else
++ return false;
+ };
+
+ this.toString = function() {
+--- polkit-0.113/src/polkitbackend/polkitbackendinteractiveauthority.c
++++ polkit-0.113-optional-netgroup/src/polkitbackend/polkitbackendinteractiveauthority.c
+@@ -2214,6 +2214,7 @@ get_users_in_group (PolkitIdentity
+ return ret;
+ }
+
++#ifdef HAVE_GETNETGRENT
+ static GList *
+ get_users_in_net_group (PolkitIdentity *group,
+ gboolean include_root)
+@@ -2269,6 +2270,7 @@ get_users_in_net_group (PolkitIdentity
+ endnetgrent ();
+ return ret;
+ }
++#endif
+
+ /* ---------------------------------------------------------------------------------------------------- */
+
+@@ -2355,10 +2357,12 @@ authentication_agent_initiate_challenge
+ {
+ user_identities = g_list_concat (user_identities, get_users_in_group (identity, FALSE));
+ }
++#ifdef HAVE_GETNETGRENT
+ else if (POLKIT_IS_UNIX_NETGROUP (identity))
+ {
+ user_identities = g_list_concat (user_identities, get_users_in_net_group (identity, FALSE));
+ }
++#endif
+ else
+ {
+ g_warning ("Unsupported identity");
+--- polkit-0.113/src/polkitbackend/polkitbackendjsauthority.c
++++ polkit-0.113-optional-netgroup/src/polkitbackend/polkitbackendjsauthority.c
+@@ -189,13 +189,16 @@ static JSClass js_polkit_class = {
+
+ static JSBool js_polkit_log (JSContext *cx, unsigned argc, jsval *vp);
+ static JSBool js_polkit_spawn (JSContext *cx, unsigned argc, jsval *vp);
++#ifdef HAVE_GETNETGRENT
+ static JSBool js_polkit_user_is_in_netgroup (JSContext *cx, unsigned argc, jsval *vp);
+-
++#endif
+ static JSFunctionSpec js_polkit_functions[] =
+ {
+ JS_FS("log", js_polkit_log, 0, 0),
+ JS_FS("spawn", js_polkit_spawn, 0, 0),
++#ifdef HAVE_GETNETGRENT
+ JS_FS("_userIsInNetGroup", js_polkit_user_is_in_netgroup, 0, 0),
++#endif
+ JS_FS_END
+ };
+
+@@ -1498,7 +1501,7 @@ js_polkit_spawn (JSContext *cx,
+
+ /* ---------------------------------------------------------------------------------------------------- */
+
+-
++#ifdef HAVE_GETNETGRENT
+ static JSBool
+ js_polkit_user_is_in_netgroup (JSContext *cx,
+ unsigned argc,
+@@ -1535,7 +1538,7 @@ js_polkit_user_is_in_netgroup (JSContext
+ out:
+ return ret;
+ }
+-
++#endif
+
+
+ /* ---------------------------------------------------------------------------------------------------- */
+--- polkit-0.113/test/polkitbackend/test-polkitbackendjsauthority.c
++++ polkit-0.113-optional-netgroup/test/polkitbackend/test-polkitbackendjsauthority.c
+@@ -137,12 +137,14 @@ test_get_admin_identities (void)
+ "unix-group:users"
+ }
+ },
++#ifdef HAVE_GETNETGRENT
+ {
+ "net.company.action3",
+ {
+ "unix-netgroup:foo"
+ }
+ },
++#endif
+ };
+ guint n;
+
+@@ -258,7 +260,7 @@ static const RulesTestCase rules_test_ca
+ NULL,
+ POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
+ },
+-
++#if HAVE_GETNETGRENT
+ /* check netgroup membership */
+ {
+ /* john is a member of netgroup 'foo', see test/etc/netgroup */
+@@ -276,7 +278,7 @@ static const RulesTestCase rules_test_ca
+ NULL,
+ POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
+ },
+-
++#endif
+ /* spawning */
+ {
+ "spawning_non_existing_helper",
+
diff --git a/sys-auth/polkit/polkit-0.113.ebuild b/sys-auth/polkit/polkit-0.113.ebuild
new file mode 100644
index 00000000..f43fe612
--- /dev/null
+++ b/sys-auth/polkit/polkit-0.113.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils multilib pam pax-utils systemd user
+
+DESCRIPTION="Policy framework for controlling privileges for system-wide services"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/polkit"
+SRC_URI="http://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
+IUSE="examples gtk +introspection jit kde nls pam selinux systemd test"
+
+CDEPEND="
+ dev-lang/spidermonkey:0/mozjs185[-debug]
+ >=dev-libs/glib-2.32:2
+ >=dev-libs/expat-2:=
+ introspection? ( >=dev-libs/gobject-introspection-1:= )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ systemd? ( sys-apps/systemd:0= )
+"
+DEPEND="${CDEPEND}
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ dev-util/gtk-doc-am
+ dev-util/intltool
+ virtual/pkgconfig
+"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-policykit )
+"
+PDEPEND="
+ gtk? ( || (
+ >=gnome-extra/polkit-gnome-0.105
+ lxde-base/lxpolkit
+ ) )
+ kde? ( || (
+ kde-plasma/polkit-kde-agent
+ sys-auth/polkit-kde-agent
+ ) )
+ !systemd? ( sys-auth/consolekit[policykit] )
+"
+
+QA_MULTILIB_PATHS="
+ usr/lib/polkit-1/polkit-agent-helper-1
+ usr/lib/polkit-1/polkitd"
+
+pkg_setup() {
+ local u=polkitd
+ local g=polkitd
+ local h=/var/lib/polkit-1
+
+ enewgroup ${g}
+ enewuser ${u} -1 -1 ${h} ${g}
+ esethome ${u} ${h}
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.113-make-netgroup-support-optional.patch
+
+ sed -i -e 's|unix-group:wheel|unix-user:0|' src/polkitbackend/*-default.rules || die #401513
+}
+
+src_configure() {
+ econf \
+ --localstatedir="${EPREFIX}"/var \
+ --disable-static \
+ --enable-man-pages \
+ --disable-gtk-doc \
+ $(use_enable systemd libsystemd-login) \
+ $(use_enable introspection) \
+ --disable-examples \
+ $(use_enable nls) \
+ --with-mozjs=mozjs185 \
+ "$(systemd_with_unitdir)" \
+ --with-authfw=$(usex pam pam shadow) \
+ $(use pam && echo --with-pam-module-dir="$(getpam_mod_dir)") \
+ $(use_enable test) \
+ --with-os-type=gentoo
+}
+
+src_compile() {
+ default
+
+ # Required for polkitd on hardened/PaX due to spidermonkey's JIT
+ pax-mark mr src/polkitbackend/.libs/polkitd test/polkitbackend/.libs/polkitbackendjsauthoritytest
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc docs/TODO HACKING NEWS README
+
+ fowners -R polkitd:root /{etc,usr/share}/polkit-1/rules.d
+
+ diropts -m0700 -o polkitd -g polkitd
+ keepdir /var/lib/polkit-1
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins src/examples/{*.c,*.policy*}
+ fi
+
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ chown -R polkitd:root "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
+ chown -R polkitd:polkitd "${EROOT}"/var/lib/polkit-1
+}