summaryrefslogtreecommitdiff
path: root/sys-auth/polkit
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-05-12 16:42:50 +0300
committerV3n3RiX <venerix@koprulu.sector>2022-05-12 16:42:50 +0300
commit752d6256e5204b958b0ef7905675a940b5e9172f (patch)
tree330d16e6362a49cbed8875a777fe641a43376cd3 /sys-auth/polkit
parent0c100b7dd2b30e75b799d806df4ef899fd98e1ea (diff)
gentoo resync : 12.05.2022
Diffstat (limited to 'sys-auth/polkit')
-rw-r--r--sys-auth/polkit/Manifest13
-rw-r--r--sys-auth/polkit/files/polkit-0.118-make-netgroup-support-optional.patch20
-rw-r--r--sys-auth/polkit/files/polkit-0.120_p20220221-pkexec-suid.patch67
-rw-r--r--sys-auth/polkit/files/polkit-0.120_p20220509-make-netgroup-support-optional.patch231
-rw-r--r--sys-auth/polkit/polkit-0.117-r3.ebuild2
-rw-r--r--sys-auth/polkit/polkit-0.120-r3.ebuild2
-rw-r--r--sys-auth/polkit/polkit-0.120_p20220221-r1.ebuild129
-rw-r--r--sys-auth/polkit/polkit-0.120_p20220221.ebuild2
-rw-r--r--sys-auth/polkit/polkit-0.120_p20220509.ebuild146
9 files changed, 605 insertions, 7 deletions
diff --git a/sys-auth/polkit/Manifest b/sys-auth/polkit/Manifest
index 894e967676d6..afdab6e0266b 100644
--- a/sys-auth/polkit/Manifest
+++ b/sys-auth/polkit/Manifest
@@ -1,13 +1,18 @@
AUX polkit-0.115-elogind.patch 1069 BLAKE2B 6c5a3d7d3e716a994b951181808f64d864e6ca58b3a018a5354022f08c6e7c1d8987366c9777f47cc970916ad9fe39f288a1b1643113fc99745f333e02dab56f SHA512 06432fa56788699762c6978484640554f91728a1cb40679eb47b8514b3c7aa23aac5b9c26586eb4d7043a0af1b319bbe7f869d24844d9151317299b74a8e8f7f
AUX polkit-0.117-CVE-2021-3560.patch 909 BLAKE2B a912312e60fc442645a94a93795912220019a668f18a6a0d4e3c34ea23ea4155b37673b5e8db516cbe389b49423ef6008006823897dc41795ee5ac5def3e2708 SHA512 e62f362a4486e5eab04a0acd582d5cb9c1def19dd1707a9e1c861bdea6f576e6c24838c722526908de9cad63a699b513e4f56d1d5bbb0fcb9578f542d65b2953
-AUX polkit-0.118-make-netgroup-support-optional.patch 7273 BLAKE2B 2ed2abc22b77db337d258be8a5cc18a28a2126d1ebf982fcc519472f271fa3e7191d990db3af51b5fb490f92110d16f8e1a0ed0d9a4f3fa980e04f3ee4b64181 SHA512 2e582b8c4a2535cdf6464fc8905e26e8401bfecff6f121ba05c085247acd61d0ee331f134147ebfe3e3ce543ab6f8d337766099fdcca767de3c046cdab413179
+AUX polkit-0.118-make-netgroup-support-optional.patch 7827 BLAKE2B 31fe769d1fdeb2ffca34533f0f448e3cd03d9a4849d8b67c7202368d804a5e6fbe58aecd1ae349c5193ffb87da035892500eb89507560412f10c2e44ed6c8d32 SHA512 ce00cbc8e35eb65f4db29cb4932b644bdc412f1c889560765f5da4eb7f265028c9e0839e1155b189fbea2b4bd3dca5106ad58698cfc1eebb61aeb582e29871a5
AUX polkit-0.120-CVE-2021-4034.patch 1933 BLAKE2B f125b6c55428c2c12dbb89e7bc8619400d914f5b2b955d4e6ec24c4ac2cb02ba8e624f5c1a61dda74b1c24cd5c81a3f2985b9f4cf828bd801d940e707d62bec7 SHA512 cd32461e95297e29d7a5b7ba999b4f27c8296c964eb41c94b4511dc5181538ad0a50554340dae3c5a87629e07b8b22477478ffbf478f0fc16de856f8efb791d6
AUX polkit-0.120-CVE-2021-4115.patch 2244 BLAKE2B 731e583d9657de6e3b7c384a0122487b71253539066ca17debf6172d6e6d45dee292bd421de5cc406c97d32862250d170ea42e83fb15103581c1443b7c39df35 SHA512 b9032fb05e4a18d72caf8eeed3f400d774798de28d5dde679f769f0d60cc1818ae688f6aa86c074517f2789eb61011368288c7ebafd0361af2c63f08ada3d00a
AUX polkit-0.120-meson.patch 1201 BLAKE2B cae66df3db2c92392a07d3b39219a3c16819a9c2393b2bbfc65a32e4beac921e17bb09220cbfe2622edc21c7f81c64058cf60c315d48b8d80ba643d8336d5171 SHA512 f3a4feafae83dcc8bd665557cfc755c08888a78575313d510ec5ff140a2174a709755aa5e23081291ade6b2d333887a10848ae5c7a99b700a2e18476af21844d
+AUX polkit-0.120_p20220221-pkexec-suid.patch 1874 BLAKE2B 61984910aa9e99d07784894cd5415c8f524c2db49584bd14df9c75836387a711336897c02253abd546f5175d42f17e1a9f5954c646b1e5e97b3e544ed42a11cd SHA512 458eb26e294f3a28d951541d24cd6d5446106acd441cec8329b68a92029fd9c75278692fa81b89be251bfeb3cea5471c9a2c49e44ff3771c6c9354d388d49b3a
+AUX polkit-0.120_p20220509-make-netgroup-support-optional.patch 7306 BLAKE2B f01dae628a31cee32ea5416a456bc8515142949a656b7e7075db1e71b04b50041fa466e659f8056b02f8b6d542219bedb77b4279b7c375c7c4971c0b20d968b3 SHA512 300867e1b32f03eafaae9c91994576ce5112a064850dee1f323401cb624a60e48776c42dbb61ab2fd4d0c5fb0e9ec25e542842572d067a7b7b0e84c2c7d6ff4a
DIST polkit-0.117.tar.gz 1554536 BLAKE2B 1cf7e0ff9db19a29be626f4bea96c9e2ef8b1eab4b8287a5f1f4d2a818b86d58c1c4c4a41849d95e31559dba1b18853a31e934ebbadd8e07f94dfd58b45240e0 SHA512 c10ea984f2386fe436e58a2866e5323afc80d24f744f0ee61d966941259aa491bd96b07d911434aa731b300c3cca25b647804b396501175ab5b3c53384e94c70
DIST polkit-0.120.tar.gz 1626659 BLAKE2B 745727445b4946d44b8ea470d21ac131ca7706e83f5dbaf85cf3541ac60a1bbe23b3bf3172a62d9256ebb3dae02d2b2d476e3e0f7fe79a80c47864a120e62ed9 SHA512 db072769439d5e17d0eed681e7b94251b77828c1474b40fe40b94293903a64333e7fa17515a3270648691f04a1374d8b404405ead6abf292a8eb8483164adc46
DIST polkit-0.120_p20220221.tar.bz2 734510 BLAKE2B 412f943d6d7b8ec493280073ed75c73f6acc89958d1507b416067ce742cc91e648956015a8d40a38c41ef061c79fc62004aa99b9902cdee0b8302852fa2df42c SHA512 15b09ba274f9b09ff5bf11d6238da43b0ee1fd76d53aa489b062f168a79f5de74cbd3953b45fa3bfad458e09e4c04032d08fe369bec6ffa35114da610741eb9f
-EBUILD polkit-0.117-r3.ebuild 3427 BLAKE2B 3725159a592d2072fde8f5e4d6ae6a12dfd24f86e81b8c84a7d36beda89e22588d87b63c1e6b96c65533423b383a1ad1f9a68462b95fa5068fdb238d446afd9a SHA512 44065ebcdf8b6bafc4b87a9841526ed72e6b27490d3ca550383b38b4d5c98f370e9feac3c13617acf3c760dbc8b91ac47454e62a052b0c674af71d73c088d6e5
-EBUILD polkit-0.120-r3.ebuild 3222 BLAKE2B 1f2b78f9e73e90ebfe62fd32bf1677b0653921db96c8ae4af1fe0eebb9119807cf483b702ae82378451a2d122d6d8b6a970e4904e26b0871351af4b9891de5b7 SHA512 ad360a8dfab8f966d81c459ff41bbdc5a2d1f843bc1342788f5ebab6bcf736b0e3ccb878204cff08550e81e9550b6d8d8afb5733e2c845bd58d525e54d46e999
-EBUILD polkit-0.120_p20220221.ebuild 3236 BLAKE2B eaaf9b0df71c26deb5058c1b044d425a3ff178fbcc94ae6321562492af1bcfba96cec620f64f79855f40f4a7c87cec70058d9066e43aa9f5c32057c8e61b4f31 SHA512 539904d67358da0abcc6a894afb87abc04ffb5b113ac052add76846b895dc5dffdea0c486a01beff5a172448a887e94de68b5bfbda53e3493265aebc31eda72e
+DIST polkit-0.120_p20220509.tar.bz2 702995 BLAKE2B 5eee6c5c895f95a1caa037cb7cc7ace86584013455142a8f7cd1e97c99de5d99575a70be525fb596342949f7c6ed56bd54cce6552132153bb1383377722f9e5c SHA512 24136d215d760d3eaff910495b2b1ac2d6bbc4577bd65566ff425485e76625aea2478ab323048c24ba6560ffee8eae6d22fa6b7bba0a3a5a35f53dc50d8dcb4f
+EBUILD polkit-0.117-r3.ebuild 3421 BLAKE2B 8c73f230d712d78551e55bb5dbce0dd1ca61a6fdfb5f813d73e8f468d911e5d5141ee8d0e89915cb44d6eb9d74a57788c3e9a729b7d3208d4ae287efc7a018ec SHA512 1bb4ccb01b750961b067cdc91a4317d747022e5dfd1e7625f3f090302cf2a68a5b4da006c922c5e56192a7c520cb54a63b9c21e173def6e4868c388ec8ade7c0
+EBUILD polkit-0.120-r3.ebuild 3216 BLAKE2B 832d88d6f3e1770f42b9a17abb6a77c30cb4fedba6efef52a1a6e7c0e1c49d8e23af1379532c11b36136ff594ad5860cb69c6fe69aa81c25f0479b5f07cd2b5a SHA512 5c991f1f062230ba05564adfc9186f2f6b4bddd77182ff3ac5649198dd838c4c6216ff77dca042905b518d396f943dcd85a95f575b949b84605d0caabc95624d
+EBUILD polkit-0.120_p20220221-r1.ebuild 3303 BLAKE2B b00a260b749e8ee0620a04c93fd4cbe83de8e80d11fd4388be07914229b4dfefb881b35d2b22c231c1ebaa844a30f3579ae5948d290118a528414cbcd7e81110 SHA512 3b7d82d879a1611fcbb70562da47feace213acd0055a03bd752b7e2ee98951db3f8e3a12b04da80dcbf49eecbaf2573d71007879692c5f11264bde4f095ba239
+EBUILD polkit-0.120_p20220221.ebuild 3236 BLAKE2B a0255cdd9d3b77b27d6962747ac34ce11c71dd10b1400bf187098216415856be84209f7b242ec25f0504ba7557b1cec622d796a8774ed33a14fde382f97b78dd SHA512 bcfd31c336e628b3bbfe20e7d43799945625f4af0b64b19969f56264833645ed2779da073d2731729c3faa7e2c824da75f6f69c4677322a3591feb4912d4d9da
+EBUILD polkit-0.120_p20220509.ebuild 3803 BLAKE2B ff93a770243763bb9ce9d39134817ddeee84c4cdb98fa0652e92e59655a67f3bf4455ccf3c21d0940961e9f8a726823f4231cb83ff225e9e4d1b048575d36102 SHA512 41332f3d170d555bdc20e26d6c5b4022509f0972e20de81294c0623a00de824bac8af8b12c07201836ec83c39f0c4726a3fcbb5b21c5ad78cfcc20d77fdef8a8
MISC metadata.xml 537 BLAKE2B 990f855eefe670eec229bdd37d597dbe568651ff4fefbad6c0f5bb1be53479b2b60ae44001d8af34c5730dba273878d47500f3dce120526a15618edfb42ed0ac SHA512 c30b94411055d404eb31b26b80b647500f8ef8c31d338b6753878298cde7e8c8657887cc0cf50fc23538401ac4239892a50f417c7e7840aa8c73c84c73518be2
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
index b11250fd3992..8810e70b7378 100644
--- 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
@@ -226,3 +226,23 @@ Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
};
guint n;
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -1035,7 +1035,7 @@ js_polkit_user_is_in_netgroup (duk_context *cx)
+
+ user = duk_require_string (cx, 0);
+ netgroup = duk_require_string (cx, 1);
+-
++#ifdef HAVE_SETNETGRENT
+ if (innetgr (netgroup,
+ NULL, /* host */
+ user,
+@@ -1043,7 +1043,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/sys-auth/polkit/files/polkit-0.120_p20220221-pkexec-suid.patch b/sys-auth/polkit/files/polkit-0.120_p20220221-pkexec-suid.patch
new file mode 100644
index 000000000000..959656b158a1
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.120_p20220221-pkexec-suid.patch
@@ -0,0 +1,67 @@
+https://gitlab.freedesktop.org/polkit/polkit/-/commit/7d4b52c4d71c46049d87a0775de695ea914f3f1b
+https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/113
+https://bugs.gentoo.org/827884
+
+From: Matt Turner <mattst88@gmail.com>
+Date: Tue, 3 May 2022 12:54:37 +0000
+Subject: [PATCH] pkexec: Allow --version and --help even if not setuid root
+
+--- a/src/programs/pkexec.c
++++ b/src/programs/pkexec.c
+@@ -514,27 +514,6 @@ main (int argc, char *argv[])
+ /* Disable remote file access from GIO. */
+ setenv ("GIO_USE_VFS", "local", 1);
+
+- /* check for correct invocation */
+- if (geteuid () != 0)
+- {
+- g_printerr ("pkexec must be setuid root\n");
+- goto out;
+- }
+-
+- original_user_name = g_strdup (g_get_user_name ());
+- if (original_user_name == NULL)
+- {
+- g_printerr ("Error getting user name.\n");
+- goto out;
+- }
+-
+- if ((original_cwd = g_get_current_dir ()) == NULL)
+- {
+- g_printerr ("Error getting cwd: %s\n",
+- g_strerror (errno));
+- goto out;
+- }
+-
+ /* First process options and find the command-line to invoke. Avoid using fancy library routines
+ * that depend on environtment variables since we haven't cleared the environment just yet.
+ */
+@@ -595,6 +574,27 @@ main (int argc, char *argv[])
+ goto out;
+ }
+
++ /* check for correct invocation */
++ if (geteuid () != 0)
++ {
++ g_printerr ("pkexec must be setuid root\n");
++ goto out;
++ }
++
++ original_user_name = g_strdup (g_get_user_name ());
++ if (original_user_name == NULL)
++ {
++ g_printerr ("Error getting user name.\n");
++ goto out;
++ }
++
++ if ((original_cwd = g_get_current_dir ()) == NULL)
++ {
++ g_printerr ("Error getting cwd: %s\n",
++ g_strerror (errno));
++ goto out;
++ }
++
+ if (opt_user == NULL)
+ opt_user = g_strdup ("root");
+
+GitLab
diff --git a/sys-auth/polkit/files/polkit-0.120_p20220509-make-netgroup-support-optional.patch b/sys-auth/polkit/files/polkit-0.120_p20220509-make-netgroup-support-optional.patch
new file mode 100644
index 000000000000..2922b8606648
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.120_p20220509-make-netgroup-support-optional.patch
@@ -0,0 +1,231 @@
+Pulled in from https://github.com/gentoo/musl/blob/master/sys-auth/polkit/files/polkit-0.118-make-netgroup-support-optional.patch.
+
+https://bugs.gentoo.org/833753
+https://bugs.gentoo.org/561672
+https://bugs.freedesktop.org/show_bug.cgi?id=50145
+https://gitlab.freedesktop.org/polkit/polkit/-/issues/14
+
+Patch has been rebased a bit since but keeping original headers.
+
+From c7ad7cb3ca8fca32b9b64b0fc33867b98935b76b Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Wed, 11 Jul 2018 04:54:26 -0500
+Subject: [PATCH] make netgroup support optional
+
+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.
+
+Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
+--- a/meson.build
++++ b/meson.build
+@@ -89,6 +89,7 @@ config_h.set('_GNU_SOURCE', true)
+ check_functions = [
+ 'clearenv',
+ 'fdatasync',
++ 'setnetgrent',
+ ]
+
+ foreach func: check_functions
+--- 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
+ {
+--- 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,
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -1035,7 +1035,7 @@ js_polkit_user_is_in_netgroup (duk_context *cx)
+
+ user = duk_require_string (cx, 0);
+ netgroup = duk_require_string (cx, 1);
+-
++#ifdef HAVE_SETNETGRENT
+ if (innetgr (netgroup,
+ NULL, /* host */
+ user,
+@@ -1043,7 +1043,7 @@ js_polkit_user_is_in_netgroup (duk_context *cx)
+ {
+ is_in_netgroup = TRUE;
+ }
+-
++#endif
+ duk_push_boolean (cx, is_in_netgroup);
+ return 1;
+ }
+--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
++++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
+@@ -2248,25 +2248,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;
+
+@@ -2297,6 +2298,7 @@ get_users_in_net_group (PolkitIdentity *group,
+
+ out:
+ endnetgrent ();
++#endif /* HAVE_SETNETGRENT */
+ return ret;
+ }
+
+--- a/src/polkitbackend/polkitbackendjsauthority.cpp
++++ b/src/polkitbackend/polkitbackendjsauthority.cpp
+@@ -1271,6 +1271,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
+
+ JS::CallArgs args = JS::CallArgsFromVp (argc, vp);
+
++#ifdef HAVE_SETNETGRENT
+ JS::RootedString usrstr (authority->priv->cx);
+ usrstr = args[0].toString();
+ user = JS_EncodeStringToUTF8 (cx, usrstr);
+@@ -1285,6 +1286,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
+ {
+ is_in_netgroup = true;
+ }
++#endif
+
+ ret = true;
+
+--- a/test/polkit/polkitidentitytest.c
++++ b/test/polkit/polkitidentitytest.c
+@@ -145,11 +145,15 @@ struct ComparisonTestData comparison_test_data [] = {
+ {"unix-group:root", "unix-group:jane", FALSE},
+ {"unix-group:jane", "unix-group:jane", TRUE},
+
++#ifdef HAVE_SETNETGRENT
+ {"unix-netgroup:foo", "unix-netgroup:foo", TRUE},
+ {"unix-netgroup:foo", "unix-netgroup:bar", FALSE},
++#endif
+
+ {"unix-user:root", "unix-group:root", FALSE},
++#ifdef HAVE_SETNETGRENT
+ {"unix-user:jane", "unix-netgroup:foo", FALSE},
++#endif
+
+ {NULL},
+ };
+@@ -181,11 +185,13 @@ main (int argc, char *argv[])
+ g_test_add_data_func ("/PolkitIdentity/group_string_2", "unix-group:jane", test_string);
+ g_test_add_data_func ("/PolkitIdentity/group_string_3", "unix-group:users", test_string);
+
++#ifdef HAVE_SETNETGRENT
+ g_test_add_data_func ("/PolkitIdentity/netgroup_string", "unix-netgroup:foo", test_string);
++ g_test_add_data_func ("/PolkitIdentity/netgroup_gvariant", "unix-netgroup:foo", test_gvariant);
++#endif
+
+ g_test_add_data_func ("/PolkitIdentity/user_gvariant", "unix-user:root", test_gvariant);
+ g_test_add_data_func ("/PolkitIdentity/group_gvariant", "unix-group:root", test_gvariant);
+- g_test_add_data_func ("/PolkitIdentity/netgroup_gvariant", "unix-netgroup:foo", test_gvariant);
+
+ add_comparison_tests ();
+
+--- a/test/polkit/polkitunixnetgrouptest.c
++++ b/test/polkit/polkitunixnetgrouptest.c
+@@ -69,7 +69,9 @@ int
+ main (int argc, char *argv[])
+ {
+ g_test_init (&argc, &argv, NULL);
++#ifdef HAVE_SETNETGRENT
+ g_test_add_func ("/PolkitUnixNetgroup/new", test_new);
+ g_test_add_func ("/PolkitUnixNetgroup/set_name", test_set_name);
++#endif
+ return g_test_run ();
+ }
+--- a/test/polkitbackend/test-polkitbackendjsauthority.c
++++ b/test/polkitbackend/test-polkitbackendjsauthority.c
+@@ -137,12 +137,14 @@ test_get_admin_identities (void)
+ "unix-group:users"
+ }
+ },
++#ifdef HAVE_SETNETGRENT
+ {
+ "net.company.action3",
+ {
+ "unix-netgroup:foo"
+ }
+ },
++#endif
+ };
+ guint n;
+
diff --git a/sys-auth/polkit/polkit-0.117-r3.ebuild b/sys-auth/polkit/polkit-0.117-r3.ebuild
index 61e56bfdcdb3..650af02e7fab 100644
--- a/sys-auth/polkit/polkit-0.117-r3.ebuild
+++ b/sys-auth/polkit/polkit-0.117-r3.ebuild
@@ -11,7 +11,7 @@ SRC_URI="https://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz"
LICENSE="LGPL-2"
SLOT="0"
-KEYWORDS="~alpha ~amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ~ppc64 ~s390 sparc ~x86"
+KEYWORDS="~alpha ~amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ~ppc64 sparc ~x86"
IUSE="elogind examples gtk +introspection kde nls pam selinux systemd test"
RESTRICT="!test? ( test )"
diff --git a/sys-auth/polkit/polkit-0.120-r3.ebuild b/sys-auth/polkit/polkit-0.120-r3.ebuild
index f2960680aca3..8d65989915e6 100644
--- a/sys-auth/polkit/polkit-0.120-r3.ebuild
+++ b/sys-auth/polkit/polkit-0.120-r3.ebuild
@@ -11,7 +11,7 @@ SRC_URI="https://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz"
LICENSE="LGPL-2"
SLOT="0"
-KEYWORDS="amd64 arm arm64 ~mips ppc64 ~riscv ~s390 x86"
+KEYWORDS="amd64 arm arm64 ~mips ppc64 ~riscv x86"
IUSE="examples gtk +introspection kde pam selinux systemd test"
#RESTRICT="!test? ( test )"
# Tests currently don't work with meson. See
diff --git a/sys-auth/polkit/polkit-0.120_p20220221-r1.ebuild b/sys-auth/polkit/polkit-0.120_p20220221-r1.ebuild
new file mode 100644
index 000000000000..a1b8221ce450
--- /dev/null
+++ b/sys-auth/polkit/polkit-0.120_p20220221-r1.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit meson pam pax-utils systemd xdg-utils
+
+DESCRIPTION="Policy framework for controlling privileges for system-wide services"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/polkit https://gitlab.freedesktop.org/polkit/polkit"
+if [[ ${PV} == *_p* ]] ; then
+ MY_COMMIT="b10a1bdb697045db40774f2a9a8c58ae5c7189c3"
+ SRC_URI="https://gitlab.freedesktop.org/polkit/polkit/-/archive/${MY_COMMIT}/polkit-${MY_COMMIT}.tar.bz2 -> ${P}.tar.bz2"
+ S="${WORKDIR}"/${PN}-${MY_COMMIT}
+else
+ SRC_URI="https://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="+duktape examples gtk +introspection kde pam selinux systemd test"
+#RESTRICT="!test? ( test )"
+# Tests currently don't work with meson. See
+# https://gitlab.freedesktop.org/polkit/polkit/-/issues/144
+RESTRICT="test"
+
+BDEPEND="
+ acct-user/polkitd
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/docbook-xsl-stylesheets
+ dev-libs/glib
+ dev-libs/gobject-introspection-common
+ dev-libs/libxslt
+ dev-util/glib-utils
+ sys-devel/gettext
+ virtual/pkgconfig
+ introspection? ( dev-libs/gobject-introspection )
+"
+DEPEND="
+ dev-libs/glib:2
+ dev-libs/expat
+ duktape? ( dev-lang/duktape:= )
+ !duktape? ( dev-lang/spidermonkey:91[-debug] )
+ pam? (
+ sys-auth/pambase
+ sys-libs/pam
+ )
+ !pam? ( virtual/libcrypt:= )
+ systemd? ( sys-apps/systemd:0=[policykit] )
+ !systemd? ( sys-auth/elogind )
+"
+RDEPEND="${DEPEND}
+ acct-user/polkitd
+ selinux? ( sec-policy/selinux-policykit )
+"
+PDEPEND="
+ gtk? ( || (
+ >=gnome-extra/polkit-gnome-0.105
+ >=lxde-base/lxsession-0.5.2
+ ) )
+ kde? ( kde-plasma/polkit-kde-agent )
+"
+
+DOCS=( docs/TODO HACKING NEWS README )
+
+QA_MULTILIB_PATHS="
+ usr/lib/polkit-1/polkit-agent-helper-1
+ usr/lib/polkit-1/polkitd"
+
+src_prepare() {
+ local PATCHES=(
+ # musl
+ "${FILESDIR}"/${PN}-0.118-make-netgroup-support-optional.patch
+ # In next release
+ "${FILESDIR}"/${P}-pkexec-suid.patch
+
+ # Pending upstream
+ "${FILESDIR}"/${PN}-0.120-meson.patch
+ )
+
+ default
+
+ # bug #401513
+ sed -i -e 's|unix-group:wheel|unix-user:0|' src/polkitbackend/*-default.rules || die
+}
+
+src_configure() {
+ xdg_environment_reset
+
+ local emesonargs=(
+ --localstatedir="${EPREFIX}"/var
+ -Dauthfw="$(usex pam pam shadow)"
+ -Dexamples=false
+ -Dgtk_doc=false
+ -Dman=true
+ -Dos_type=gentoo
+ -Dsession_tracking="$(usex systemd libsystemd-login libelogind)"
+ -Dsystemdsystemunitdir="$(systemd_get_systemunitdir)"
+ -Djs_engine=$(usex duktape duktape mozjs)
+ $(meson_use introspection)
+ $(meson_use test tests)
+ $(usex pam "-Dpam_module_dir=$(getpam_mod_dir)" '')
+ )
+ meson_src_configure
+}
+
+src_compile() {
+ meson_src_compile
+
+ # Required for polkitd on hardened/PaX due to spidermonkey's JIT
+ pax-mark mr src/polkitbackend/.libs/polkitd test/polkitbackend/.libs/polkitbackendjsauthoritytest
+}
+
+src_install() {
+ meson_src_install
+
+ if use examples ; then
+ docinto examples
+ dodoc src/examples/{*.c,*.policy*}
+ fi
+
+ diropts -m 0700 -o polkitd
+ keepdir /usr/share/polkit-1/rules.d
+}
+
+pkg_postinst() {
+ chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
+ chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
+}
diff --git a/sys-auth/polkit/polkit-0.120_p20220221.ebuild b/sys-auth/polkit/polkit-0.120_p20220221.ebuild
index 611d147ab31c..5ad724dcf86d 100644
--- a/sys-auth/polkit/polkit-0.120_p20220221.ebuild
+++ b/sys-auth/polkit/polkit-0.120_p20220221.ebuild
@@ -17,7 +17,7 @@ fi
LICENSE="LGPL-2"
SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="+duktape examples gtk +introspection kde pam selinux systemd test"
#RESTRICT="!test? ( test )"
# Tests currently don't work with meson. See
diff --git a/sys-auth/polkit/polkit-0.120_p20220509.ebuild b/sys-auth/polkit/polkit-0.120_p20220509.ebuild
new file mode 100644
index 000000000000..5f6838c29981
--- /dev/null
+++ b/sys-auth/polkit/polkit-0.120_p20220509.ebuild
@@ -0,0 +1,146 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit meson pam pax-utils python-any-r1 systemd xdg-utils
+
+DESCRIPTION="Policy framework for controlling privileges for system-wide services"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/polkit https://gitlab.freedesktop.org/polkit/polkit"
+if [[ ${PV} == *_p* ]] ; then
+ # Upstream don't make releases very often. Test snapshots throughly
+ # and review commits, but don't shy away if there's useful stuff there
+ # we want.
+ MY_COMMIT="c5c6b784221b9dc054548c15e94719c4e961a7f2"
+ SRC_URI="https://gitlab.freedesktop.org/polkit/polkit/-/archive/${MY_COMMIT}/polkit-${MY_COMMIT}.tar.bz2 -> ${P}.tar.bz2"
+
+ S="${WORKDIR}"/${PN}-${MY_COMMIT}
+else
+ SRC_URI="https://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="+duktape examples gtk +introspection kde pam selinux systemd test"
+if [[ ${PV} == *_p* ]] ; then
+ RESTRICT="!test? ( test )"
+else
+ # Tests currently don't work with meson in the dist tarballs. See
+ # https://gitlab.freedesktop.org/polkit/polkit/-/issues/144
+ RESTRICT="test"
+fi
+
+BDEPEND="
+ acct-user/polkitd
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/docbook-xsl-stylesheets
+ dev-libs/glib
+ dev-libs/gobject-introspection-common
+ dev-libs/libxslt
+ dev-util/glib-utils
+ sys-devel/gettext
+ virtual/pkgconfig
+ introspection? ( dev-libs/gobject-introspection )
+ test? (
+ $(python_gen_any_dep '
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-python/python-dbusmock[${PYTHON_USEDEP}]
+ ')
+ )
+"
+DEPEND="
+ dev-libs/glib:2
+ dev-libs/expat
+ duktape? ( dev-lang/duktape:= )
+ !duktape? ( dev-lang/spidermonkey:91[-debug] )
+ pam? (
+ sys-auth/pambase
+ sys-libs/pam
+ )
+ !pam? ( virtual/libcrypt:= )
+ systemd? ( sys-apps/systemd:0=[policykit] )
+ !systemd? ( sys-auth/elogind )
+"
+RDEPEND="${DEPEND}
+ acct-user/polkitd
+ selinux? ( sec-policy/selinux-policykit )
+"
+PDEPEND="
+ gtk? ( || (
+ >=gnome-extra/polkit-gnome-0.105
+ >=lxde-base/lxsession-0.5.2
+ ) )
+ kde? ( kde-plasma/polkit-kde-agent )
+"
+
+DOCS=( docs/TODO HACKING.md NEWS.md README.md )
+
+QA_MULTILIB_PATHS="usr/lib/polkit-1/polkit-agent-helper-1
+ usr/lib/polkit-1/polkitd"
+
+python_check_deps() {
+ python_has_version "dev-python/dbus-python[${PYTHON_USEDEP}]" &&
+ python_has_version "dev-python/python-dbusmock[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ local PATCHES=(
+ # musl
+ "${FILESDIR}"/${PN}-0.120_p20220509-make-netgroup-support-optional.patch
+ )
+
+ default
+
+ # bug #401513
+ sed -i -e 's|unix-group:wheel|unix-user:0|' src/polkitbackend/*-default.rules || die
+}
+
+src_configure() {
+ xdg_environment_reset
+
+ local emesonargs=(
+ --localstatedir="${EPREFIX}"/var
+ -Dauthfw="$(usex pam pam shadow)"
+ -Dexamples=false
+ -Dgtk_doc=false
+ -Dman=true
+ -Dos_type=gentoo
+ -Dsession_tracking="$(usex systemd libsystemd-login libelogind)"
+ -Dsystemdsystemunitdir="$(systemd_get_systemunitdir)"
+ -Djs_engine=$(usex duktape duktape mozjs)
+ $(meson_use introspection)
+ $(meson_use test tests)
+ $(usex pam "-Dpam_module_dir=$(getpam_mod_dir)" '')
+ )
+ meson_src_configure
+}
+
+src_compile() {
+ meson_src_compile
+
+ # Required for polkitd on hardened/PaX due to spidermonkey's JIT
+ pax-mark mr src/polkitbackend/.libs/polkitd test/polkitbackend/.libs/polkitbackendjsauthoritytest
+}
+
+src_install() {
+ meson_src_install
+
+ if use examples ; then
+ docinto examples
+ dodoc src/examples/{*.c,*.policy*}
+ fi
+
+ diropts -m 0700 -o polkitd
+ keepdir /usr/share/polkit-1/rules.d
+}
+
+pkg_postinst() {
+ chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
+ chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
+}