summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2018-04-29 05:14:36 +0000
committerwiz <wiz@pkgsrc.org>2018-04-29 05:14:36 +0000
commite1989ab99d16d2ba26db895cc0b8a49f11226f83 (patch)
tree845ff1e2c1d96d1d16ff1bbf124c5ce44178ceac
parentde3cf34ec989a3c15485d5d00f130fb34a220d27 (diff)
downloadpkgsrc-e1989ab99d16d2ba26db895cc0b8a49f11226f83.tar.gz
polkit: update to 0.114.
-------------- polkit 0.114 -------------- WARNING WARNING WARNING: This is a prerelease on the road to polkit 1.0. Public API might change and certain parts of the code still needs some security review. Use at your own risk. This is polkit 0.114. Highlights: Port to mozjs 52, the latest version of the firefox JavaScript engine. Add gettext support for policy files Fixes for various memory leaks Build requirements glib, gobject, gio >= 2.32 mozjs-52 gobject-introspection >= 0.6.2 (optional) pam (optional) ConsoleKit OR systemd Changes since polkit 0.113: Anders Jonsson (2): pkcheck: fix man typos Add Swedish translation Antoine Jacoutot (1): Add support for OpenBSD Christian Kirbach (1): Add German translation Colin Walters (3): build: Pull in GCC warning infra from ostree build: Use AC_USE_SYSTEM_EXTENSIONS tests: Correct boundary test for overflow Dariusz Gadomski (2): Fix multi-line pam text info. Refactor send_to_helper usage Gabor Kelemen (1): Add initial Hungarian translation, and add hu to LINGUAS Jeremy Linton (5): change mozjs interface module to c++ Switch to hard requiring mozjs24 Fix warnings caused by building with C++ Replace autocompartment test: Add a test case to handle actions without explicit rules Jiří Klimeš (1): trivial: fix deprecated indication for polkit_agent_register_listener() Matthias Clasen (1): Add gettext support for .policy files Miloslav Trmač (21): Post-release version bump to 0.114 Consistently use HAVE_NETGROUP_H instead of HAVE_OPENBSD Fix a memory leak of PolkitAgentListener's Server object Remove polkitbackendconfigsource.[ch] Add Slovak translation by Dusan Kazik <prescott66@gmail.com> Add Indonesian translation by Andika Triwidada Add Chinese (Taiwan) translation Fix a typo in polkit(8) Simplify GVariant reference counting Fix a memory leak on an error path of lookup_asv (twice) Fix a memory leak in server_handle_register_authentication_agent_with_options Fix a memory leak in server_handle_unregister_authentication_agent Fix a memory leak in server_handle_authentication_agent_response{,2} Fix memory leaks in server_handle_*_temporary_authorizations Fix error handling in polkit_authority_enumerate_temporary_authorizations_finish Fix a memory leak per agent authentication Fix a memory leak on agent authentication cancellation Audit and fix GVariant reference counting Fix help for (pkttyagent -s) Fix a race condition when terminating runaway_killer_thread Move to current GLib Mingye Wang (Arthur2e5) (1): Add zh_CN translation Muhammet Kara (1): Added Turkish translation OBATA Akio (1): Add support for NetBSD Peter Hutterer (1): gettext: switch to default-translate "no" Philip Withnall (3): polkit: Add g_autoptr() support for GObject-derived polkit types data: Set GIO_USE_VFS=local in the environment polkitbackend: Fix typos in a couple of initialisation error messages Piotr Drąg (1): Add Polish translation Rafael Fontenelle (1): Add Brazilian Portuguese translation Ray Strode (34): configure: bump mozjs requirement to 52 jsauthority: fix how classes are defined jsauthority: use JS_FN instead of JS_FS jsauthority: get rid of JSRuntime jsauthority: change how setVersion is called jsauthority: call JS_Init jsauthority: call JS_InitSelfHostedCode jsauthority: change how JIT is disabled jsauthority: JS::SetWarningReporter instead of JS_SetErrorReporter jsauthority: add UTF8 suffix to renamed functions jsauthority: pass "%s" format string to report functions jsauthority: s/JSBool/bool/ jsauthority: s/jsval/JS::Value/ jsauthority: s/JSVAL_NULL/JS::NullValue()/ jsauthority: s/JSVAL_VOID/JS::UndefinedValue()/ jsauthority: s/OBJECT_TO_JSVAL/JS::ObjectValue/ jsauthority: s/STRING_TO_JSVAL/JS::StringValue/ jsauthority: s/BOOLEAN_TO_JSVAL/JS::BooleanValue/ jsauthority: JSVAL_TO_OBJECT (o) to o.toObjectOrNull() jsauthority: JSVAL_TO_STRING (s) to s.toString() jsauthority: JSVAL_IS_STRING (s) to s.isString() jsauthority: JSVAL_IS_NULL (o) to o.isNull() jsauthority: Fix up JS_CallFunctionName invocations jsauthority: use InterruptCallback api instead of OperationCallback jsauthority: redo how global objects are set up jsauthority: root some locals to the context jsauthority: adapt arguments for new JS::Compile API jsauthority: adapt arguments for new JS_ExecuteScript API jsauthority: use JS::Evaluate instead of JS_EvaluateScript jsauthority: fix up set_property methods jsauthority: stop using JS_GetStringCharsZ jsauthority: switch from JS_ConvertArguments to JS::CallArgsFromVp jsauthority: re-enable JIT Port JavaScript authority to mozjs52 Rui Matos (1): polkitpermission: Fix a memory leak on authority changes Sebastien Bacher (1): Support polkit session agent running outside user session Stef Walter (2): polkitagent: Fix access after dereference on hashtable polkitagent: No double warnings in polkit_agent_listener_register() Sven Eden (1): configure: enable elogind support in PolicyKit Yuri Chornoivan (1): Add Ukrainian translation enkore (1): Fix abnomal formatting of authentication header lines muzena (1): Add hr.po Thanks to our contributors. Colin Walters and Miloslav Trmač, April 2, 2017
-rw-r--r--security/polkit/Makefile12
-rw-r--r--security/polkit/PLIST18
-rw-r--r--security/polkit/distinfo18
-rw-r--r--security/polkit/options.mk3
-rw-r--r--security/polkit/patches/patch-src_polkit_polkitunixprocess.c215
-rw-r--r--security/polkit/patches/patch-src_polkitbackend_polkitbackendinteractiveauthority.c15
-rw-r--r--security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c107
-rw-r--r--security/polkit/patches/patch-src_polkitbackend_polkitd.c12
-rw-r--r--security/polkit/patches/patch-src_programs_pkttyagent.c8
9 files changed, 50 insertions, 358 deletions
diff --git a/security/polkit/Makefile b/security/polkit/Makefile
index cd631724366..e761b223b49 100644
--- a/security/polkit/Makefile
+++ b/security/polkit/Makefile
@@ -1,8 +1,6 @@
-# $NetBSD: Makefile,v 1.8 2017/10/15 23:19:12 prlw1 Exp $
-#
+# $NetBSD: Makefile,v 1.9 2018/04/29 05:14:36 wiz Exp $
-DISTNAME= polkit-0.113
-PKGREVISION= 3
+DISTNAME= polkit-0.114
CATEGORIES= security
MASTER_SITES= http://www.freedesktop.org/software/polkit/releases/
@@ -15,6 +13,7 @@ BUILD_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt
BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl
GNU_CONFIGURE= yes
+USE_LANGUAGES= c c++11
USE_LIBTOOL= yes
USE_PKGLOCALEDIR= yes
USE_TOOLS+= pkg-config intltool gmake msgfmt perl
@@ -25,6 +24,7 @@ PKGCONFIG_OVERRIDE+= data/polkit-agent-1.pc.in
CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
CONFIGURE_ARGS+= --with-polkitd-user=${POLKITD_USER}
CONFIGURE_ARGS+= --disable-libsystemd-login
+CONFIGURE_ARGS+= --disable-libelogind
.include "../../mk/bsd.prefs.mk"
@@ -37,6 +37,8 @@ PKG_HOME.${POLKITD_USER}= ${VARBASE}
PKG_GROUPS_VARS+= POLKITD_GROUP
PKG_USERS_VARS+= POLKITD_USER
+BUILD_DEFS+= VARBASE
+
REPLACE_PERL+= src/polkitbackend/toarray.pl
INSTALL_MAKE_FLAGS+= sysconfdir=${PREFIX}/share/examples/polkit
@@ -62,7 +64,7 @@ SUBST_FILES.paths+= docs/man/pkexec.xml
SUBST_FILES.paths+= src/examples/org.freedesktop.policykit.examples.pkexec.policy.in
SUBST_SED.paths+= -e 's,/usr/bin/,${PREFIX}/bin/,g'
-.include "../../lang/spidermonkey17/buildlink3.mk"
+.include "../../lang/spidermonkey52/buildlink3.mk"
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../devel/glib2/buildlink3.mk"
.include "../../textproc/expat/buildlink3.mk"
diff --git a/security/polkit/PLIST b/security/polkit/PLIST
index 2145e5cb4df..9aa71bc7d34 100644
--- a/security/polkit/PLIST
+++ b/security/polkit/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.1 2016/05/20 18:39:33 youri Exp $
+@comment $NetBSD: PLIST,v 1.2 2018/04/29 05:14:36 wiz Exp $
bin/pk-example-frobnicate
bin/pkaction
bin/pkcheck
@@ -47,12 +47,26 @@ man/man1/pkttyagent.1
man/man8/polkit.8
man/man8/polkitd.8
share/dbus-1/system-services/org.freedesktop.PolicyKit1.service
-${PLIST.pam}share/examples/pam.d/polkit-1
share/examples/polkit/dbus-1/system.d/org.freedesktop.PolicyKit1.conf
+${PLIST.pam}share/examples/pam.d/polkit-1
share/examples/polkit/polkit-1/rules.d/50-default.rules
+share/gettext/its/polkit.its
+share/gettext/its/polkit.loc
${PLIST.introspection}share/gir-1.0/Polkit-1.0.gir
${PLIST.introspection}share/gir-1.0/PolkitAgent-1.0.gir
share/locale/cs/LC_MESSAGES/polkit-1.mo
share/locale/da/LC_MESSAGES/polkit-1.mo
+share/locale/de/LC_MESSAGES/polkit-1.mo
+share/locale/hr/LC_MESSAGES/polkit-1.mo
+share/locale/hu/LC_MESSAGES/polkit-1.mo
+share/locale/id/LC_MESSAGES/polkit-1.mo
+share/locale/pl/LC_MESSAGES/polkit-1.mo
+share/locale/pt_BR/LC_MESSAGES/polkit-1.mo
+share/locale/sk/LC_MESSAGES/polkit-1.mo
+share/locale/sv/LC_MESSAGES/polkit-1.mo
+share/locale/tr/LC_MESSAGES/polkit-1.mo
+share/locale/uk/LC_MESSAGES/polkit-1.mo
+share/locale/zh_CN/LC_MESSAGES/polkit-1.mo
+share/locale/zh_TW/LC_MESSAGES/polkit-1.mo
share/polkit-1/actions/org.freedesktop.policykit.examples.pkexec.policy
share/polkit-1/actions/org.freedesktop.policykit.policy
diff --git a/security/polkit/distinfo b/security/polkit/distinfo
index 3836bd66e63..9a6d9d9922d 100644
--- a/security/polkit/distinfo
+++ b/security/polkit/distinfo
@@ -1,15 +1,13 @@
-$NetBSD: distinfo,v 1.4 2016/12/03 01:58:49 marino Exp $
+$NetBSD: distinfo,v 1.5 2018/04/29 05:14:36 wiz Exp $
-SHA1 (polkit-0.113.tar.gz) = ef855c2d04184dceb38e0940dc7bec9cc3da415c
-RMD160 (polkit-0.113.tar.gz) = 661b0a678f7c770c213404db3af604935fdb25bc
-SHA512 (polkit-0.113.tar.gz) = ab177c89a20eeb2978ddbe28afb205d3619f9c5defe833eb68a85e71a0f2c905367f1295cbbfb85da5eafdd661bce474d5d84aca9195cd425a18c9b4170eb5f9
-Size (polkit-0.113.tar.gz) = 1448865 bytes
-SHA1 (patch-src_polkit_polkitunixprocess.c) = dbfdfd441b211c80183ea5c63a20252c58a594b2
-SHA1 (patch-src_polkitbackend_polkitbackendinteractiveauthority.c) = d8b7cbcd0db26969bc4b83c32a731ae920c2e87b
-SHA1 (patch-src_polkitbackend_polkitbackendjsauthority.c) = f0771b27e192ed199c65ed7514962ec5a8cb28a4
-SHA1 (patch-src_polkitbackend_polkitd.c) = a567b31131f63f92f8e2967c3aabfa7f3d41f627
+SHA1 (polkit-0.114.tar.gz) = f29deef0076e76588f209a028a3e33ef70c2d9cd
+RMD160 (polkit-0.114.tar.gz) = 000749a5f902b9be347f462d486bed20f8bbe8d5
+SHA512 (polkit-0.114.tar.gz) = 49cdf9dd3663714b1c6569ad8740cb413d9c5bd5c11e4bdbba3ce82b744f36638b652547edff9203caab9287834bc68a1d6a4895ec7a188fa1524dc1e9c9b4ea
+Size (polkit-0.114.tar.gz) = 1557340 bytes
+SHA1 (patch-src_polkitbackend_polkitbackendinteractiveauthority.c) = dd91b4e74e6c39f24e0f5a9b3150fdac12899cb5
+SHA1 (patch-src_polkitbackend_polkitd.c) = b8e11b40e2b171d4f030eb4c4cbc6fdc7a96b2c2
SHA1 (patch-src_programs_pkexec.c) = bfc0414c7a943c8e8b8412566a2519198eab8abd
-SHA1 (patch-src_programs_pkttyagent.c) = 72a1c3750e6b496b981eb5479201946da80b6d15
+SHA1 (patch-src_programs_pkttyagent.c) = 4dbffd02c7e66910d4104a75d6f5f437bd51acc9
SHA1 (patch-test_mocklib_src_netdb.c) = 0fe71068a6261d5e2c8874f2b4507e7e3c002526
SHA1 (patch-test_mocklibc_src_grp.c) = 435ff94fd4c7f5511d74d03839fad453dd841633
SHA1 (patch-test_mocklibc_src_pwd.c) = c65b02209db1bd1d531444026822fcca73d5027a
diff --git a/security/polkit/options.mk b/security/polkit/options.mk
index e38310cadcb..0b0ad0a1aff 100644
--- a/security/polkit/options.mk
+++ b/security/polkit/options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.2 2016/06/13 23:06:46 youri Exp $
+# $NetBSD: options.mk,v 1.3 2018/04/29 05:14:36 wiz Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.polkit
PKG_SUPPORTED_OPTIONS= introspection pam
@@ -22,7 +22,6 @@ CONFIGURE_ARGS+= --disable-introspection
CONFIGURE_ARGS+= --with-authfw=pam
CONFIGURE_ARGS+= --with-pam-module-dir=${PREFIX}/lib/security
PLIST.pam= yes
-.include "../../mk/bsd.prefs.mk"
. if ${OPSYS} == "NetBSD"
CONFIGURE_ARGS+= --with-pam-include=system
. endif
diff --git a/security/polkit/patches/patch-src_polkit_polkitunixprocess.c b/security/polkit/patches/patch-src_polkit_polkitunixprocess.c
deleted file mode 100644
index 0e56e68b7f0..00000000000
--- a/security/polkit/patches/patch-src_polkit_polkitunixprocess.c
+++ /dev/null
@@ -1,215 +0,0 @@
-$NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.2 2016/06/18 12:16:23 youri Exp $
-
-* NetBSD support
-* SunOS support
-
---- src/polkit/polkitunixprocess.c.orig 2014-01-14 22:42:25.000000000 +0000
-+++ src/polkit/polkitunixprocess.c
-@@ -29,10 +29,19 @@
- #include <sys/sysctl.h>
- #include <sys/user.h>
- #endif
-+#ifdef __NetBSD__
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#endif
- #include <stdlib.h>
- #include <string.h>
- #include <errno.h>
- #include <stdio.h>
-+#include <fcntl.h>
-+
-+#ifdef HAVE_SOLARIS
-+#include <procfs.h>
-+#endif
-
- #include "polkitunixprocess.h"
- #include "polkitsubject.h"
-@@ -80,7 +89,7 @@ enum
-
- static void subject_iface_init (PolkitSubjectIface *subject_iface);
-
--static guint64 get_start_time_for_pid (gint pid,
-+static guint64 get_start_time_for_pid (pid_t pid,
- GError **error);
-
- static gint _polkit_unix_process_get_owner (PolkitUnixProcess *process,
-@@ -89,6 +98,9 @@ static gint _polkit_unix_process_get_own
- #ifdef HAVE_FREEBSD
- static gboolean get_kinfo_proc (gint pid, struct kinfo_proc *p);
- #endif
-+#if defined(__NetBSD__)
-+static gboolean get_kinfo_proc (gint pid, struct kinfo_proc2 *p);
-+#endif
-
- G_DEFINE_TYPE_WITH_CODE (PolkitUnixProcess, polkit_unix_process, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (POLKIT_TYPE_SUBJECT, subject_iface_init)
-@@ -514,17 +526,17 @@ subject_iface_init (PolkitSubjectIface *
-
- #ifdef HAVE_SOLARIS
- static int
--get_pid_psinfo (pid_t pid, struct psinfo *ps)
-+get_pid_psinfo (pid_t pid, psinfo_t *ps)
- {
- char pname[32];
- int procfd;
-
-- (void) snprintf(pname, sizeof(pname), "/proc/%d/psinfo", pid);
-+ (void) snprintf(pname, sizeof(pname), "/proc/%lu/psinfo", pid);
- if ((procfd = open(pname, O_RDONLY)) == -1)
- {
- return -1;
- }
-- if (read(procfd, ps, sizeof(struct psinfo)) < 0)
-+ if (read(procfd, ps, sizeof(psinfo_t)) < 0)
- {
- (void) close(procfd);
- return -1;
-@@ -554,12 +566,38 @@ get_kinfo_proc (pid_t pid, struct kinfo_
- }
- #endif
-
-+#ifdef __NetBSD__
-+static gboolean
-+get_kinfo_proc (pid_t pid, struct kinfo_proc2 *p)
-+{
-+ int name[6];
-+ u_int namelen;
-+ size_t sz;
-+
-+ sz = sizeof(*p);
-+ namelen = 0;
-+ name[namelen++] = CTL_KERN;
-+ name[namelen++] = KERN_PROC2;
-+ name[namelen++] = KERN_PROC_PID;
-+ name[namelen++] = pid;
-+ name[namelen++] = sz;
-+ name[namelen++] = 1;
-+
-+ if (sysctl (name, namelen, p, &sz, NULL, 0) == -1) {
-+ perror("sysctl kern.proc2.pid");
-+ return FALSE;
-+ }
-+
-+ return TRUE;
-+}
-+#endif
-+
- static guint64
- get_start_time_for_pid (pid_t pid,
- GError **error)
- {
- guint64 start_time;
--#ifndef HAVE_FREEBSD
-+#if !defined(HAVE_FREEBSD) || !defined(__NetBSD__)
- gchar *filename;
- gchar *contents;
- size_t length;
-@@ -571,7 +609,7 @@ get_start_time_for_pid (pid_t pid,
- start_time = 0;
- contents = NULL;
-
-- filename = g_strdup_printf ("/proc/%d/stat", pid);
-+ filename = g_strdup_printf ("/proc/%lu/stat", pid);
-
- if (!g_file_get_contents (filename, &contents, &length, error))
- goto out;
-@@ -631,8 +669,8 @@ get_start_time_for_pid (pid_t pid,
- out:
- g_free (filename);
- g_free (contents);
--#else
-- struct kinfo_proc p;
-+#elif defined(__NetBSD__)
-+ struct kinfo_proc2 p;
-
- start_time = 0;
-
-@@ -647,9 +685,43 @@ get_start_time_for_pid (pid_t pid,
- goto out;
- }
-
-+ start_time = (guint64) p.p_ustart_sec;
-+
-+out:
-+
-+#elif HAVE_FREEBSD
-+ struct kinfo_proc p;
-+
-+ if (! get_kinfo_proc (pid, &p))
-+ {
-+ g_set_error (error,
-+ POLKIT_ERROR,
-+ POLKIT_ERROR_FAILED,
-+ "Error obtaining start time for %d (%s)",
-+ (gint) pid,
-+ g_strerror (errno));
-+ goto out;
-+ }
-+
- start_time = (guint64) p.ki_start.tv_sec;
-
- out:
-+#elif HAVE_SOLARIS
-+ psinfo_t p;
-+ if (!get_pid_psinfo (pid, &p))
-+ {
-+ g_set_error (error,
-+ POLKIT_ERROR,
-+ POLKIT_ERROR_FAILED,
-+ "Error obtaining start time for %d (%s)",
-+ (gint) pid,
-+ g_strerror (errno));
-+ goto out;
-+ }
-+ start_time = (guint64) p.pr_start.tv_sec;
-+out:
-+#else
-+#warning Your system is not supported
- #endif
-
- return start_time;
-@@ -664,6 +736,10 @@ _polkit_unix_process_get_owner (PolkitUn
- gchar **lines;
- #ifdef HAVE_FREEBSD
- struct kinfo_proc p;
-+#elif defined(__NetBSD__)
-+ struct kinfo_proc2 p;
-+#elif HAVE_SOLARIS
-+ psinfo_t p;
- #else
- gchar filename[64];
- guint n;
-@@ -676,7 +752,7 @@ _polkit_unix_process_get_owner (PolkitUn
- lines = NULL;
- contents = NULL;
-
--#ifdef HAVE_FREEBSD
-+#if defined(HAVE_FREEBSD) || defined(__NetBSD__)
- if (get_kinfo_proc (process->pid, &p) == 0)
- {
- g_set_error (error,
-@@ -688,7 +764,23 @@ _polkit_unix_process_get_owner (PolkitUn
- goto out;
- }
-
-+#ifdef __NetBSD__
-+ result = p.p_uid;
-+#else
- result = p.ki_uid;
-+#endif
-+#elif HAVE_SOLARIS
-+ if (!get_pid_psinfo (process->pid, &p))
-+ {
-+ g_set_error (error,
-+ POLKIT_ERROR,
-+ POLKIT_ERROR_FAILED,
-+ "get_pid_psinfo() failed for pid %d: %s",
-+ process->pid,
-+ g_strerror (errno));
-+ goto out;
-+ }
-+ result = p.pr_uid;
- #else
-
- /* see 'man proc' for layout of the status file
diff --git a/security/polkit/patches/patch-src_polkitbackend_polkitbackendinteractiveauthority.c b/security/polkit/patches/patch-src_polkitbackend_polkitbackendinteractiveauthority.c
index 4b6700fd932..9dd2632a2f0 100644
--- a/security/polkit/patches/patch-src_polkitbackend_polkitbackendinteractiveauthority.c
+++ b/security/polkit/patches/patch-src_polkitbackend_polkitbackendinteractiveauthority.c
@@ -1,23 +1,24 @@
-$NetBSD: patch-src_polkitbackend_polkitbackendinteractiveauthority.c,v 1.1 2016/05/20 18:39:33 youri Exp $
+$NetBSD: patch-src_polkitbackend_polkitbackendinteractiveauthority.c,v 1.2 2018/04/29 05:14:36 wiz Exp $
* for *BSD netgroup functions
---- src/polkitbackend/polkitbackendinteractiveauthority.c.orig 2015-06-19 20:39:58.000000000 +0000
+--- src/polkitbackend/polkitbackendinteractiveauthority.c.orig 2018-04-03 18:16:04.000000000 +0000
+++ src/polkitbackend/polkitbackendinteractiveauthority.c
-@@ -23,7 +23,12 @@
- #include <errno.h>
- #include <pwd.h>
- #include <grp.h>
+@@ -26,8 +26,13 @@
+ #ifdef HAVE_NETGROUP_H
+ #include <netgroup.h>
+ #else
+#if defined(__NetBSD__)
+#include <netgroup.h>
+#define BSD_NETGROUP
+#else
#include <netdb.h>
+ #endif
+#endif
#include <string.h>
#include <glib/gstdio.h>
#include <locale.h>
-@@ -2224,7 +2229,7 @@ get_users_in_net_group (PolkitIdentity
+@@ -2228,7 +2233,7 @@ get_users_in_net_group (PolkitIdentity
ret = NULL;
name = polkit_unix_netgroup_get_name (POLKIT_UNIX_NETGROUP (group));
diff --git a/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c b/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c
deleted file mode 100644
index 182149778c4..00000000000
--- a/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c
+++ /dev/null
@@ -1,107 +0,0 @@
-$NetBSD: patch-src_polkitbackend_polkitbackendjsauthority.c,v 1.2 2016/06/18 12:16:23 youri Exp $
-
-* for *BSD netgroup functions
-* for no SIGPOLL
-* Fix a memory leak
-* Add getgrouplist for SunOS
-
---- src/polkitbackend/polkitbackendjsauthority.c.orig 2015-06-19 20:39:58.000000000 +0000
-+++ src/polkitbackend/polkitbackendjsauthority.c
-@@ -24,7 +24,12 @@
- #include <errno.h>
- #include <pwd.h>
- #include <grp.h>
-+#if defined(__NetBSD__)
-+#include <netgroup.h>
-+#define BSD_NETENT
-+#else
- #include <netdb.h>
-+#endif
- #include <string.h>
- #include <glib/gstdio.h>
- #include <locale.h>
-@@ -812,7 +817,7 @@ subject_to_jsval (PolkitBackendJsAuthori
- if (passwd == NULL)
- {
- user_name = g_strdup_printf ("%d", (gint) uid);
-- g_warning ("Error looking up info for uid %d: %m", (gint) uid);
-+ g_warning ("Error looking up info for uid %d: %s", (gint) uid, g_strerror(errno));
- }
- else
- {
-@@ -826,7 +831,7 @@ subject_to_jsval (PolkitBackendJsAuthori
- gids,
- &num_gids) < 0)
- {
-- g_warning ("Error looking up groups for uid %d: %m", (gint) uid);
-+ g_warning ("Error looking up groups for uid %d: %s", (gint) uid, g_strerror(errno));
- }
- else
- {
-@@ -1508,8 +1513,13 @@ js_polkit_user_is_in_netgroup (JSContext
- JSBool ret = JS_FALSE;
- JSString *user_str;
- JSString *netgroup_str;
-+#ifdef BSD_NETENT
-+ const char *user;
-+ const char *netgroup;
-+#else
- char *user;
- char *netgroup;
-+#endif
- JSBool is_in_netgroup = JS_FALSE;
-
- if (!JS_ConvertArguments (cx, argc, JS_ARGV (cx, vp), "SS", &user_str, &netgroup_str))
-@@ -1913,3 +1923,52 @@ utils_spawn_finish (GAsyncResult *res,
- out:
- return ret;
- }
-+
-+#ifdef __sun__
-+#include <string.h>
-+int
-+getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt)
-+{
-+ const struct group *grp;
-+ int i, maxgroups, ngroups, ret;
-+
-+ ret = 0;
-+ ngroups = 0;
-+ maxgroups = *grpcnt;
-+ /*
-+ * When installing primary group, duplicate it;
-+ * the first element of groups is the effective gid
-+ * and will be overwritten when a setgid file is executed.
-+ */
-+ groups ? groups[ngroups++] = agroup : ngroups++;
-+ if (maxgroups > 1)
-+ groups ? groups[ngroups++] = agroup : ngroups++;
-+ /*
-+ * Scan the group file to find additional groups.
-+ */
-+ setgrent();
-+ while ((grp = getgrent()) != NULL) {
-+ if (groups) {
-+ for (i = 0; i < ngroups; i++) {
-+ if (grp->gr_gid == groups[i])
-+ goto skip;
-+ }
-+ }
-+ for (i = 0; grp->gr_mem[i]; i++) {
-+ if (!strcmp(grp->gr_mem[i], uname)) {
-+ if (ngroups >= maxgroups) {
-+ ret = -1;
-+ break;
-+ }
-+ groups ? groups[ngroups++] = grp->gr_gid : ngroups++;
-+ break;
-+ }
-+ }
-+skip:
-+ ;
-+ }
-+ endgrent();
-+ *grpcnt = ngroups;
-+ return (ret);
-+}
-+#endif
diff --git a/security/polkit/patches/patch-src_polkitbackend_polkitd.c b/security/polkit/patches/patch-src_polkitbackend_polkitd.c
index 390e664eeff..c88823e60f1 100644
--- a/security/polkit/patches/patch-src_polkitbackend_polkitd.c
+++ b/security/polkit/patches/patch-src_polkitbackend_polkitd.c
@@ -1,18 +1,18 @@
-$NetBSD: patch-src_polkitbackend_polkitd.c,v 1.1 2016/05/20 18:39:33 youri Exp $
+$NetBSD: patch-src_polkitbackend_polkitd.c,v 1.2 2018/04/29 05:14:37 wiz Exp $
Avoid %m usage in printf.
---- src/polkitbackend/polkitd.c.orig 2015-06-18 20:20:50.000000000 +0000
+--- src/polkitbackend/polkitd.c.orig 2018-04-03 18:16:17.000000000 +0000
+++ src/polkitbackend/polkitd.c
@@ -22,6 +22,7 @@
#include "config.h"
#include <signal.h>
+#include <errno.h>
+ #include <stdlib.h>
#include <glib-unix.h>
-
-@@ -109,20 +110,20 @@ become_user (const gchar *user,
+@@ -110,20 +111,20 @@ become_user (const gchar *user,
if (pw == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
@@ -36,7 +36,7 @@ Avoid %m usage in printf.
goto out;
}
-@@ -132,16 +133,16 @@ become_user (const gchar *user,
+@@ -133,16 +134,16 @@ become_user (const gchar *user,
(getegid () != pw->pw_gid) || (getgid () != pw->pw_gid))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
@@ -57,7 +57,7 @@ Avoid %m usage in printf.
goto out;
}
-@@ -196,7 +197,7 @@ main (int argc,
+@@ -198,7 +199,7 @@ main (int argc,
}
else
{
diff --git a/security/polkit/patches/patch-src_programs_pkttyagent.c b/security/polkit/patches/patch-src_programs_pkttyagent.c
index 28f6c39fde0..623b560e4b1 100644
--- a/security/polkit/patches/patch-src_programs_pkttyagent.c
+++ b/security/polkit/patches/patch-src_programs_pkttyagent.c
@@ -1,18 +1,18 @@
-$NetBSD: patch-src_programs_pkttyagent.c,v 1.1 2016/05/20 18:39:33 youri Exp $
+$NetBSD: patch-src_programs_pkttyagent.c,v 1.2 2018/04/29 05:14:37 wiz Exp $
Avoid %m usage in printf.
---- src/programs/pkttyagent.c.orig 2015-06-18 20:20:50.000000000 +0000
+--- src/programs/pkttyagent.c.orig 2018-04-03 18:16:17.000000000 +0000
+++ src/programs/pkttyagent.c
@@ -24,6 +24,7 @@
#endif
#include <stdio.h>
+#include <errno.h>
+ #include <stdlib.h>
#include <glib/gi18n.h>
#include <polkit/polkit.h>
- #define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE
-@@ -204,7 +205,7 @@ main (int argc, char *argv[])
+@@ -206,7 +207,7 @@ main (int argc, char *argv[])
{
if (close (opt_notify_fd) != 0)
{