summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRepository mirror & CI <repomirrorci@gentoo.org>2022-05-16 05:17:54 +0000
committerRepository mirror & CI <repomirrorci@gentoo.org>2022-05-16 05:17:54 +0000
commita055e0eda4cb119f7b09573b0b778133e6bebb33 (patch)
treeb6e123ec33a96835038562fb91f96c2a65e8f25d
parent2022-05-16 04:47:58 UTC (diff)
parentsys-auth/polkit: restore polkit-0.118-make-netgroup-support-optional.patch (diff)
downloadgentoo-a055e0eda4cb119f7b09573b0b778133e6bebb33.tar.gz
gentoo-a055e0eda4cb119f7b09573b0b778133e6bebb33.tar.bz2
gentoo-a055e0eda4cb119f7b09573b0b778133e6bebb33.zip
Merge updates from master
-rw-r--r--app-misc/hivex/Manifest1
-rw-r--r--app-misc/hivex/hivex-1.3.21.ebuild124
-rw-r--r--sys-auth/polkit/files/polkit-0.118-make-netgroup-support-optional.patch248
3 files changed, 373 insertions, 0 deletions
diff --git a/app-misc/hivex/Manifest b/app-misc/hivex/Manifest
index 167ecfc75022..6f2fdea97f9e 100644
--- a/app-misc/hivex/Manifest
+++ b/app-misc/hivex/Manifest
@@ -1 +1,2 @@
DIST hivex-1.3.20.tar.gz 1727498 BLAKE2B db6448242fc4b72d75cc7234a49e146cb165b1b9b9e2e72fb2a05be37cbb1d8ca865ccc51c4d2d50199e69cae2d870743ecd41534290e9a100bb268c2437ee22 SHA512 366e84c2a13ff53c70036df60db6e2b469cd06e3405761df73c47978b4fa0245246a1ea912aa5852b1272221d55c6c100b40b00e4c9a6f5668d12ff7f93c787a
+DIST hivex-1.3.21.tar.gz 1729723 BLAKE2B 16c5bad3f06e1293344c39f100596a466a93eb7db1c189bd59859434d7071102e10641bb820cf791834280c2ad79dba0df4efea9b8a84d02727bfdf13f7915d1 SHA512 e893d9fa77655540d29ef6657764f701f9cddb33d11b2bfef36ce0c2caebab92b55a32b7e1c99efbab0d53f558a44bf1c4c6f6da13daa37d568ff96d7d28f842
diff --git a/app-misc/hivex/hivex-1.3.21.ebuild b/app-misc/hivex/hivex-1.3.21.ebuild
new file mode 100644
index 000000000000..753f0cbb52ba
--- /dev/null
+++ b/app-misc/hivex/hivex-1.3.21.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+USE_RUBY="ruby26 ruby27"
+RUBY_OPTIONAL=yes
+PYTHON_COMPAT=( python3_{8..10} )
+inherit perl-module ruby-ng python-single-r1 strip-linguas
+
+DESCRIPTION="Library for reading and writing Windows Registry 'hive' binary files"
+HOMEPAGE="https://libguestfs.org"
+SRC_URI="https://libguestfs.org/download/${PN}/${P}.tar.gz"
+S="${WORKDIR}/${P}"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ocaml readline +perl python test ruby"
+
+RDEPEND="
+ dev-libs/libxml2:2
+ virtual/libiconv
+ virtual/libintl
+ ocaml? (
+ dev-lang/ocaml[ocamlopt]
+ dev-ml/findlib[ocamlopt]
+ )
+ perl? (
+ dev-lang/perl:=
+ dev-perl/IO-stringy
+ )
+ python? ( ${PYTHON_DEPS} )
+ readline? ( sys-libs/readline:0 )
+ ruby? ( $(ruby_implementations_depend) )
+"
+DEPEND="${RDEPEND}
+ perl? (
+ test? (
+ dev-perl/Pod-Coverage
+ dev-perl/Test-Pod-Coverage
+ )
+ )"
+
+ruby_add_bdepend "ruby? ( dev-ruby/rake
+ virtual/rubygems
+ dev-ruby/rdoc )"
+ruby_add_rdepend "ruby? ( virtual/rubygems )"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
+ ruby? ( || ( $(ruby_get_use_targets) ) )"
+
+DOCS=( README )
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+ use ruby && ruby-ng_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ cp -prlP "${WORKDIR}/${P}" "${WORKDIR}"/all || die
+}
+
+src_prepare() {
+ default
+
+ use perl && perl-module_src_prepare
+ use ruby && ruby-ng_src_prepare
+}
+
+src_configure() {
+ use ruby && ruby-ng_src_configure
+
+ if use perl; then
+ pushd perl || die
+ perl-module_src_configure
+ popd || die
+ fi
+
+ local myeconfargs=(
+ $(use_with readline)
+ $(use_enable ocaml)
+ $(use_enable perl)
+ --enable-nls
+ --disable-ruby
+ $(use_enable python)
+ --disable-rpath
+ --disable-static
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ default
+
+ use ruby && ruby-ng_src_compile
+}
+
+src_install() {
+ strip-linguas -i po
+
+ emake install DESTDIR="${ED}" "LINGUAS=""${LINGUAS}"""
+
+ if use python; then
+ python_optimize
+ fi
+
+ if use ruby; then
+ ruby-ng_src_install
+ fi
+
+ if use perl; then
+ perl_delete_localpod
+
+ # Workaround Build.PL for now (see libguestfs too)
+ doman "${ED}"/usr/man/man3/*
+ rm -rf "${ED}"/usr/man || die
+ fi
+
+ find "${ED}" -name '*.la' -delete || die
+}
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;
+ }