[gentoo-commits] proj/musl:master commit in: sys-auth/polkit/files/, sys-auth/polkit/

2022-05-04 Thread Jory Pratt
commit: 797cfeab3a46807a753759b61738d4dfab7b6243
Author: Jory Pratt  gentoo  org>
AuthorDate: Wed May  4 13:49:49 2022 +
Commit: Jory Pratt  gentoo  org>
CommitDate: Wed May  4 13:49:49 2022 +
URL:https://gitweb.gentoo.org/proj/musl.git/commit/?id=797cfeab

sys-auth/polkit: Supported in ::gentoo

Signed-off-by: Jory Pratt  gentoo.org>

 sys-auth/polkit/Manifest   |   2 -
 ...lkit-0.118-make-netgroup-support-optional.patch | 219 -
 .../polkit/files/polkit-0.120-CVE-2021-4043.patch  |  72 ---
 .../polkit/files/polkit-0.120-CVE-2021-4115.patch  |  78 
 sys-auth/polkit/files/polkit-0.120-meson.patch |  42 
 sys-auth/polkit/metadata.xml   |  11 --
 sys-auth/polkit/polkit-0.120-r2.ebuild | 126 
 sys-auth/polkit/polkit-0.120-r3.ebuild | 128 
 8 files changed, 678 deletions(-)

diff --git a/sys-auth/polkit/Manifest b/sys-auth/polkit/Manifest
deleted file mode 100644
index 1125d650..
--- a/sys-auth/polkit/Manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-DIST polkit-0.120-duktape-1.patch 127886 BLAKE2B 
5ae791538ff576c01340a8eee197c0da580cf8a5afd5d0ba54526191edf68c16811debed981c540fcf2ad6fbf0d13f66c71c8ccd32560fda2f39aeb86cd15349
 SHA512 
bd3fb95a2e4151646859fef031f463fabd8c02bd24024f8269a74c171d70f8fc33de055193b2a0fb0c40fc459f01ec9a546cfdf1c90ef096ba8e5135d08be4a7
-DIST polkit-0.120.tar.gz 1626659 BLAKE2B 
745727445b4946d44b8ea470d21ac131ca7706e83f5dbaf85cf3541ac60a1bbe23b3bf3172a62d9256ebb3dae02d2b2d476e3e0f7fe79a80c47864a120e62ed9
 SHA512 
db072769439d5e17d0eed681e7b94251b77828c1474b40fe40b94293903a64333e7fa17515a3270648691f04a1374d8b404405ead6abf292a8eb8483164adc46

diff --git 
a/sys-auth/polkit/files/polkit-0.118-make-netgroup-support-optional.patch 
b/sys-auth/polkit/files/polkit-0.118-make-netgroup-support-optional.patch
deleted file mode 100644
index aef30ef6..
--- a/sys-auth/polkit/files/polkit-0.118-make-netgroup-support-optional.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-diff --git a/configure.ac b/configure.ac
-index 4809dc9..d1ea325 100644
 a/configure.ac
-+++ b/configure.ac
-@@ -100,7 +100,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 fdatasync)
-+AC_CHECK_FUNCS(clearenv fdatasync setnetgrent)
- 
- if test "x$GCC" = "xyes"; then
-   LDFLAGS="-Wl,--as-needed $LDFLAGS"
-diff --git a/src/polkit/polkitidentity.c b/src/polkit/polkitidentity.c
-index 3aa1f7f..793f17d 100644
 a/src/polkit/polkitidentity.c
-+++ b/src/polkit/polkitidentity.c
-@@ -182,7 +182,15 @@ polkit_identity_from_string  (const gchar   *str,
- }
-   else if (g_str_has_prefix (str, "unix-netgroup:"))
- {
-+#ifndef HAVE_SETNETGRENT
-+  g_set_error (error,
-+   POLKIT_ERROR,
-+   POLKIT_ERROR_FAILED,
-+   "Netgroups are not available on this machine ('%s')",
-+   str);
-+#else
-   identity = polkit_unix_netgroup_new (str + sizeof "unix-netgroup:" - 1);
-+#endif
- }
- 
-   if (identity == NULL && (error != NULL && *error == NULL))
-@@ -344,6 +352,14 @@ polkit_identity_new_for_gvariant (GVariant  *variant,
-   GVariant *v;
-   const char *name;
- 
-+#ifndef HAVE_SETNETGRENT
-+  g_set_error (error,
-+   POLKIT_ERROR,
-+   POLKIT_ERROR_FAILED,
-+   "Netgroups are not available on this machine");
-+  goto out;
-+#else
-+
-   v = lookup_asv (details_gvariant, "name", G_VARIANT_TYPE_STRING, error);
-   if (v == NULL)
- {
-@@ -353,6 +369,7 @@ polkit_identity_new_for_gvariant (GVariant  *variant,
-   name = g_variant_get_string (v, NULL);
-   ret = polkit_unix_netgroup_new (name);
-   g_variant_unref (v);
-+#endif
- }
-   else
- {
-diff --git a/src/polkit/polkitunixnetgroup.c b/src/polkit/polkitunixnetgroup.c
-index 8a2b369..83f8d4a 100644
 a/src/polkit/polkitunixnetgroup.c
-+++ b/src/polkit/polkitunixnetgroup.c
-@@ -194,6 +194,9 @@ polkit_unix_netgroup_set_name (PolkitUnixNetgroup *group,
- PolkitIdentity *
- polkit_unix_netgroup_new (const gchar *name)
- {
-+#ifndef HAVE_SETNETGRENT
-+  g_assert_not_reached();
-+#endif
-   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/polkitbackendinteractiveauthority.c 
b/src/polkitbackend/polkitbackendinteractiveauthority.c
-index 056d9a8..36c2f3d 100644
 a/src/polkitbackend/polkitbackendinteractiveauthority.c
-+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
-@@ -2233,25 +2233,26 @@ get_users_in_net_group (PolkitIdentity 
   *group,
-   GList *ret;
- 
-   ret = NULL;
-+#ifdef HAVE_SETNETGRENT
-   name = polkit_unix_netgroup_get_name 

[gentoo-commits] proj/musl:master commit in: sys-auth/polkit/files/, sys-auth/polkit/

2021-02-11 Thread Jory Pratt
commit: e04dcdbfb09610a266ceee3f3a04b0192c9da311
Author: Jory Pratt  gentoo  org>
AuthorDate: Thu Feb 11 17:31:55 2021 +
Commit: Jory Pratt  gentoo  org>
CommitDate: Thu Feb 11 17:31:55 2021 +
URL:https://gitweb.gentoo.org/proj/musl.git/commit/?id=e04dcdbf

sys-auth/polkit: misc cleanup, add duktape support

Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Jory Pratt  gentoo.org>

 sys-auth/polkit/Manifest |1 +
 sys-auth/polkit/files/polkit-0.118-duktape.patch | 1499 --
 sys-auth/polkit/files/polkit-0.118-elogind.patch |   28 -
 sys-auth/polkit/metadata.xml |1 +
 sys-auth/polkit/polkit-0.118-r1.ebuild   |   18 +-
 5 files changed, 12 insertions(+), 1535 deletions(-)

diff --git a/sys-auth/polkit/Manifest b/sys-auth/polkit/Manifest
index c1e90f0..7eb759b 100644
--- a/sys-auth/polkit/Manifest
+++ b/sys-auth/polkit/Manifest
@@ -1,3 +1,4 @@
 DIST polkit-0.116.tar.gz 1548311 BLAKE2B 
e9761a2934136d453a47b81dd1f132f9fc96c45b731d5fceb2aa7706f5325b6499f6acbb68032befc1b21878b1b54754685607c916ca8e02a8accca3ca014b31
 SHA512 
b66b01cc2bb4349de70147f41f161f0f6f41e7230b581dfb054058b48969ec57041ab05b51787c749ccfc36aa5f317952d7e7ba337b4f6f6c0a923ed5866c2d5
 DIST polkit-0.117.tar.gz 1554536 BLAKE2B 
1cf7e0ff9db19a29be626f4bea96c9e2ef8b1eab4b8287a5f1f4d2a818b86d58c1c4c4a41849d95e31559dba1b18853a31e934ebbadd8e07f94dfd58b45240e0
 SHA512 
c10ea984f2386fe436e58a2866e5323afc80d24f744f0ee61d966941259aa491bd96b07d911434aa731b300c3cca25b647804b396501175ab5b3c53384e94c70
+DIST polkit-0.118-duktape.patch 50144 BLAKE2B 
83be77ed93596bd44306b8e5b677497c6e4dab3a16626a32849abb3d91b527ad1e3a1436dcd7389ca5794ea1d7efaa3d5acc950f868fcda85b4bab75ad54205a
 SHA512 
dec31b81678a5436ddeef633d668c735d3c7128d6b5fb7b5dda2d06e8cf40ce9093813e9fbc8870475321d6fcdef3395bf3dd0db7ed214f0f45b19bf47c8a867
 DIST polkit-0.118.tar.gz 1556765 BLAKE2B 
d048b37b1ff8ad59a2d8a333a3b459d1592b61f7a6d9a9569f8b2984de913d71abfc9748e242c7453f0bce4f322bd44672e35309f181afd22488794ca0e47119
 SHA512 
3d412f40c903cfaf68530f9c0cb616106f8edf43bec6805de129f8bb9cb4e64c98da6bf02caa3ef5619974f3e2df7a70564f08b92901662453477e9005752b4e

diff --git a/sys-auth/polkit/files/polkit-0.118-duktape.patch 
b/sys-auth/polkit/files/polkit-0.118-duktape.patch
deleted file mode 100644
index f3f69e3..000
--- a/sys-auth/polkit/files/polkit-0.118-duktape.patch
+++ /dev/null
@@ -1,1499 +0,0 @@
-diff --git a/configure.ac b/configure.ac
-index 
5cedb4eca980f050fb5855ab577e93100adf8fec..6c274869f39d4b65b08f7cdb9e461b5182d297ec
 100644
 a/configure.ac
-+++ b/configure.ac
-@@ -79,11 +79,22 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 
2.30.0])
- AC_SUBST(GLIB_CFLAGS)
- AC_SUBST(GLIB_LIBS)
-
--PKG_CHECK_MODULES(LIBJS, [mozjs-78])
--
--AC_SUBST(LIBJS_CFLAGS)
--AC_SUBST(LIBJS_CXXFLAGS)
--AC_SUBST(LIBJS_LIBS)
-+dnl 
---
-+dnl - Check javascript backend
-+dnl 
---
-+AC_ARG_WITH(duktape, AS_HELP_STRING([--with-duktape],[Use Duktape as 
javascript backend]),with_duktape=yes,with_duktape=no)
-+AS_IF([test x${with_duktape} == xyes], [
-+  PKG_CHECK_MODULES(LIBJS, [duktape >= 2.0.0 ])
-+  AC_SUBST(LIBJS_CFLAGS)
-+  AC_SUBST(LIBJS_LIBS)
-+], [
-+  PKG_CHECK_MODULES(LIBJS, [mozjs-78])
-+
-+  AC_SUBST(LIBJS_CFLAGS)
-+  AC_SUBST(LIBJS_CXXFLAGS)
-+  AC_SUBST(LIBJS_LIBS)
-+])
-+AM_CONDITIONAL(USE_DUKTAPE, [test x$with_duktape == xyes], [Using duktape as 
javascript engine library])
-
- EXPAT_LIB=""
- AC_ARG_WITH(expat, [  --with-expat=  Use expat from here],
-@@ -580,6 +591,13 @@ echo "
- PAM support:${have_pam}
- systemdsystemunitdir:   ${systemdsystemunitdir}
- polkitd user:   ${POLKITD_USER}"
-+if test "x${with_duktape}" = xyes; then
-+echo "
-+Javascript engine:  Duktape"
-+else
-+echo "
-+Javascript engine:  Mozjs"
-+fi
-
- if test "$have_pam" = yes ; then
- echo "
-diff --git a/src/polkitbackend/Makefile.am b/src/polkitbackend/Makefile.am
-index 
e48b739cc0a4e7606be0271ba4b4e3bd33b08545..9572b067effdf6f0dcd1c6b17b2e8c59c1ed6238
 100644
 a/src/polkitbackend/Makefile.am
-+++ b/src/polkitbackend/Makefile.am
-@@ -33,7 +33,7 @@ libpolkit_backend_1_la_SOURCES = 
\
-   polkitbackendprivate.h  
\
-   polkitbackendauthority.hpolkitbackendauthority.c
\
-   polkitbackendinteractiveauthority.h 
polkitbackendinteractiveauthority.c \
--  polkitbackendjsauthority.h  polkitbackendjsauthority.cpp
\
-+  polkitbackendjsauthority.h  \
-   polkitbackendactionpool.h   polkitbackendactionpool.c   
\
-   polkitbackenda

[gentoo-commits] proj/musl:master commit in: sys-auth/polkit/files/, sys-auth/polkit/

2021-02-11 Thread Jory Pratt
commit: 77abc7da6c7baad08c1c99ea3a04893e891023a1
Author: Vjaceslavs Klimovs  gmail  com>
AuthorDate: Mon Feb  8 01:36:27 2021 +
Commit: Jory Pratt  gentoo  org>
CommitDate: Thu Feb 11 16:56:07 2021 +
URL:https://gitweb.gentoo.org/proj/musl.git/commit/?id=77abc7da

sys-auth/polkit: add polkit-0.118-r1 w/o spidermonkey dep and optional netgroup

Signed-off-by: Vjaceslavs Klimovs  gmail.com>
Signed-off-by: Jory Pratt  gentoo.org>

 sys-auth/polkit/files/polkit-0.118-duktape.patch   | 1499 
 sys-auth/polkit/files/polkit-0.118-elogind.patch   |   28 +
 ...lkit-0.118-make-netgroup-support-optional.patch |  219 +++
 sys-auth/polkit/polkit-0.118-r1.ebuild |  134 ++
 4 files changed, 1880 insertions(+)

diff --git a/sys-auth/polkit/files/polkit-0.118-duktape.patch 
b/sys-auth/polkit/files/polkit-0.118-duktape.patch
new file mode 100644
index 000..f3f69e3
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.118-duktape.patch
@@ -0,0 +1,1499 @@
+diff --git a/configure.ac b/configure.ac
+index 
5cedb4eca980f050fb5855ab577e93100adf8fec..6c274869f39d4b65b08f7cdb9e461b5182d297ec
 100644
+--- a/configure.ac
 b/configure.ac
+@@ -79,11 +79,22 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 
2.30.0])
+ AC_SUBST(GLIB_CFLAGS)
+ AC_SUBST(GLIB_LIBS)
+
+-PKG_CHECK_MODULES(LIBJS, [mozjs-78])
+-
+-AC_SUBST(LIBJS_CFLAGS)
+-AC_SUBST(LIBJS_CXXFLAGS)
+-AC_SUBST(LIBJS_LIBS)
++dnl 
---
++dnl - Check javascript backend
++dnl 
---
++AC_ARG_WITH(duktape, AS_HELP_STRING([--with-duktape],[Use Duktape as 
javascript backend]),with_duktape=yes,with_duktape=no)
++AS_IF([test x${with_duktape} == xyes], [
++  PKG_CHECK_MODULES(LIBJS, [duktape >= 2.0.0 ])
++  AC_SUBST(LIBJS_CFLAGS)
++  AC_SUBST(LIBJS_LIBS)
++], [
++  PKG_CHECK_MODULES(LIBJS, [mozjs-78])
++
++  AC_SUBST(LIBJS_CFLAGS)
++  AC_SUBST(LIBJS_CXXFLAGS)
++  AC_SUBST(LIBJS_LIBS)
++])
++AM_CONDITIONAL(USE_DUKTAPE, [test x$with_duktape == xyes], [Using duktape as 
javascript engine library])
+
+ EXPAT_LIB=""
+ AC_ARG_WITH(expat, [  --with-expat=  Use expat from here],
+@@ -580,6 +591,13 @@ echo "
+ PAM support:${have_pam}
+ systemdsystemunitdir:   ${systemdsystemunitdir}
+ polkitd user:   ${POLKITD_USER}"
++if test "x${with_duktape}" = xyes; then
++echo "
++Javascript engine:  Duktape"
++else
++echo "
++Javascript engine:  Mozjs"
++fi
+
+ if test "$have_pam" = yes ; then
+ echo "
+diff --git a/src/polkitbackend/Makefile.am b/src/polkitbackend/Makefile.am
+index 
e48b739cc0a4e7606be0271ba4b4e3bd33b08545..9572b067effdf6f0dcd1c6b17b2e8c59c1ed6238
 100644
+--- a/src/polkitbackend/Makefile.am
 b/src/polkitbackend/Makefile.am
+@@ -33,7 +33,7 @@ libpolkit_backend_1_la_SOURCES = 
\
+   polkitbackendprivate.h  
\
+   polkitbackendauthority.hpolkitbackendauthority.c
\
+   polkitbackendinteractiveauthority.h 
polkitbackendinteractiveauthority.c \
+-  polkitbackendjsauthority.h  polkitbackendjsauthority.cpp
\
++  polkitbackendjsauthority.h  \
+   polkitbackendactionpool.h   polkitbackendactionpool.c   
\
+   polkitbackendactionlookup.h polkitbackendactionlookup.c 
\
+ $(NULL)
+@@ -51,19 +51,27 @@ libpolkit_backend_1_la_CFLAGS =
\
+ -D_POLKIT_BACKEND_COMPILATION 
\
+ $(GLIB_CFLAGS)
\
+   $(LIBSYSTEMD_CFLAGS)\
+-  $(LIBJS_CFLAGS) \
++  $(LIBJS_CFLAGS) \
+ $(NULL)
+
+ libpolkit_backend_1_la_CXXFLAGS = $(libpolkit_backend_1_la_CFLAGS)
+
+ libpolkit_backend_1_la_LIBADD =   
\
+ $(GLIB_LIBS)  \
++$(DUKTAPE_LIBS)   
\
+   $(LIBSYSTEMD_LIBS)  \
+   $(top_builddir)/src/polkit/libpolkit-gobject-1.la   \
+   $(EXPAT_LIBS)   \
+-  $(LIBJS_LIBS)   \
++  $(LIBJS_LIBS)   \
+ $(NULL)
+
++if USE_DUKTAPE
++libpolkit_backend_1_la_SOURCES += polkitbackendduktapeauthority.c
++libpolkit_backend_1_la_LIBADD += -lm
++else
++libpolkit_backend_1_la_SOURCES += po

[gentoo-commits] proj/musl:master commit in: sys-auth/polkit/files/

2020-09-17 Thread Jory Pratt
commit: 414d403b7bc6d37de42b43045c76a06f9f75025b
Author: stefson  yahoo  de>
AuthorDate: Thu Sep 17 14:46:45 2020 +
Commit: Jory Pratt  gentoo  org>
CommitDate: Thu Sep 17 15:19:19 2020 +
URL:https://gitweb.gentoo.org/proj/musl.git/commit/?id=414d403b

sys-auth/polkit: remove obsolete patch

Closes: https://github.com/gentoo/musl/pull/347

Signed-off-by: Steffen Kuhn  yandex.com>
Signed-off-by: Jory Pratt  gentoo.org>

 sys-auth/polkit/files/polkit-0.117-mozjs-78.patch | 104 --
 1 file changed, 104 deletions(-)

diff --git a/sys-auth/polkit/files/polkit-0.117-mozjs-78.patch 
b/sys-auth/polkit/files/polkit-0.117-mozjs-78.patch
deleted file mode 100644
index f64a7bf..000
--- a/sys-auth/polkit/files/polkit-0.117-mozjs-78.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From 3e1d61868fa8bfc586099302e931433270e5d17d Mon Sep 17 00:00:00 2001
-From: Jan Rybar 
-Date: Tue, 25 Aug 2020 16:38:34 +
-Subject: [PATCH] Port polkit to mozjs78
-

- configure.ac   |  4 ++--
- src/polkitbackend/polkitbackendjsauthority.cpp | 15 ++-
- 2 files changed, 8 insertions(+), 11 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index eea70fc7..c4569f10 100644
 a/configure.ac
-+++ b/configure.ac
-@@ -34,7 +34,7 @@ AC_PROG_LN_S
- AC_SYS_LARGEFILE
- AM_PROG_CC_C_O
- AC_PROG_CXX
--AX_CXX_COMPILE_STDCXX([14], [], [mandatory])
-+AX_CXX_COMPILE_STDCXX([17], [], [mandatory])
- 
- # Taken from dbus
- AC_ARG_ENABLE(ansi, [  --enable-ansi   enable -ansi 
-pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
-@@ -80,7 +80,7 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
- AC_SUBST(GLIB_CFLAGS)
- AC_SUBST(GLIB_LIBS)
- 
--PKG_CHECK_MODULES(LIBJS, [mozjs-68])
-+PKG_CHECK_MODULES(LIBJS, [mozjs-78])
- 
- AC_SUBST(LIBJS_CFLAGS)
- AC_SUBST(LIBJS_CXXFLAGS)
-diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp 
b/src/polkitbackend/polkitbackendjsauthority.cpp
-index 25bd1f93..ca171083 100644
 a/src/polkitbackend/polkitbackendjsauthority.cpp
-+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
-@@ -49,6 +49,7 @@
- #include 
- #include 
- #include 
-+#include 
- #include 
- 
- #include "initjs.h" /* init.js */
-@@ -367,7 +368,7 @@ load_scripts (PolkitBackendJsAuthority  *authority)
- static void
- reload_scripts (PolkitBackendJsAuthority *authority)
- {
--  JS::AutoValueArray<1> args(authority->priv->cx);
-+  JS::RootedValueArray<1> args(authority->priv->cx);
-   JS::RootedValue rval(authority->priv->cx);
- 
-   JS::RootedObject js_polkit(authority->priv->cx, 
authority->priv->js_polkit->get ());
-@@ -482,10 +483,6 @@ polkit_backend_js_authority_constructed (GObject *object)
-   if (!JS::InitSelfHostedCode (authority->priv->cx))
- goto fail;
- 
--  JS::ContextOptionsRef (authority->priv->cx)
--  .setIon (TRUE)
--  .setBaseline (TRUE)
--  .setAsmJS (TRUE);
-   JS::SetWarningReporter(authority->priv->cx, report_error);
-   JS_SetContextPrivate (authority->priv->cx, authority);
- 
-@@ -720,7 +717,7 @@ set_property_strv (PolkitBackendJsAuthority  *authority,
- elems[n].setNull ();
- }
- 
--  JS::RootedObject array_object(authority->priv->cx, JS_NewArrayObject 
(authority->priv->cx, elems));
-+  JS::RootedObject array_object(authority->priv->cx, JS::NewArrayObject 
(authority->priv->cx, elems));
- 
-   value_jsval = JS::ObjectValue (*array_object);
-   JS_SetProperty (authority->priv->cx, obj, name, value_jsval);
-@@ -1114,7 +,7 @@ polkit_backend_js_authority_get_admin_auth_identities 
(PolkitBackendInteractiveA
- {
-   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY 
(_authority);
-   GList *ret = NULL;
--  JS::AutoValueArray<2> args(authority->priv->cx);
-+  JS::RootedValueArray<2> args(authority->priv->cx);
-   JS::RootedValue rval(authority->priv->cx);
-   guint n;
-   GError *error = NULL;
-@@ -1218,7 +1215,7 @@ polkit_backend_js_authority_check_authorization_sync 
(PolkitBackendInteractiveAu
- {
-   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY 
(_authority);
-   PolkitImplicitAuthorization ret = implicit;
--  JS::AutoValueArray<2> args(authority->priv->cx);
-+  JS::RootedValueArray<2> args(authority->priv->cx);
-   JS::RootedValue rval(authority->priv->cx);
-   GError *error = NULL;
-   JS::RootedString ret_jsstr (authority->priv->cx);
-@@ -1409,7 +1406,7 @@ js_polkit_spawn (JSContext  *cx,
-   JS::CallArgs args = JS::CallArgsFromVp (js_argc, vp);
-   array_object = &args[0].toObject();
- 
--  if (!JS_GetArrayLength (cx, array_object, &array_len))
-+  if (!JS::GetArrayLength (cx, array_object, &array_len))
- {
-   JS_ReportErrorUTF8 (cx, "Failed to get array length");
-   goto out;
--- 
-GitLab
-
-



[gentoo-commits] proj/musl:master commit in: sys-auth/polkit/files/, sys-auth/polkit/

2020-08-18 Thread Jory Pratt
commit: bae8d953c47d62c398e1ee4ee5b3cf1e5f54bb61
Author: stefson  yahoo  de>
AuthorDate: Sun Aug  2 11:53:51 2020 +
Commit: Jory Pratt  gentoo  org>
CommitDate: Tue Aug 18 23:47:51 2020 +
URL:https://gitweb.gentoo.org/proj/musl.git/commit/?id=bae8d953

sys-auth/polkit: bump to v0.117

Signed-off-by: Steffen Kuhn  yandex.com>
Signed-off-by: Jory Pratt  gentoo.org>

Closes: https://github.com/gentoo/musl/pull/332

 sys-auth/polkit/Manifest   |1 +
 .../files/polkit-0.116-spidermonkey-68.patch   | 1457 
 ...{polkit-0.116-r2.ebuild => polkit-0.117.ebuild} |5 +-
 3 files changed, 2 insertions(+), 1461 deletions(-)

diff --git a/sys-auth/polkit/Manifest b/sys-auth/polkit/Manifest
index 8e04530..3fa4f06 100644
--- a/sys-auth/polkit/Manifest
+++ b/sys-auth/polkit/Manifest
@@ -1 +1,2 @@
 DIST polkit-0.116.tar.gz 1548311 BLAKE2B 
e9761a2934136d453a47b81dd1f132f9fc96c45b731d5fceb2aa7706f5325b6499f6acbb68032befc1b21878b1b54754685607c916ca8e02a8accca3ca014b31
 SHA512 
b66b01cc2bb4349de70147f41f161f0f6f41e7230b581dfb054058b48969ec57041ab05b51787c749ccfc36aa5f317952d7e7ba337b4f6f6c0a923ed5866c2d5
+DIST polkit-0.117.tar.gz 1554536 BLAKE2B 
1cf7e0ff9db19a29be626f4bea96c9e2ef8b1eab4b8287a5f1f4d2a818b86d58c1c4c4a41849d95e31559dba1b18853a31e934ebbadd8e07f94dfd58b45240e0
 SHA512 
c10ea984f2386fe436e58a2866e5323afc80d24f744f0ee61d966941259aa491bd96b07d911434aa731b300c3cca25b647804b396501175ab5b3c53384e94c70

diff --git a/sys-auth/polkit/files/polkit-0.116-spidermonkey-68.patch 
b/sys-auth/polkit/files/polkit-0.116-spidermonkey-68.patch
deleted file mode 100644
index d944c24..000
--- a/sys-auth/polkit/files/polkit-0.116-spidermonkey-68.patch
+++ /dev/null
@@ -1,1457 +0,0 @@
-From 12f3d25fb73c68151f84c97c79acab7d5344f606 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?X=E2=84=B9=20Ruoyao?= 
-Date: Fri, 13 Mar 2020 14:55:44 +0800
-Subject: [PATCH 1/5] Port JavaScript authority to mozjs-68
-

- configure.ac  |   2 +-
- .../polkitbackendjsauthority.cpp  | 136 ++
- 2 files changed, 76 insertions(+), 62 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 5cedb4ec..cd678f1c 100644
 a/configure.ac
-+++ b/configure.ac
-@@ -79,7 +79,7 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
- AC_SUBST(GLIB_CFLAGS)
- AC_SUBST(GLIB_LIBS)
- 
--PKG_CHECK_MODULES(LIBJS, [mozjs-60])
-+PKG_CHECK_MODULES(LIBJS, [mozjs-68])
- 
- AC_SUBST(LIBJS_CFLAGS)
- AC_SUBST(LIBJS_CXXFLAGS)
-diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp 
b/src/polkitbackend/polkitbackendjsauthority.cpp
-index 0f180856..d5113cb0 100644
 a/src/polkitbackend/polkitbackendjsauthority.cpp
-+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
-@@ -43,7 +43,12 @@
- #include 
- #endif /* HAVE_LIBSYSTEMD */
- 
-+#include 
-+#include 
- #include 
-+#include 
-+#include 
-+#include 
- #include 
- 
- #include "initjs.h" /* init.js */
-@@ -76,7 +81,7 @@ struct _PolkitBackendJsAuthorityPrivate
- 
-   JSContext *cx;
-   JS::Heap *js_global;
--  JSAutoCompartment *ac;
-+  JSAutoRealm *ac;
-   JS::Heap *js_polkit;
- 
-   GThread *runaway_killer_thread;
-@@ -298,14 +303,35 @@ load_scripts (PolkitBackendJsAuthority  *authority)
-   for (l = files; l != NULL; l = l->next)
- {
-   const gchar *filename = (gchar *)l->data;
--  JS::RootedScript script(authority->priv->cx);
-+  GFile *file = g_file_new_for_path (filename);
-+  char *contents;
-+  gsize len;
-+  if (!g_file_load_contents (file, NULL, &contents, &len, NULL, NULL))
-+{
-+  polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
-+"Error compiling script %s",
-+filename);
-+  continue;
-+}
-+  JS::SourceText source;
-+  if (!source.init (authority->priv->cx, contents, len,
-+JS::SourceOwnership::Borrowed))
-+{
-+  polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
-+"Error compiling script %s",
-+filename);
-+  g_free (contents);
-+  continue;
-+}
-   JS::CompileOptions options(authority->priv->cx);
--  options.setUTF8(true);
--  if (!JS::Compile (authority->priv->cx, options, filename, &script))
-+  JS::RootedScript script(authority->priv->cx,
-+  JS::Compile (authority->priv->cx, options, 
source));
-+  if (!script)
- {
-   polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
- "Error compiling script %s",
- filename);
-+  g_free (contents);
-   continue;
- }
- 
-@@ -318,11 +344,13 @@ load_scripts (PolkitBackendJsAuthority  *authority)
-   polkit_bac

[gentoo-commits] proj/musl:master commit in: sys-auth/polkit/files/

2020-07-17 Thread Anthony G. Basile
commit: 7fb72f89c08477fe5c7ef19228bd0cbc268cf030
Author: stefson  yahoo  de>
AuthorDate: Fri Jul 10 11:30:51 2020 +
Commit: Anthony G. Basile  gentoo  org>
CommitDate: Fri Jul 17 12:42:59 2020 +
URL:https://gitweb.gentoo.org/proj/musl.git/commit/?id=7fb72f89

sys-auth/polkit: refresh mozjs-68 patch from upstream

Signed-off-by: Steffen Kuhn  yandex.com>
Signed-off-by: Anthony G. Basile  gentoo.org>

 .../files/polkit-0.116-spidermonkey-68.patch   | 96 ++
 1 file changed, 79 insertions(+), 17 deletions(-)

diff --git a/sys-auth/polkit/files/polkit-0.116-spidermonkey-68.patch 
b/sys-auth/polkit/files/polkit-0.116-spidermonkey-68.patch
index e57dfd7..d944c24 100644
--- a/sys-auth/polkit/files/polkit-0.116-spidermonkey-68.patch
+++ b/sys-auth/polkit/files/polkit-0.116-spidermonkey-68.patch
@@ -1,7 +1,7 @@
 From 12f3d25fb73c68151f84c97c79acab7d5344f606 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?X=E2=84=B9=20Ruoyao?= 
 Date: Fri, 13 Mar 2020 14:55:44 +0800
-Subject: [PATCH 1/3] Port JavaScript authority to mozjs-68
+Subject: [PATCH 1/5] Port JavaScript authority to mozjs-68
 
 ---
  configure.ac  |   2 +-
@@ -9,7 +9,7 @@ Subject: [PATCH 1/3] Port JavaScript authority to mozjs-68
  2 files changed, 76 insertions(+), 62 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 5cedb4e..cd678f1 100644
+index 5cedb4ec..cd678f1c 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -79,7 +79,7 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
@@ -22,7 +22,7 @@ index 5cedb4e..cd678f1 100644
  AC_SUBST(LIBJS_CFLAGS)
  AC_SUBST(LIBJS_CXXFLAGS)
 diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp 
b/src/polkitbackend/polkitbackendjsauthority.cpp
-index 0f18085..d5113cb 100644
+index 0f180856..d5113cb0 100644
 --- a/src/polkitbackend/polkitbackendjsauthority.cpp
 +++ b/src/polkitbackend/polkitbackendjsauthority.cpp
 @@ -43,7 +43,12 @@
@@ -391,22 +391,13 @@ index 0f18085..d5113cb 100644
  
args.rval ().setBoolean (is_in_netgroup);
 -- 
-2.24.1
+GitLab
 
 
-From 2e6787ead894911e9172e873d15b84dc237ff209 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?X=E2=84=B9=20Ruoyao?= 
-Date: Fri, 13 Mar 2020 15:06:44 +0800
-Subject: [PATCH 2/3] ci: update to mozjs-68
-

- .gitlab-ci.yml | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
 From cf22af32577cf49b4e5ed9945ec9cca862c45b3e Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?X=E2=84=B9=20Ruoyao?= 
 Date: Fri, 3 Apr 2020 23:47:38 +0800
-Subject: [PATCH 3/3] ensure to use C++14
+Subject: [PATCH 3/5] ensure to use C++14
 
 ---
  buildutil/ax_cxx_compile_stdcxx.m4 | 948 +
@@ -416,7 +407,7 @@ Subject: [PATCH 3/3] ensure to use C++14
 
 diff --git a/buildutil/ax_cxx_compile_stdcxx.m4 
b/buildutil/ax_cxx_compile_stdcxx.m4
 new file mode 100644
-index 000..9e9eaed
+index ..9e9eaeda
 --- /dev/null
 +++ b/buildutil/ax_cxx_compile_stdcxx.m4
 @@ -0,0 +1,948 @@
@@ -1369,7 +1360,7 @@ index 000..9e9eaed
 +
 +]])
 diff --git a/configure.ac b/configure.ac
-index cd678f1..3d50641 100644
+index cd678f1c..3d50641e 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -5,6 +5,7 @@ AC_INIT([polkit], [0.116], 
[http://lists.freedesktop.org/mailman/listinfo/polkit
@@ -1390,6 +1381,77 @@ index cd678f1..3d50641 100644
  # Taken from dbus
  AC_ARG_ENABLE(ansi, [  --enable-ansi   enable -ansi 
-pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
 -- 
-2.24.1
+GitLab
+
+
+From 1004e60755d9aa362d30c8909460b8f9b824 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?X=E2=84=B9=20Ruoyao?= 
+Date: Mon, 8 Jun 2020 20:46:43 +0800
+Subject: [PATCH 4/5] remove an unused variable
+
+---
+ src/polkitbackend/polkitbackendjsauthority.cpp | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp 
b/src/polkitbackend/polkitbackendjsauthority.cpp
+index d5113cb0..61088a1d 100644
+--- a/src/polkitbackend/polkitbackendjsauthority.cpp
 b/src/polkitbackend/polkitbackendjsauthority.cpp
+@@ -470,7 +470,6 @@ static void
+ polkit_backend_js_authority_constructed (GObject *object)
+ {
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
+-  gboolean entered_request = FALSE;
+ 
+   authority->priv->cx = JS_NewContext (8L * 1024L * 1024L);
+   if (authority->priv->cx == NULL)
+@@ -486,7 +485,6 @@ polkit_backend_js_authority_constructed (GObject *object)
+   JS::SetWarningReporter(authority->priv->cx, report_error);
+   JS_SetContextPrivate (authority->priv->cx, authority);
+ 
+-  entered_request = TRUE;
+ 
+   {
+ JS::RealmOptions compart_opts;
+@@ -552,7 +550,6 @@ polkit_backend_js_authority_constructed (GObject *object)
+ setup_file_monitors (authority);
+ load_scripts (authority);
+   }
+-  entered_request = FALSE;
+ 
+   G_OBJECT_CLASS (polkit_backend_js_authority_parent_class)->constructed 
(object);
+ 
+-- 
+GitLab
+
+
+From 3245061595a10644f8d32e48eeaaf6fbf0364c70 Mon Sep

[gentoo-commits] proj/musl:master commit in: sys-auth/polkit/files/, sys-auth/polkit/

2020-07-17 Thread Anthony G. Basile
commit: da876731dca86b5bedac94e013ce2bcdc56d319a
Author: stefson  yahoo  de>
AuthorDate: Fri Jul 10 11:22:06 2020 +
Commit: Anthony G. Basile  gentoo  org>
CommitDate: Fri Jul 17 12:42:59 2020 +
URL:https://gitweb.gentoo.org/proj/musl.git/commit/?id=da876731

sys-auth/polkit: add upstream fix for mozjs-68

the mozjs patch is from upstream: 
https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/48

the netgroup patch does collide with it, so I backported it on my own and 
renamed it. It did pass all tests on armv7-musl, still I dropped keywords to 
allow testing for others.

Signed-off-by: Steffen Kuhn  yandex.com>
Signed-off-by: Anthony G. Basile  gentoo.org>

 ...it-0.116-make-netgroup-support-optional-2.patch |  219 +++
 .../files/polkit-0.116-spidermonkey-68.patch   | 1395 
 sys-auth/polkit/polkit-0.116-r2.ebuild |  138 ++
 3 files changed, 1752 insertions(+)

diff --git 
a/sys-auth/polkit/files/polkit-0.116-make-netgroup-support-optional-2.patch 
b/sys-auth/polkit/files/polkit-0.116-make-netgroup-support-optional-2.patch
new file mode 100644
index 000..aef30ef
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.116-make-netgroup-support-optional-2.patch
@@ -0,0 +1,219 @@
+diff --git a/configure.ac b/configure.ac
+index 4809dc9..d1ea325 100644
+--- a/configure.ac
 b/configure.ac
+@@ -100,7 +100,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 fdatasync)
++AC_CHECK_FUNCS(clearenv fdatasync setnetgrent)
+ 
+ if test "x$GCC" = "xyes"; then
+   LDFLAGS="-Wl,--as-needed $LDFLAGS"
+diff --git a/src/polkit/polkitidentity.c b/src/polkit/polkitidentity.c
+index 3aa1f7f..793f17d 100644
+--- a/src/polkit/polkitidentity.c
 b/src/polkit/polkitidentity.c
+@@ -182,7 +182,15 @@ polkit_identity_from_string  (const gchar   *str,
+ }
+   else if (g_str_has_prefix (str, "unix-netgroup:"))
+ {
++#ifndef HAVE_SETNETGRENT
++  g_set_error (error,
++   POLKIT_ERROR,
++   POLKIT_ERROR_FAILED,
++   "Netgroups are not available on this machine ('%s')",
++   str);
++#else
+   identity = polkit_unix_netgroup_new (str + sizeof "unix-netgroup:" - 1);
++#endif
+ }
+ 
+   if (identity == NULL && (error != NULL && *error == NULL))
+@@ -344,6 +352,14 @@ polkit_identity_new_for_gvariant (GVariant  *variant,
+   GVariant *v;
+   const char *name;
+ 
++#ifndef HAVE_SETNETGRENT
++  g_set_error (error,
++   POLKIT_ERROR,
++   POLKIT_ERROR_FAILED,
++   "Netgroups are not available on this machine");
++  goto out;
++#else
++
+   v = lookup_asv (details_gvariant, "name", G_VARIANT_TYPE_STRING, error);
+   if (v == NULL)
+ {
+@@ -353,6 +369,7 @@ polkit_identity_new_for_gvariant (GVariant  *variant,
+   name = g_variant_get_string (v, NULL);
+   ret = polkit_unix_netgroup_new (name);
+   g_variant_unref (v);
++#endif
+ }
+   else
+ {
+diff --git a/src/polkit/polkitunixnetgroup.c b/src/polkit/polkitunixnetgroup.c
+index 8a2b369..83f8d4a 100644
+--- a/src/polkit/polkitunixnetgroup.c
 b/src/polkit/polkitunixnetgroup.c
+@@ -194,6 +194,9 @@ polkit_unix_netgroup_set_name (PolkitUnixNetgroup *group,
+ PolkitIdentity *
+ polkit_unix_netgroup_new (const gchar *name)
+ {
++#ifndef HAVE_SETNETGRENT
++  g_assert_not_reached();
++#endif
+   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/polkitbackendinteractiveauthority.c 
b/src/polkitbackend/polkitbackendinteractiveauthority.c
+index 056d9a8..36c2f3d 100644
+--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
 b/src/polkitbackend/polkitbackendinteractiveauthority.c
+@@ -2233,25 +2233,26 @@ get_users_in_net_group (PolkitIdentity 
   *group,
+   GList *ret;
+ 
+   ret = NULL;
++#ifdef HAVE_SETNETGRENT
+   name = polkit_unix_netgroup_get_name (POLKIT_UNIX_NETGROUP (group));
+ 
+-#ifdef HAVE_SETNETGRENT_RETURN
++# ifdef HAVE_SETNETGRENT_RETURN
+   if (setnetgrent (name) == 0)
+ {
+   g_warning ("Error looking up net group with name %s: %s", name, 
g_strerror (errno));
+   goto out;
+ }
+-#else
++# else
+   setnetgrent (name);
+-#endif
++# endif /* HAVE_SETNETGRENT_RETURN */
+ 
+   for (;;)
+ {
+-#if defined(HAVE_NETBSD) || defined(HAVE_OPENBSD)
++# if defined(HAVE_NETBSD) || defined(HAVE_OPENBSD)
+   const char *hostname, *username, *domainname;
+-#else
++# else
+   char *hostname, *username, *domainname;
+-#endif
++# endif /* defined(HAVE_NETBSD) || defined(HAVE_OPENBSD) */
+   PolkitIdentity *user;
+   GError *error = NULL;
+ 
+@@ -2282,6 +2283,7 @@ get_users_in_net_group (PolkitIdentity  

[gentoo-commits] proj/musl:master commit in: sys-auth/polkit/files/

2020-07-09 Thread Anthony G. Basile
commit: 94d104ff31dce026f2683e70fc6b4ad70621ff5a
Author: stefson  yahoo  de>
AuthorDate: Fri Jul  3 10:43:13 2020 +
Commit: Anthony G. Basile  gentoo  org>
CommitDate: Thu Jul  9 17:08:18 2020 +
URL:https://gitweb.gentoo.org/proj/musl.git/commit/?id=94d104ff

sys-auth/polkit: cleanup old patches

Signed-off-by: Steffen Kuhn  yandex.com>
Signed-off-by: Anthony G. Basile  gentoo.org>

 sys-auth/polkit/files/CVE-2018-19788.patch | 339 -
 sys-auth/polkit/files/polkit-0.113-elogind.patch   | 160 --
 ...lkit-0.113-make-netgroup-support-optional.patch | 130 
 ...lkit-0.115-make-netgroup-support-optional.patch | 129 
 .../files/polkit-0.115-spidermonkey-60.patch   | 180 ---
 5 files changed, 938 deletions(-)

diff --git a/sys-auth/polkit/files/CVE-2018-19788.patch 
b/sys-auth/polkit/files/CVE-2018-19788.patch
deleted file mode 100644
index 97e3608..000
--- a/sys-auth/polkit/files/CVE-2018-19788.patch
+++ /dev/null
@@ -1,339 +0,0 @@
-From 2cb40c4d5feeaa09325522bd7d97910f1b59e379 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= 
-Date: Mon, 3 Dec 2018 10:28:58 +0100
-Subject: [PATCH 1/2] Allow negative uids/gids in PolkitUnixUser and Group
- objects
-
-(uid_t) -1 is still used as placeholder to mean "unset". This is OK, since
-there should be no users with such number, see
-https://systemd.io/UIDS-GIDS#special-linux-uids.
-
-(uid_t) -1 is used as the default value in class initialization.
-
-When a user or group above INT32_MAX is created, the numeric uid or
-gid wraps around to negative when the value is assigned to gint, and
-polkit gets confused. Let's accept such gids, except for -1.
-
-A nicer fix would be to change the underlying type to e.g. uint32 to
-not have negative values. But this cannot be done without breaking the
-API, so likely new functions will have to be added (a
-polkit_unix_user_new variant that takes a unsigned, and the same for
-_group_new, _set_uid, _get_uid, _set_gid, _get_gid, etc.). This will
-require a bigger patch.
-
-Fixes https://gitlab.freedesktop.org/polkit/polkit/issues/74.

- src/polkit/polkitunixgroup.c   | 15 +++
- src/polkit/polkitunixprocess.c | 12 
- src/polkit/polkitunixuser.c| 13 ++---
- 3 files changed, 29 insertions(+), 11 deletions(-)
-
-diff --git a/src/polkit/polkitunixgroup.c b/src/polkit/polkitunixgroup.c
-index c57a1aa..309f689 100644
 a/src/polkit/polkitunixgroup.c
-+++ b/src/polkit/polkitunixgroup.c
-@@ -71,6 +71,7 @@ G_DEFINE_TYPE_WITH_CODE (PolkitUnixGroup, polkit_unix_group, 
G_TYPE_OBJECT,
- static void
- polkit_unix_group_init (PolkitUnixGroup *unix_group)
- {
-+  unix_group->gid = -1; /* (git_t) -1 is not a valid GID under Linux */
- }
- 
- static void
-@@ -100,11 +101,14 @@ polkit_unix_group_set_property (GObject  *object,
-GParamSpec   *pspec)
- {
-   PolkitUnixGroup *unix_group = POLKIT_UNIX_GROUP (object);
-+  gint val;
- 
-   switch (prop_id)
- {
- case PROP_GID:
--  unix_group->gid = g_value_get_int (value);
-+  val = g_value_get_int (value);
-+  g_return_if_fail (val != -1);
-+  unix_group->gid = val;
-   break;
- 
- default:
-@@ -131,9 +135,9 @@ polkit_unix_group_class_init (PolkitUnixGroupClass *klass)
-g_param_spec_int ("gid",
-  "Group ID",
-  "The UNIX group ID",
-- 0,
-+ G_MININT,
-  G_MAXINT,
-- 0,
-+ -1,
-  G_PARAM_CONSTRUCT |
-  G_PARAM_READWRITE |
-  G_PARAM_STATIC_NAME |
-@@ -166,9 +170,10 @@ polkit_unix_group_get_gid (PolkitUnixGroup *group)
-  */
- void
- polkit_unix_group_set_gid (PolkitUnixGroup *group,
--  gint gid)
-+   gint gid)
- {
-   g_return_if_fail (POLKIT_IS_UNIX_GROUP (group));
-+  g_return_if_fail (gid != -1);
-   group->gid = gid;
- }
- 
-@@ -183,6 +188,8 @@ polkit_unix_group_set_gid (PolkitUnixGroup *group,
- PolkitIdentity *
- polkit_unix_group_new (gint gid)
- {
-+  g_return_val_if_fail (gid != -1, NULL);
-+
-   return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_GROUP,
-"gid", gid,
-NULL));
-diff --git a/src/polkit/polkitunixprocess.c b/src/polkit/polkitunixprocess.c
-index 972b777..b02b258 100644
 a/src/polkit/polkitunixprocess.c
-+++ b/src/polkit/polkitunixprocess.c
-@@ -159,9 +159,14 @@ polkit_unix_process_

[gentoo-commits] proj/musl:master commit in: sys-auth/polkit/files/, sys-auth/polkit/

2019-05-20 Thread Jory Pratt
commit: a5ed9500ce03494f963ef4b95aff3a0b2d583876
Author: Jory Pratt  gentoo  org>
AuthorDate: Tue May 21 01:33:49 2019 +
Commit: Jory Pratt  gentoo  org>
CommitDate: Tue May 21 01:33:49 2019 +
URL:https://gitweb.gentoo.org/proj/musl.git/commit/?id=a5ed9500

sys-auth/polkit: change netgroup support patch for 0.116

Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Jory Pratt  gentoo.org>

 ...it-0.116-make-netgroup-support-optional-1.patch | 248 +
 ...lkit-0.116-make-netgroup-support-optional.patch | 155 -
 ...{polkit-0.116.ebuild => polkit-0.116-r1.ebuild} |   2 +-
 3 files changed, 249 insertions(+), 156 deletions(-)

diff --git 
a/sys-auth/polkit/files/polkit-0.116-make-netgroup-support-optional-1.patch 
b/sys-auth/polkit/files/polkit-0.116-make-netgroup-support-optional-1.patch
new file mode 100644
index 000..84f07f9
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.116-make-netgroup-support-optional-1.patch
@@ -0,0 +1,248 @@
+From 71e5409c931f8e69ef7e782d1c396c335a4c3f76 Mon Sep 17 00:00:00 2001
+From: A. Wilcox 
+Date: Mon, 20 May 2019 20:24:42 -0500
+Subject: [PATCH] On at least Linux/musl and Linux/uclibc, netgroup 
+support is not available.  PolKit fails to compile on these systems
+for that reason.
+
+This change makes netgroup support conditional on the presence of the
+setnetgrent(3) function which is required for the support to work.  If
+that function is not available on the system, an error will be returned
+to the administrator if unix-netgroup: is specified in configuration.
+
+Fixes bug 50145.
+
+Closes polkit/polkit#14.
+Signed-off-by: A. Wilcox 
+---
+ configure.ac |  2 +-
+ src/polkit/polkitidentity.c  | 16 
+ src/polkit/polkitunixnetgroup.c  |  3 +++
+ .../polkitbackendinteractiveauthority.c  | 14 --
+ src/polkitbackend/polkitbackendjsauthority.cpp   |  2 ++
+ test/polkit/polkitidentitytest.c |  9 -
+ test/polkit/polkitunixnetgrouptest.c |  3 +++
+ .../test-polkitbackendjsauthority.c  |  2 ++
+ 8 files changed, 43 insertions(+), 8 deletions(-)
+
+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"],
+[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
+ AC_SUBST(EXPAT_LIBS)
+ 
+-AC_CHECK_FUNCS(clearenv fdatasync)
++AC_CHECK_FUNCS(clearenv fdatasync setnetgrent)
+ 
+ if test "x$GCC" = "xyes"; then
+   LDFLAGS="-Wl,--as-needed $LDFLAGS"
+diff --git a/src/polkit/polkitidentity.c b/src/polkit/polkitidentity.c
+index 3aa1f7f..10e9c17 100644
+--- a/src/polkit/polkitidentity.c
 b/src/polkit/polkitidentity.c
+@@ -182,7 +182,15 @@ polkit_identity_from_string  (const gchar   *str,
+ }
+   else if (g_str_has_prefix (str, "unix-netgroup:"))
+ {
++#ifndef HAVE_SETNETGRENT
++  g_set_error (error,
++   POLKIT_ERROR,
++   POLKIT_ERROR_FAILED,
++   "Netgroups are not available on this machine ('%s')",
++   str);
++#else
+   identity = polkit_unix_netgroup_new (str + sizeof "unix-netgroup:" - 1);
++#endif
+ }
+ 
+   if (identity == NULL && (error != NULL && *error == NULL))
+@@ -344,6 +352,13 @@ polkit_identity_new_for_gvariant (GVariant  *variant,
+   GVariant *v;
+   const char *name;
+ 
++#ifndef HAVE_SETNETGRENT
++  g_set_error (error,
++   POLKIT_ERROR,
++   POLKIT_ERROR_FAILED,
++   "Netgroups are not available on this machine");
++  goto out;
++#else
+   v = lookup_asv (details_gvariant, "name", G_VARIANT_TYPE_STRING, error);
+   if (v == NULL)
+ {
+@@ -353,6 +368,7 @@ polkit_identity_new_for_gvariant (GVariant  *variant,
+   name = g_variant_get_string (v, NULL);
+   ret = polkit_unix_netgroup_new (name);
+   g_variant_unref (v);
++#endif
+ }
+   else
+ {
+diff --git a/src/polkit/polkitunixnetgroup.c b/src/polkit/polkitunixnetgroup.c
+index 8a2b369..83f8d4a 100644
+--- a/src/polkit/polkitunixnetgroup.c
 b/src/polkit/polkitunixnetgroup.c
+@@ -194,6 +194,9 @@ polkit_unix_netgroup_set_name (PolkitUnixNetgroup *group,
+ PolkitIdentity *
+ polkit_unix_netgroup_new (const gchar *name)
+ {
++#ifndef HAVE_SETNETGRENT
++  g_assert_not_reached();
++#endif
+   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/polkitbackendinteractiveauthority.c 
b/src/polkitbackend/polkitbackendinteractiveauthority.c
+index 056d9a8..36c2f3d 100644
+--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
 b/src/polkitbackend/polkitbackendinteractiveauthority.c
+@@ -2233,25 +2233,26 @@ get_u

[gentoo-commits] proj/musl:master commit in: sys-auth/polkit/files/, sys-auth/polkit/

2019-03-26 Thread Jory Pratt
commit: c1ebe39a68169364f202397d6474b255dbae8b32
Author: Jory Pratt  gentoo  org>
AuthorDate: Tue Mar 26 14:26:52 2019 +
Commit: Jory Pratt  gentoo  org>
CommitDate: Tue Mar 26 14:26:52 2019 +
URL:https://gitweb.gentoo.org/proj/musl.git/commit/?id=c1ebe39a

sys-auth/polkit: sync with in tree update

Signed-off-by: Jory Pratt  gentoo.org>

 .../files/polkit-0.115-spidermonkey-60.patch   | 180 +
 sys-auth/polkit/polkit-0.115-r4.ebuild | 144 +
 2 files changed, 324 insertions(+)

diff --git a/sys-auth/polkit/files/polkit-0.115-spidermonkey-60.patch 
b/sys-auth/polkit/files/polkit-0.115-spidermonkey-60.patch
new file mode 100644
index 000..8a4510a
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.115-spidermonkey-60.patch
@@ -0,0 +1,180 @@
+From c9cd7024140b837b5693d7c1bbaad1b0cd31cce6 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi 
+Date: Fri, 31 Aug 2018 13:32:16 +0100
+Subject: [PATCH] Depend on mozjs-60
+
+This is the new ESR version of the Mozilla JS engine, superceding
+mozjs-52.
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5c37e48..5cedb4e 100644
+--- a/configure.ac
 b/configure.ac
+@@ -79,7 +79,7 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
+ AC_SUBST(GLIB_CFLAGS)
+ AC_SUBST(GLIB_LIBS)
+ 
+-PKG_CHECK_MODULES(LIBJS, [mozjs-52])
++PKG_CHECK_MODULES(LIBJS, [mozjs-60])
+ 
+ AC_SUBST(LIBJS_CFLAGS)
+ AC_SUBST(LIBJS_CXXFLAGS)
+
+
+From dd00683e8781d230a45781d509d86ad676138564 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi 
+Date: Fri, 31 Aug 2018 13:33:20 +0100
+Subject: [PATCH] Port the JS authority to mozjs-60
+
+API changes in mozjs that need to be reflected in the JS authority:
+
+ - the JS::CompileOptions constructor and the JS::CompartmentOptions
+   do not allow setting a JS version any more
+
+ - do not use NULL comparisons for C++ objects
+
+ - the resize() method for a vector has a return value that needs
+   to be handled
+
+ - JSClassOps has different fields
+---
+ .../polkitbackendjsauthority.cpp  | 65 +--
+ 1 file changed, 32 insertions(+), 33 deletions(-)
+
+diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp 
b/src/polkitbackend/polkitbackendjsauthority.cpp
+index 7602714..984a0f0 100644
+--- a/src/polkitbackend/polkitbackendjsauthority.cpp
 b/src/polkitbackend/polkitbackendjsauthority.cpp
+@@ -150,18 +150,17 @@ G_DEFINE_TYPE (PolkitBackendJsAuthority, 
polkit_backend_js_authority, POLKIT_BAC
+ /* 

 */
+ 
+ static const struct JSClassOps js_global_class_ops = {
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL
++  nullptr,  // addProperty
++  nullptr,  // deleteProperty
++  nullptr,  // enumerate
++  nullptr,  // newEnumerate
++  nullptr,  // resolve
++  nullptr,  // mayResolve
++  nullptr,  // finalize
++  nullptr,  // call
++  nullptr,  // hasInstance
++  nullptr,  // construct
++  JS_GlobalObjectTraceHook
+ };
+ 
+ static JSClass js_global_class = {
+@@ -172,18 +171,17 @@ static JSClass js_global_class = {
+ 
+ /* 

 */
+ static const struct JSClassOps js_polkit_class_ops = {
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL,
+-  NULL
++  nullptr,  // addProperty
++  nullptr,  // deleteProperty
++  nullptr,  // enumerate
++  nullptr,  // newEnumerate
++  nullptr,  // resolve
++  nullptr,  // mayResolve
++  nullptr,  // finalize
++  nullptr,  // call
++  nullptr,  // hasInstance
++  nullptr,  // construct
++  nullptr   // trace
+ };
+ 
+ static JSClass js_polkit_class = {
+@@ -469,19 +467,18 @@ polkit_backend_js_authority_constructed (GObject *object)
+ 
+   {
+ JS::CompartmentOptions compart_opts;
+-compart_opts.behaviors().setVersion(JSVERSION_LATEST);
++
+ JS::RootedObject global(authority->priv->cx);
+ 
+ authority->priv->js_global = new JS::Heap (JS_NewGlobalObject 
(authority->priv->cx, &js_global_class, NULL, JS::FireOnNewGlobalHook, 
compart_opts));
+ 
+ global = authority->priv->js_global->get ();
+-
+-if (global == NULL)
++if (!global)
+   goto fail;
+ 
+ authority->priv->ac = new JSAutoCompartment(authority->priv->cx,  global);
+ 
+-if (authority->priv->ac == NULL)
++if (!authority->priv->ac)
+   goto fail;
+ 
+ if (!JS_InitStandardClasses (authority->priv->cx, global))
+@@ -493,7 +490,7 @@ polkit_backend_js_authority_constructed (GObject *object)
+ 
+ polkit = authority->priv->js_polkit->get ();
+ 
+-if (polkit == NULL)
++if (!polkit)
+   goto fail;
+ 
+ if (!JS_DefineProperty(authority->priv->cx, global, "polkit", polkit, 
JSPROP_ENUMERATE))
+@@ -504,7 +501,

[gentoo-commits] proj/musl:master commit in: sys-auth/polkit/files/, sys-auth/polkit/

2018-12-16 Thread Anthony G. Basile
commit: 28f2170aef776c77dba5fba71272fd97faa9
Author: callmetango  users  noreply  github 
 com>
AuthorDate: Tue Dec 11 12:31:56 2018 +
Commit: Anthony G. Basile  gentoo  org>
CommitDate: Sun Dec 16 10:25:26 2018 +
URL:https://gitweb.gentoo.org/proj/musl.git/commit/?id=28f2170a

sys-auth/polkit: version bump to 0.115-r2

* added CVE-2018-19788.patch from Gentoo tree

Signed-off-by: Anthony G. Basile  gentoo.org>

 sys-auth/polkit/files/CVE-2018-19788.patch | 339 +
 sys-auth/polkit/polkit-0.115-r2.ebuild | 143 
 2 files changed, 482 insertions(+)

diff --git a/sys-auth/polkit/files/CVE-2018-19788.patch 
b/sys-auth/polkit/files/CVE-2018-19788.patch
new file mode 100644
index 000..97e3608
--- /dev/null
+++ b/sys-auth/polkit/files/CVE-2018-19788.patch
@@ -0,0 +1,339 @@
+From 2cb40c4d5feeaa09325522bd7d97910f1b59e379 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= 
+Date: Mon, 3 Dec 2018 10:28:58 +0100
+Subject: [PATCH 1/2] Allow negative uids/gids in PolkitUnixUser and Group
+ objects
+
+(uid_t) -1 is still used as placeholder to mean "unset". This is OK, since
+there should be no users with such number, see
+https://systemd.io/UIDS-GIDS#special-linux-uids.
+
+(uid_t) -1 is used as the default value in class initialization.
+
+When a user or group above INT32_MAX is created, the numeric uid or
+gid wraps around to negative when the value is assigned to gint, and
+polkit gets confused. Let's accept such gids, except for -1.
+
+A nicer fix would be to change the underlying type to e.g. uint32 to
+not have negative values. But this cannot be done without breaking the
+API, so likely new functions will have to be added (a
+polkit_unix_user_new variant that takes a unsigned, and the same for
+_group_new, _set_uid, _get_uid, _set_gid, _get_gid, etc.). This will
+require a bigger patch.
+
+Fixes https://gitlab.freedesktop.org/polkit/polkit/issues/74.
+---
+ src/polkit/polkitunixgroup.c   | 15 +++
+ src/polkit/polkitunixprocess.c | 12 
+ src/polkit/polkitunixuser.c| 13 ++---
+ 3 files changed, 29 insertions(+), 11 deletions(-)
+
+diff --git a/src/polkit/polkitunixgroup.c b/src/polkit/polkitunixgroup.c
+index c57a1aa..309f689 100644
+--- a/src/polkit/polkitunixgroup.c
 b/src/polkit/polkitunixgroup.c
+@@ -71,6 +71,7 @@ G_DEFINE_TYPE_WITH_CODE (PolkitUnixGroup, polkit_unix_group, 
G_TYPE_OBJECT,
+ static void
+ polkit_unix_group_init (PolkitUnixGroup *unix_group)
+ {
++  unix_group->gid = -1; /* (git_t) -1 is not a valid GID under Linux */
+ }
+ 
+ static void
+@@ -100,11 +101,14 @@ polkit_unix_group_set_property (GObject  *object,
+GParamSpec   *pspec)
+ {
+   PolkitUnixGroup *unix_group = POLKIT_UNIX_GROUP (object);
++  gint val;
+ 
+   switch (prop_id)
+ {
+ case PROP_GID:
+-  unix_group->gid = g_value_get_int (value);
++  val = g_value_get_int (value);
++  g_return_if_fail (val != -1);
++  unix_group->gid = val;
+   break;
+ 
+ default:
+@@ -131,9 +135,9 @@ polkit_unix_group_class_init (PolkitUnixGroupClass *klass)
+g_param_spec_int ("gid",
+  "Group ID",
+  "The UNIX group ID",
+- 0,
++ G_MININT,
+  G_MAXINT,
+- 0,
++ -1,
+  G_PARAM_CONSTRUCT |
+  G_PARAM_READWRITE |
+  G_PARAM_STATIC_NAME |
+@@ -166,9 +170,10 @@ polkit_unix_group_get_gid (PolkitUnixGroup *group)
+  */
+ void
+ polkit_unix_group_set_gid (PolkitUnixGroup *group,
+-  gint gid)
++   gint gid)
+ {
+   g_return_if_fail (POLKIT_IS_UNIX_GROUP (group));
++  g_return_if_fail (gid != -1);
+   group->gid = gid;
+ }
+ 
+@@ -183,6 +188,8 @@ polkit_unix_group_set_gid (PolkitUnixGroup *group,
+ PolkitIdentity *
+ polkit_unix_group_new (gint gid)
+ {
++  g_return_val_if_fail (gid != -1, NULL);
++
+   return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_GROUP,
+"gid", gid,
+NULL));
+diff --git a/src/polkit/polkitunixprocess.c b/src/polkit/polkitunixprocess.c
+index 972b777..b02b258 100644
+--- a/src/polkit/polkitunixprocess.c
 b/src/polkit/polkitunixprocess.c
+@@ -159,9 +159,14 @@ polkit_unix_process_set_property (GObject  *object,
+   polkit_unix_process_set_pid (unix_process, g_value_get_int (value));
+   break;
+ 
+-case PROP_UID:
+-  polkit_unix_process