aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-06-11 18:16:08 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-06-11 18:16:08 -0400
commit8eddda8072add075ebf56cf6d288bc1450d6b5f8 (patch)
tree373e2d36142a298a821f6643c097007aa38aa29f /sys-auth/polkit/files/polkit-make-netgroup-support-optional.patch
downloadmusl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.tar.gz
musl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.tar.bz2
musl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.zip
Initial migration from hardened-dev::musl
Diffstat (limited to 'sys-auth/polkit/files/polkit-make-netgroup-support-optional.patch')
-rw-r--r--sys-auth/polkit/files/polkit-make-netgroup-support-optional.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/sys-auth/polkit/files/polkit-make-netgroup-support-optional.patch b/sys-auth/polkit/files/polkit-make-netgroup-support-optional.patch
new file mode 100644
index 00000000..07efd0e7
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-make-netgroup-support-optional.patch
@@ -0,0 +1,86 @@
+diff --git a/configure.ac b/configure.ac
+index 4bb6d90..8d30a95 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -158,7 +158,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"],
+ [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
+ AC_SUBST(EXPAT_LIBS)
+
+-AC_CHECK_FUNCS(clearenv)
++AC_CHECK_FUNCS(clearenv getnetgrent innetgr)
+
+ if test "x$GCC" = "xyes"; then
+ LDFLAGS="-Wl,--as-needed $LDFLAGS"
+diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
+index 3bd2f0b..9d2ec61 100644
+--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
++++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
+@@ -2103,6 +2103,7 @@ get_users_in_group (PolkitIdentity *group,
+ return ret;
+ }
+
++#if defined HAVE_GETNETGRENT
+ static GList *
+ get_users_in_net_group (PolkitIdentity *group,
+ gboolean include_root)
+@@ -2154,6 +2155,7 @@ get_users_in_net_group (PolkitIdentity *group,
+ endnetgrent ();
+ return ret;
+ }
++#endif
+
+ /* ---------------------------------------------------------------------------------------------------- */
+
+@@ -2243,10 +2245,12 @@ authentication_agent_initiate_challenge (AuthenticationAgent *agent,
+ {
+ user_identities = g_list_concat (user_identities, get_users_in_group (identity, FALSE));
+ }
++#if defined 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");
+diff --git a/src/polkitbackend/polkitbackendjsauthority.c b/src/polkitbackend/polkitbackendjsauthority.c
+index bc2fe22..b84c110 100644
+--- a/src/polkitbackend/polkitbackendjsauthority.c
++++ b/src/polkitbackend/polkitbackendjsauthority.c
+@@ -29,6 +29,7 @@
+ #include <glib/gstdio.h>
+ #include <locale.h>
+ #include <glib/gi18n-lib.h>
++#include <sys/wait.h>
+
+ #include <polkit/polkit.h>
+ #include "polkitbackendjsauthority.h"
+@@ -1450,13 +1451,16 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
+ JSBool ret = JS_FALSE;
+ JSString *user_str;
+ JSString *netgroup_str;
+- char *user;
+- char *netgroup;
+ JSBool is_in_netgroup = JS_FALSE;
+
+ if (!JS_ConvertArguments (cx, argc, JS_ARGV (cx, vp), "SS", &user_str, &netgroup_str))
+ goto out;
+
++#if defined(HAVE_INNETGR)
++ {
++ char *user;
++ char *netgroup;
++
+ user = JS_EncodeString (cx, user_str);
+ netgroup = JS_EncodeString (cx, netgroup_str);
+
+@@ -1470,6 +1474,8 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
+
+ JS_free (cx, netgroup);
+ JS_free (cx, user);
++ }
++#endif
+
+ ret = JS_TRUE;
+