public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-auth/polkit/files/
@ 2022-04-23  1:00 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2022-04-23  1:00 UTC (permalink / raw
  To: gentoo-commits

commit:     4c9e5128453698781e7acb380cf4f8431ed3d07e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 23 00:59:58 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Apr 23 01:00:11 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c9e5128

sys-auth/polkit: adapt musl patch for duktape build

Closes: https://bugs.gentoo.org/834604
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...polkit-0.118-make-netgroup-support-optional.patch | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

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;
+ }


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-auth/polkit/files/
@ 2022-05-16  5:10 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2022-05-16  5:10 UTC (permalink / raw
  To: gentoo-commits

commit:     f897303e28afe761091f4c90065f9526bf6296e8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon May 16 05:09:56 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May 16 05:10:09 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f897303e

sys-auth/polkit: restore polkit-0.118-make-netgroup-support-optional.patch

This patch got rebased for the latest snapshot but not this one, so
bring it back for now.

Fixes: 76caeda5c0ae4a7045d321f32ef95e31722434dd
Reported-by: Matthias Maier <tamiko <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...lkit-0.118-make-netgroup-support-optional.patch | 248 +++++++++++++++++++++
 1 file changed, 248 insertions(+)

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
new file mode 100644
index 000000000000..8810e70b7378
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.118-make-netgroup-support-optional.patch
@@ -0,0 +1,248 @@
+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/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"
+--- 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/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                    *group,
+ 
+  out:
+   endnetgrent ();
++#endif /* HAVE_SETNETGRENT */
+   return ret;
+ }
+ 
+--- a/src/polkitbackend/polkitbackendjsauthority.cpp
++++ b/src/polkitbackend/polkitbackendjsauthority.cpp
+@@ -1519,6 +1519,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);
+@@ -1533,6 +1534,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
+@@ -19,6 +19,7 @@
+  * Author: Nikki VonHollen <vonhollen@google.com>
+  */
+ 
++#include "config.h"
+ #include "glib.h"
+ #include <polkit/polkit.h>
+ #include <polkit/polkitprivate.h>
+@@ -145,11 +146,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 +186,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
+@@ -19,6 +19,7 @@
+  * Author: Nikki VonHollen <vonhollen@google.com>
+  */
+ 
++#include "config.h"
+ #include "glib.h"
+ #include <polkit/polkit.h>
+ #include <string.h>
+@@ -69,7 +70,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;
+ 
+--- 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;
+ }


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-auth/polkit/files/
@ 2024-01-19  6:59 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2024-01-19  6:59 UTC (permalink / raw
  To: gentoo-commits

commit:     e1a7e1d191e7b98df09ec9be6ff8e4d17e65a127
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 19 06:58:45 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 19 06:59:18 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1a7e1d1

sys-auth/polkit: more non-systemd fixes

Bug: https://bugs.gentoo.org/922458
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-auth/polkit/files/polkit-124-systemd-fixup.patch | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/sys-auth/polkit/files/polkit-124-systemd-fixup.patch b/sys-auth/polkit/files/polkit-124-systemd-fixup.patch
index fceb33d31afd..a4dd7eafcf92 100644
--- a/sys-auth/polkit/files/polkit-124-systemd-fixup.patch
+++ b/sys-auth/polkit/files/polkit-124-systemd-fixup.patch
@@ -2,7 +2,7 @@ https://bugs.gentoo.org/922458
 https://github.com/polkit-org/polkit/pull/417/files#r1458416421
 --- a/meson.build
 +++ b/meson.build
-@@ -212,11 +212,14 @@ if enable_logind
+@@ -212,14 +212,17 @@ if enable_logind
    config_h.set10('HAVE_' + func.to_upper(), cc.has_function(func, dependencies: logind_dep))
  
    # systemd unit / service files
@@ -11,16 +11,18 @@ https://github.com/polkit-org/polkit/pull/417/files#r1458416421
 -  if systemd_systemdsystemunitdir == '' and session_tracking == 'libsystemd-login'
 -    # FIXME: systemd.pc file does not use variables with relative paths, so `define_variable` cannot be used
 -    systemd_systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
+-  endif
 +  if session_tracking == 'libsystemd-login'
 +    systemd_dep = dependency('systemd', not_found_message: 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
-+
+ 
+-  systemd_sysusers_dir = systemd_dep.get_pkgconfig_variable('sysusers_dir', default: '/usr/lib/sysusers.d')
 +    if systemd_systemdsystemunitdir == ''
 +      # FIXME: systemd.pc file does not use variables with relative paths, so `define_variable` cannot be used
 +      systemd_systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
 +    endif
-   endif
++
++    systemd_sysusers_dir = systemd_dep.get_pkgconfig_variable('sysusers_dir', default: '/usr/lib/sysusers.d')
++  endif
+ endif
+ config_h.set('HAVE_LIBSYSTEMD', enable_logind)
  
-   systemd_sysusers_dir = systemd_dep.get_pkgconfig_variable('sysusers_dir', default: '/usr/lib/sysusers.d')
--- 
-2.43.0
-


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-auth/polkit/files/
@ 2024-06-17 22:36 Conrad Kostecki
  0 siblings, 0 replies; 4+ messages in thread
From: Conrad Kostecki @ 2024-06-17 22:36 UTC (permalink / raw
  To: gentoo-commits

commit:     395e4054872534b0d9645ebbfbaf0352df6be0cd
Author:     Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Fri May 31 14:08:48 2024 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Mon Jun 17 22:34:57 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=395e4054

sys-auth/polkit: remove unused patch

Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Closes: https://github.com/gentoo/gentoo/pull/36920
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 .../files/polkit-122-libs-only-postinstall.patch   | 39 ----------------------
 1 file changed, 39 deletions(-)

diff --git a/sys-auth/polkit/files/polkit-122-libs-only-postinstall.patch b/sys-auth/polkit/files/polkit-122-libs-only-postinstall.patch
deleted file mode 100644
index d96b4bc4bde1..000000000000
--- a/sys-auth/polkit/files/polkit-122-libs-only-postinstall.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/149
-
-From bef75fb8291b3871894d8ffe19f7242448cdb4a8 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Wed, 7 Dec 2022 13:18:09 +0000
-Subject: [PATCH] meson.build: fix install with libs_only
-
-Bug: https://bugs.gentoo.org/884701
-Signed-off-by: Sam James <sam@gentoo.org>
---- a/meson.build
-+++ b/meson.build
-@@ -360,14 +360,17 @@ configure_file(
-   configuration: config_h,
- )
- 
--meson.add_install_script(
--  'meson_post_install.py',
--  get_option('bindir'),
--  pk_pkgdatadir,
--  pk_libprivdir,
--  pk_pkgsysconfdir,
--  polkitd_user,
--)
-+
-+if not libs_only
-+  meson.add_install_script(
-+    'meson_post_install.py',
-+    get_option('bindir'),
-+    pk_pkgdatadir,
-+    pk_libprivdir,
-+    pk_pkgsysconfdir,
-+    polkitd_user,
-+  )
-+endif
- 
- output = '\n        ' + meson.project_name() + ' ' + meson.project_version() + '\n'
- output += '        ============\n\n'
--- 
-GitLab


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-17 22:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-19  6:59 [gentoo-commits] repo/gentoo:master commit in: sys-auth/polkit/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-06-17 22:36 Conrad Kostecki
2022-05-16  5:10 Sam James
2022-04-23  1:00 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox