|
@@ -16,6 +16,7 @@ Fixes bug 50145.
|
|
|
|
|
|
Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
|
|
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
|
|
+[Adam: Extend patch to work with duktape integration.]
|
|
|
Signed-off-by: Adam Duskett <aduskett@gmail.com>
|
|
|
[Thomas: add introspection.m4.]
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
@@ -24,12 +25,13 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
|
configure.ac | 2 +-
|
|
|
src/polkit/polkitidentity.c | 16 ++
|
|
|
src/polkit/polkitunixnetgroup.c | 3 +
|
|
|
+ .../polkitbackendduktapeauthority.c | 2 +
|
|
|
.../polkitbackendinteractiveauthority.c | 14 +-
|
|
|
- .../polkitbackendjsauthority.cpp | 2 +
|
|
|
+ .../polkitbackendjsauthority.cpp | 3 +-
|
|
|
test/polkit/polkitidentitytest.c | 9 +-
|
|
|
test/polkit/polkitunixnetgrouptest.c | 3 +
|
|
|
.../test-polkitbackendjsauthority.c | 2 +
|
|
|
- 9 files changed, 185 insertions(+), 8 deletions(-)
|
|
|
+ 10 files changed, 187 insertions(+), 9 deletions(-)
|
|
|
create mode 100644 buildutil/introspection.m4
|
|
|
|
|
|
diff --git a/buildutil/introspection.m4 b/buildutil/introspection.m4
|
|
@@ -184,7 +186,7 @@ diff --git a/configure.ac b/configure.ac
|
|
|
index 5cedb4e..87aa0ad 100644
|
|
|
--- a/configure.ac
|
|
|
+++ b/configure.ac
|
|
|
-@@ -99,7 +99,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"],
|
|
|
+@@ -111,7 +111,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)
|
|
|
|
|
@@ -249,6 +251,26 @@ index 8a2b369..83f8d4a 100644
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
|
|
return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_NETGROUP,
|
|
|
"name", name,
|
|
|
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
|
|
|
+index 4b4f8fd..e19b009 100644
|
|
|
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
|
|
|
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
|
|
|
+@@ -1036,6 +1036,7 @@ js_polkit_user_is_in_netgroup (duk_context *cx)
|
|
|
+ const char *netgroup;
|
|
|
+ gboolean is_in_netgroup = FALSE;
|
|
|
+
|
|
|
++#ifdef HAVE_SETNETGRENT
|
|
|
+ user = duk_require_string (cx, 0);
|
|
|
+ netgroup = duk_require_string (cx, 1);
|
|
|
+
|
|
|
+@@ -1046,6 +1047,7 @@ js_polkit_user_is_in_netgroup (duk_context *cx)
|
|
|
+ {
|
|
|
+ is_in_netgroup = TRUE;
|
|
|
+ }
|
|
|
++#endif
|
|
|
+
|
|
|
+ duk_push_boolean (cx, is_in_netgroup);
|
|
|
+ return 1;
|
|
|
diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
|
|
|
index 056d9a8..36c2f3d 100644
|
|
|
--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
|
|
@@ -298,7 +320,7 @@ diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/
|
|
|
index 9b752d1..09b2878 100644
|
|
|
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
|
|
|
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
|
|
|
-@@ -1502,6 +1502,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
|
|
|
+@@ -1520,6 +1520,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
|
|
|
|
|
|
JS::CallArgs args = JS::CallArgsFromVp (argc, vp);
|
|
|
|
|
@@ -306,14 +328,15 @@ index 9b752d1..09b2878 100644
|
|
|
JS::RootedString usrstr (authority->priv->cx);
|
|
|
usrstr = args[0].toString();
|
|
|
user = JS_EncodeStringToUTF8 (cx, usrstr);
|
|
|
-@@ -1519,6 +1520,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
|
|
|
-
|
|
|
- JS_free (cx, netgroup);
|
|
|
- JS_free (cx, user);
|
|
|
+@@ -1534,7 +1535,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
|
|
|
+ {
|
|
|
+ is_in_netgroup = true;
|
|
|
+ }
|
|
|
+-
|
|
|
+#endif
|
|
|
-
|
|
|
ret = true;
|
|
|
|
|
|
+ args.rval ().setBoolean (is_in_netgroup);
|
|
|
diff --git a/test/polkit/polkitidentitytest.c b/test/polkit/polkitidentitytest.c
|
|
|
index e91967b..e829aaa 100644
|
|
|
--- a/test/polkit/polkitidentitytest.c
|