Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame^] | 1 | From 792f8e2151c120ec51b50a4098e4f9642409cbec Mon Sep 17 00:00:00 2001 |
| 2 | From: Marta Rybczynska <rybczynska@gmail.com> |
| 3 | Date: Fri, 29 Jul 2022 11:52:59 +0200 |
| 4 | Subject: [PATCH] Make netgroup support optional |
| 5 | |
| 6 | This patch adds a fragment of the netgroup patch to apply on the duktape-related |
| 7 | code. This change is needed to compile with duktape+musl. |
| 8 | |
| 9 | Upstream-Status: Backport [https://gitlab.freedesktop.org/polkit/polkit/-/commit/b57deee8178190a7ecc75290fa13cf7daabc2c66] |
| 10 | Signed-off-by: Marta Rybczynska <martarybczynska@huawei.com> |
| 11 | --- |
| 12 | src/polkitbackend/polkitbackendduktapeauthority.c | 2 ++ |
| 13 | 1 file changed, 2 insertions(+) |
| 14 | |
| 15 | diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c |
| 16 | index c89dbcf..58a5936 100644 |
| 17 | --- a/src/polkitbackend/polkitbackendduktapeauthority.c |
| 18 | +++ b/src/polkitbackend/polkitbackendduktapeauthority.c |
| 19 | @@ -1036,6 +1036,7 @@ js_polkit_user_is_in_netgroup (duk_context *cx) |
| 20 | user = duk_require_string (cx, 0); |
| 21 | netgroup = duk_require_string (cx, 1); |
| 22 | |
| 23 | +#ifdef HAVE_SETNETGRENT |
| 24 | if (innetgr (netgroup, |
| 25 | NULL, /* host */ |
| 26 | user, |
| 27 | @@ -1043,6 +1044,7 @@ js_polkit_user_is_in_netgroup (duk_context *cx) |
| 28 | { |
| 29 | is_in_netgroup = TRUE; |
| 30 | } |
| 31 | +#endif |
| 32 | |
| 33 | duk_push_boolean (cx, is_in_netgroup); |
| 34 | return 1; |