Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 544062
Collapse All | Expand All

(-)a/sys-auth/polkit/Manifest (+3 lines)
Line 0 Link Here
1
AUX polkit-make-netgroup-support-optional.patch 2818 SHA256 840f295f8c99005938a501e696080136bcea6696a2e0abfe4c5f0f1e46a079a0 SHA512 90ad57cdbdfcd706b1443b596eb2aa849e73e56d6c25c72683270a8f71d5e8c0144c9fa39e4267928531b1b7bf1870ab29cb6f19981ef1621419da7540d8ccbb WHIRLPOOL c68e260ce7fa65001fe0a4fcff97ebff9c447cad7d6fb8a564ebfb13e27b5c6e09be6b8f30a56cd1a3fcd0efe4346c6736e75004fd4aaeb1163209ad61eb77b7
2
DIST polkit-0.112.tar.gz 1429240 SHA256 d695f43cba4748a822fbe864dd32c4887c5da1c71694a47693ace5e88fcf6af6 SHA512 e4ad1bd287b38e5650cb94b1897a959b2ceaa6c19b4478ba872eacb13b58758fd42f6ab1718976162d823d850cd5c99b3ccadf1b57d75dea7790101422029d5f WHIRLPOOL af5dd0a17b7356302b0319e80565d6ac916128dfc85b6e2711147f3de86651f11fe8d08f3d6067d7abd24e263be92403f9d8f46935ba93db571e386a603a038a
3
EBUILD polkit-0.112-r2.ebuild 3462 SHA256 ba9b4392856af766eee1b604031da6492ac6bcb809159ccb177a7328e98d3f8c SHA512 92ba37b9e8f37308152851b9242ccab7448e10591f39184bb8dbae0f8b2faf5f47fb97182a2270153be827e9a87ed4290617c3e3c31138b00612d94cc14cb29c WHIRLPOOL ac95d0f2e4761214a2ec192e81814ba69ee67d9d37881ea39640f702ecd6500d82ac2a4c66cf888871c2c7c541febb6b96b332ed9c4ab8eba9ca0c99a34b4c41
(-)a/sys-auth/polkit/files/polkit-make-netgroup-support-optional.patch (+86 lines)
Line 0 Link Here
1
diff --git a/configure.ac b/configure.ac
2
index 4bb6d90..8d30a95 100644
3
--- a/configure.ac
4
+++ b/configure.ac
5
@@ -158,7 +158,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"],
6
 	     [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
7
 AC_SUBST(EXPAT_LIBS)
8
 
9
-AC_CHECK_FUNCS(clearenv)
10
+AC_CHECK_FUNCS(clearenv getnetgrent innetgr)
11
 
12
 if test "x$GCC" = "xyes"; then
13
   LDFLAGS="-Wl,--as-needed $LDFLAGS"
14
diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
15
index 3bd2f0b..9d2ec61 100644
16
--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
17
+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
18
@@ -2103,6 +2103,7 @@ get_users_in_group (PolkitIdentity                    *group,
19
   return ret;
20
 }
21
 
22
+#if defined HAVE_GETNETGRENT
23
 static GList *
24
 get_users_in_net_group (PolkitIdentity                    *group,
25
                         gboolean                           include_root)
26
@@ -2154,6 +2155,7 @@ get_users_in_net_group (PolkitIdentity                    *group,
27
   endnetgrent ();
28
   return ret;
29
 }
30
+#endif
31
 
32
 /* ---------------------------------------------------------------------------------------------------- */
33
 
34
@@ -2243,10 +2245,12 @@ authentication_agent_initiate_challenge (AuthenticationAgent         *agent,
35
         {
36
           user_identities = g_list_concat (user_identities, get_users_in_group (identity, FALSE));
37
         }
38
+#if defined HAVE_GETNETGRENT
39
       else if (POLKIT_IS_UNIX_NETGROUP (identity))
40
         {
41
           user_identities =  g_list_concat (user_identities, get_users_in_net_group (identity, FALSE));
42
         }
43
+#endif
44
       else
45
         {
46
           g_warning ("Unsupported identity");
47
diff --git a/src/polkitbackend/polkitbackendjsauthority.c b/src/polkitbackend/polkitbackendjsauthority.c
48
index bc2fe22..b84c110 100644
49
--- a/src/polkitbackend/polkitbackendjsauthority.c
50
+++ b/src/polkitbackend/polkitbackendjsauthority.c
51
@@ -29,6 +29,7 @@
52
 #include <glib/gstdio.h>
53
 #include <locale.h>
54
 #include <glib/gi18n-lib.h>
55
+#include <sys/wait.h>
56
 
57
 #include <polkit/polkit.h>
58
 #include "polkitbackendjsauthority.h"
59
@@ -1450,13 +1451,16 @@ js_polkit_user_is_in_netgroup (JSContext  *cx,
60
   JSBool ret = JS_FALSE;
61
   JSString *user_str;
62
   JSString *netgroup_str;
63
-  char *user;
64
-  char *netgroup;
65
   JSBool is_in_netgroup = JS_FALSE;
66
 
67
   if (!JS_ConvertArguments (cx, argc, JS_ARGV (cx, vp), "SS", &user_str, &netgroup_str))
68
     goto out;
69
 
70
+#if defined(HAVE_INNETGR)
71
+  {
72
+  char *user;
73
+  char *netgroup;
74
+
75
   user = JS_EncodeString (cx, user_str);
76
   netgroup = JS_EncodeString (cx, netgroup_str);
77
 
78
@@ -1470,6 +1474,8 @@ js_polkit_user_is_in_netgroup (JSContext  *cx,
79
 
80
   JS_free (cx, netgroup);
81
   JS_free (cx, user);
82
+  }
83
+#endif
84
 
85
   ret = JS_TRUE;
86
 
(-)a/sys-auth/polkit/polkit-0.112-r2.ebuild (-1 / +123 lines)
Line 0 Link Here
0
- 
1
# Copyright 1999-2015 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/sys-auth/polkit/polkit-0.112-r2.ebuild,v 1.17 2015/02/11 03:45:06 patrick Exp $
4
5
EAPI=5
6
inherit eutils autotools multilib pam pax-utils systemd user
7
8
DESCRIPTION="Policy framework for controlling privileges for system-wide services"
9
HOMEPAGE="http://www.freedesktop.org/wiki/Software/polkit"
10
SRC_URI="http://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz"
11
12
LICENSE="LGPL-2"
13
SLOT="0"
14
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
15
IUSE="examples gtk +introspection jit kde nls pam selinux systemd"
16
17
CDEPEND="
18
	ia64? ( =dev-lang/spidermonkey-1.8.5*[-debug] )
19
	hppa? ( =dev-lang/spidermonkey-1.8.5*[-debug] )
20
	mips? ( =dev-lang/spidermonkey-1.8.5*[-debug] )
21
	!hppa? ( !ia64? ( !mips? ( dev-lang/spidermonkey:17[-debug,jit=] ) ) )
22
	>=dev-libs/glib-2.32
23
	>=dev-libs/expat-2:=
24
	introspection? ( >=dev-libs/gobject-introspection-1 )
25
	pam? (
26
		sys-auth/pambase
27
		virtual/pam
28
		)
29
	systemd? ( sys-apps/systemd:0= )"
30
DEPEND="${CDEPEND}
31
	app-text/docbook-xml-dtd:4.1.2
32
	app-text/docbook-xsl-stylesheets
33
	dev-libs/libxslt
34
	dev-util/intltool
35
	virtual/pkgconfig"
36
RDEPEND="${CDEPEND}
37
	selinux? ( sec-policy/selinux-policykit )
38
"
39
PDEPEND="
40
	gtk? ( || (
41
		>=gnome-extra/polkit-gnome-0.105
42
		lxde-base/lxpolkit
43
		) )
44
	kde? ( || (
45
		kde-plasma/polkit-kde-agent
46
		sys-auth/polkit-kde-agent
47
		) )
48
	!systemd? ( sys-auth/consolekit[policykit] )"
49
50
QA_MULTILIB_PATHS="
51
	usr/lib/polkit-1/polkit-agent-helper-1
52
	usr/lib/polkit-1/polkitd"
53
54
pkg_setup() {
55
	local u=polkitd
56
	local g=polkitd
57
	local h=/var/lib/polkit-1
58
59
	enewgroup ${g}
60
	enewuser ${u} -1 -1 ${h} ${g}
61
	esethome ${u} ${h}
62
}
63
64
src_prepare() {
65
	sed -i -e 's|unix-group:wheel|unix-user:0|' src/polkitbackend/*-default.rules || die #401513
66
	epatch "${FILESDIR}"/${PN}-make-netgroup-support-optional.patch
67
	eautoreconf || die
68
}
69
70
src_configure() {
71
	econf \
72
		--localstatedir="${EPREFIX}"/var \
73
		--disable-static \
74
		--enable-man-pages \
75
		--disable-gtk-doc \
76
		$(use_enable systemd libsystemd-login) \
77
		$(use_enable introspection) \
78
		--disable-examples \
79
		$(use_enable nls) \
80
		$(if use hppa || use ia64 || use mips; then echo --with-mozjs=mozjs185; else echo --with-mozjs=mozjs-17.0; fi) \
81
		"$(systemd_with_unitdir)" \
82
		--with-authfw=$(usex pam pam shadow) \
83
		$(use pam && echo --with-pam-module-dir="$(getpam_mod_dir)") \
84
		--with-os-type=gentoo
85
}
86
87
src_compile() {
88
	default
89
90
	# Required for polkitd on hardened/PaX due to spidermonkey's JIT
91
	local f='src/polkitbackend/.libs/polkitd test/polkitbackend/.libs/polkitbackendjsauthoritytest'
92
	local m=''
93
	# Only used when USE="jit" is enabled for 'dev-lang/spidermonkey:17' wrt #485910
94
	has_version 'dev-lang/spidermonkey:17[jit]' && m='m'
95
	# hppa, ia64 and mips uses spidermonkey-1.8.5 which requires different pax-mark flags
96
	use hppa && m='mr'
97
	use ia64 && m='mr'
98
	use mips && m='mr'
99
	[ -n "$m" ] && pax-mark ${m} ${f}
100
}
101
102
src_install() {
103
	emake DESTDIR="${D}" install
104
105
	dodoc docs/TODO HACKING NEWS README
106
107
	fowners -R polkitd:root /{etc,usr/share}/polkit-1/rules.d
108
109
	diropts -m0700 -o polkitd -g polkitd
110
	keepdir /var/lib/polkit-1
111
112
	if use examples; then
113
		insinto /usr/share/doc/${PF}/examples
114
		doins src/examples/{*.c,*.policy*}
115
	fi
116
117
	prune_libtool_files
118
}
119
120
pkg_postinst() {
121
	chown -R polkitd:root "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
122
	chown -R polkitd:polkitd "${EROOT}"/var/lib/polkit-1
123
}

Return to bug 544062