summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-01-20 05:03:10 +0000
committerMartin Jansa <Martin.Jansa@gmail.com>2016-02-01 15:58:04 +0100
commit8404784b3505d905ca52ada9a49afb93a1cd765c (patch)
tree112981203de0fefe53eb681cbcd2341f9c580314 /meta-oe/recipes-extended
parent484fbf697925b116083925efdca211938e797c0f (diff)
downloadmeta-openembedded-8404784b3505d905ca52ada9a49afb93a1cd765c.tar.gz
polkit: Fix build with musl
Make features like netgroup optional, these are not supported by posix secondly they are poked at during configure so nothing changes for glibc based systems but it helps compiling with musl Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended')
-rw-r--r--meta-oe/recipes-extended/polkit/polkit/0001-make-netgroup-support-configurable.patch107
-rw-r--r--meta-oe/recipes-extended/polkit/polkit_0.113.bb1
2 files changed, 108 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/polkit/polkit/0001-make-netgroup-support-configurable.patch b/meta-oe/recipes-extended/polkit/polkit/0001-make-netgroup-support-configurable.patch
new file mode 100644
index 000000000..4e3af876e
--- /dev/null
+++ b/meta-oe/recipes-extended/polkit/polkit/0001-make-netgroup-support-configurable.patch
@@ -0,0 +1,107 @@
1From 7d5e205aa58a10e7b1ccc2fa75b443508a5c3e18 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 20 Jan 2016 04:31:59 +0000
4Subject: [PATCH] make netgroup support configurable
5
6Disable using innetgr and *netigrent function if not available
7
8These functions are not available on all libc implementations e.g. musl
9doesnt have them.
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13Upstream-Status: Pending
14
15 configure.ac | 2 +-
16 src/polkitbackend/polkitbackendinteractiveauthority.c | 6 +++++-
17 src/polkitbackend/polkitbackendjsauthority.c | 5 ++---
18 3 files changed, 8 insertions(+), 5 deletions(-)
19
20diff --git a/configure.ac b/configure.ac
21index 07982d1..21590b2 100644
22--- a/configure.ac
23+++ b/configure.ac
24@@ -158,7 +158,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"],
25 [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
26 AC_SUBST(EXPAT_LIBS)
27
28-AC_CHECK_FUNCS(clearenv fdatasync)
29+AC_CHECK_FUNCS(clearenv fdatasync getnetgrent innetgr)
30
31 if test "x$GCC" = "xyes"; then
32 LDFLAGS="-Wl,--as-needed $LDFLAGS"
33diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
34index 7019356..cf39d77 100644
35--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
36+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
37@@ -2213,7 +2213,7 @@ get_users_in_group (PolkitIdentity *group,
38 out:
39 return ret;
40 }
41-
42+#if defined HAVE_GETNETGRENT
43 static GList *
44 get_users_in_net_group (PolkitIdentity *group,
45 gboolean include_root)
46@@ -2270,6 +2270,8 @@ get_users_in_net_group (PolkitIdentity *group,
47 return ret;
48 }
49
50+#endif
51+
52 /* ---------------------------------------------------------------------------------------------------- */
53
54 static void
55@@ -2355,10 +2357,12 @@ authentication_agent_initiate_challenge (AuthenticationAgent *agent,
56 {
57 user_identities = g_list_concat (user_identities, get_users_in_group (identity, FALSE));
58 }
59+#if defined HAVE_GETNETGRENT
60 else if (POLKIT_IS_UNIX_NETGROUP (identity))
61 {
62 user_identities = g_list_concat (user_identities, get_users_in_net_group (identity, FALSE));
63 }
64+#endif
65 else
66 {
67 g_warning ("Unsupported identity");
68diff --git a/src/polkitbackend/polkitbackendjsauthority.c b/src/polkitbackend/polkitbackendjsauthority.c
69index 097dcc5..e59b3f7 100644
70--- a/src/polkitbackend/polkitbackendjsauthority.c
71+++ b/src/polkitbackend/polkitbackendjsauthority.c
72@@ -1498,7 +1498,6 @@ js_polkit_spawn (JSContext *cx,
73
74 /* ---------------------------------------------------------------------------------------------------- */
75
76-
77 static JSBool
78 js_polkit_user_is_in_netgroup (JSContext *cx,
79 unsigned argc,
80@@ -1518,6 +1517,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
81 user = JS_EncodeString (cx, user_str);
82 netgroup = JS_EncodeString (cx, netgroup_str);
83
84+#if defined HAVE_INNETGR
85 if (innetgr (netgroup,
86 NULL, /* host */
87 user,
88@@ -1525,6 +1525,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
89 {
90 is_in_netgroup = JS_TRUE;
91 }
92+#endif
93
94 JS_free (cx, netgroup);
95 JS_free (cx, user);
96@@ -1536,8 +1537,6 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
97 return ret;
98 }
99
100-
101-
102 /* ---------------------------------------------------------------------------------------------------- */
103
104 typedef struct
105--
1062.7.0
107
diff --git a/meta-oe/recipes-extended/polkit/polkit_0.113.bb b/meta-oe/recipes-extended/polkit/polkit_0.113.bb
index b85122e0b..8a613ef7a 100644
--- a/meta-oe/recipes-extended/polkit/polkit_0.113.bb
+++ b/meta-oe/recipes-extended/polkit/polkit_0.113.bb
@@ -19,6 +19,7 @@ PACKAGECONFIG[consolekit] = ",,,consolekit"
19 19
20PAM_SRC_URI = "file://polkit-1_pam.patch" 20PAM_SRC_URI = "file://polkit-1_pam.patch"
21SRC_URI = "http://www.freedesktop.org/software/polkit/releases/polkit-${PV}.tar.gz \ 21SRC_URI = "http://www.freedesktop.org/software/polkit/releases/polkit-${PV}.tar.gz \
22 file://0001-make-netgroup-support-configurable.patch \
22 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ 23 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
23" 24"
24SRC_URI[md5sum] = "4b77776c9e4f897dcfe03b2c34198edf" 25SRC_URI[md5sum] = "4b77776c9e4f897dcfe03b2c34198edf"