Update to polkit-0.114.

This commit is contained in:
ajacoutot 2018-04-07 10:55:22 +00:00
parent 53ef6dca24
commit a8026e632e
12 changed files with 45 additions and 577 deletions

View File

@ -1,71 +1,55 @@
# $OpenBSD: Makefile,v 1.68 2017/11/21 00:13:04 naddy Exp $
# $OpenBSD: Makefile,v 1.69 2018/04/07 10:55:22 ajacoutot Exp $
COMMENT= framework for granting privileged operations to users
COMMENT= framework for granting privileged operations to users
DISTNAME= polkit-0.113
REVISION= 5
DISTNAME= polkit-0.114
SHARED_LIBS += polkit-gobject-1 2.0 # .0.0
SHARED_LIBS += polkit-agent-1 2.0 # .0.0
CATEGORIES= sysutils security
CATEGORIES= sysutils security
HOMEPAGE= http://www.freedesktop.org/wiki/Software/polkit
HOMEPAGE= http://www.freedesktop.org/wiki/Software/polkit
MAINTAINER= Antoine Jacoutot <ajacoutot@openbsd.org>
MAINTAINER= Antoine Jacoutot <ajacoutot@openbsd.org>
# GPLv2+
PERMIT_PACKAGE_CDROM= Yes
WANTLIB = c expat gio-2.0 glib-2.0 gobject-2.0 iconv intl mozjs-17.0
WANTLIB += pthread
WANTLIB += ${COMPILER_LIBCXX} c expat gio-2.0 glib-2.0 gobject-2.0
WANTLIB += intl mozjs-52
MASTER_SITES= http://www.freedesktop.org/software/polkit/releases/
MASTER_SITES= http://www.freedesktop.org/software/polkit/releases/
MODULES= lang/python \
textproc/intltool
MODULES= lang/python \
textproc/intltool
# man pages
BUILD_DEPENDS+= textproc/docbook-xsl
BUILD_DEPENDS+= textproc/docbook-xsl
LIB_DEPENDS= devel/glib2 \
devel/mozjs17
LIB_DEPENDS= devel/glib2 \
devel/spidermonkey52
# /usr/local/share/dbus-1/system-services/
RUN_DEPENDS += x11/dbus,-suid
RUN_DEPENDS += x11/dbus,-suid
CONFIGURE_STYLE= gnu
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= --disable-libsystemd-login \
--mandir=${PREFIX}/man \
--enable-introspection \
--enable-man-pages \
--enable-examples \
--with-os-type=openbsd \
--with-authfw=bsdauth \
--with-polkitd-user=_polkitd
CONFIGURE_STYLE= gnu
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= --disable-libelogind \
--disable-libsystemd-login \
--with-os-type=openbsd \
--with-authfw=bsdauth \
--with-polkitd-user=_polkitd
# fgetgrent, fgetpwent
CONFIGURE_ARGS += --disable-test
CONFIGURE_ARGS += --disable-test
MODPY_BUILDDEP= No
MODPY_RUNDEP= No
USE_GMAKE= Yes
FAKE_FLAGS= sysconfdir=${PREFIX}/share/examples/polkit
### Remove when updating to a newer release with integrated bsd_auth(3) support.
AUTOCONF_VERSION=2.69
AUTOMAKE_VERSION=1.11
BUILD_DEPENDS +=${MODGNU_AUTOMAKE_DEPENDS} \
${MODGNU_AUTOCONF_DEPENDS} \
devel/gettext \
devel/gobject-introspection
# AUTOCONF needs AM_PROG_LIBTOOL
BUILD_DEPENDS+= devel/libtool
###
MODPY_BUILDDEP= No
MODPY_RUNDEP= No
USE_GMAKE= Yes
FAKE_FLAGS= sysconfdir=${PREFIX}/share/examples/polkit
pre-configure:
perl -pi \
@ -84,9 +68,4 @@ pre-configure:
${WRKSRC}/docs/extensiondir.xml \
${WRKSRC}/src/examples/org.freedesktop.policykit.examples.pkexec.policy.in
cd ${WRKSRC} && \
AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \
AUTOCONF_VERSION=${AUTOCONF_VERSION} \
${LOCALBASE}/bin/autoreconf
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (polkit-0.113.tar.gz) = 4cCVCTxlSVH3j4YY1Cf6+Rz2Kr3v7ZjeQP9l7KZBPIE=
SIZE (polkit-0.113.tar.gz) = 1448865
SHA256 (polkit-0.114.tar.gz) = vfQAc2fXWP15TeJJWXXBFZhNIGJn5S0easXO6nfo7eY=
SIZE (polkit-0.114.tar.gz) = 1557340

View File

@ -1,71 +0,0 @@
$OpenBSD: patch-configure_ac,v 1.17 2015/07/20 20:16:59 ajacoutot Exp $
GTK_DOC_CHECK chunk:
Remove when updating to a newer release with integrated bsd_auth(3) support.
From 074df27827fd773f1c76545cd08da568440ca41f Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@gnome.org>
Date: Sun, 19 Jul 2015 02:19:08 +0200
Subject: Add support for OpenBSD
--- configure.ac.orig Fri Jun 19 22:31:02 2015
+++ configure.ac Sun Jul 19 02:18:31 2015
@@ -46,7 +46,7 @@ AC_PATH_PROG([XSLTPROC], [xsltproc])
fi
AM_CONDITIONAL(MAN_PAGES_ENABLED, test x$enable_man_pages = xyes)
-GTK_DOC_CHECK([1.3])
+dnl GTK_DOC_CHECK([1.3])
#### gcc warning flags
@@ -167,11 +167,15 @@ fi
dnl ---------------------------------------------------------------------------
dnl - Check whether setnetgrent has a return value
dnl ---------------------------------------------------------------------------
+AC_CHECK_HEADERS([netgroup.h])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- #include <stddef.h>
- #include <netdb.h>
-]], [[
- int r = setnetgrent (NULL);]])],
+ #include <stddef.h>
+ #ifdef HAVE_NETGROUP_H
+ #include <netgroup.h>
+ #else
+ #include <netdb.h>
+ #endif
+]], [[int r = setnetgrent (NULL);]])],
[AC_DEFINE([HAVE_SETNETGRENT_RETURN], 1, [Define to 1 if setnetgrent has return value])])
dnl ---------------------------------------------------------------------------
@@ -318,6 +322,11 @@ case $POLKIT_AUTHFW in
AC_DEFINE(POLKIT_AUTHFW_SHADOW, 1, [If using the Shadow authentication framework])
;;
+ bsdauth)
+ need_pam=no
+ AC_DEFINE(POLKIT_AUTHFW_BSDAUTH, 1, [If using the bsd_auth(3) authentication framework])
+ ;;
+
*)
AC_MSG_ERROR([Unknown Authentication Framework: $POLKIT_AUTHFW])
;;
@@ -326,6 +335,7 @@ esac
AM_CONDITIONAL(POLKIT_AUTHFW_NONE, [test x$POLKIT_AUTHFW = xnone], [Using no authfw])
AM_CONDITIONAL(POLKIT_AUTHFW_PAM, [test x$POLKIT_AUTHFW = xpam], [Using PAM authfw])
AM_CONDITIONAL(POLKIT_AUTHFW_SHADOW, [test x$POLKIT_AUTHFW = xshadow], [Using Shadow authfw])
+AM_CONDITIONAL(POLKIT_AUTHFW_BSDAUTH, [test x$POLKIT_AUTHFW = xbsdauth], [Using bsd_auth(3) authfw])
dnl ---------------------------------------------------------------------------
@@ -504,6 +514,9 @@ case "$host_os" in
;;
*freebsd*)
AC_DEFINE([HAVE_FREEBSD], 1, [Is this a FreeBSD system?])
+ ;;
+ *openbsd*)
+ AC_DEFINE([HAVE_OPENBSD], 1, [Is this an OpenBSD system?])
;;
esac

View File

@ -1,18 +0,0 @@
$OpenBSD: patch-docs_polkit_Makefile_am,v 1.8 2014/03/26 14:56:23 ajacoutot Exp $
Remove when updating to a newer release with integrated bsd_auth(3) support.
--- docs/polkit/Makefile.am.orig Wed Mar 26 15:38:54 2014
+++ docs/polkit/Makefile.am Wed Mar 26 15:39:16 2014
@@ -80,11 +80,7 @@ HTML_IMAGES = \
# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS=
-if ENABLE_GTK_DOC
-include $(top_srcdir)/gtk-doc.make
-else
CLEANFILES =
-endif
CLEANFILES += *~ \
polkit-1-scan.* \

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-src_polkit_polkitpermission_c,v 1.1 2017/04/16 15:37:41 ajacoutot Exp $
From dfd2c165447029c32510842350e924ef5ac3f679 Mon Sep 17 00:00:00 2001
From: Rui Matos <tiagomatos@gmail.com>
Date: Thu, 2 Mar 2017 14:50:31 +0100
Subject: [PATCH] polkitpermission: Fix a memory leak on authority changes
--- src/polkit/polkitpermission.c.orig Sat Jun 6 01:24:06 2015
+++ src/polkit/polkitpermission.c Sun Apr 16 17:30:52 2017
@@ -454,6 +454,7 @@ changed_check_cb (GObject *source_object,
if (result != NULL)
{
process_result (permission, result);
+ g_object_unref (result);
}
else
{

View File

@ -1,108 +0,0 @@
$OpenBSD: patch-src_polkit_polkitunixprocess_c,v 1.9 2015/07/20 20:16:59 ajacoutot Exp $
From 074df27827fd773f1c76545cd08da568440ca41f Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@gnome.org>
Date: Sun, 19 Jul 2015 02:19:08 +0200
Subject: Add support for OpenBSD
--- src/polkit/polkitunixprocess.c.orig Tue Jan 14 23:42:25 2014
+++ src/polkit/polkitunixprocess.c Sun Jul 19 02:14:03 2015
@@ -29,6 +29,9 @@
#include <sys/sysctl.h>
#include <sys/user.h>
#endif
+#ifdef HAVE_OPENBSD
+#include <sys/sysctl.h>
+#endif
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -86,7 +89,7 @@ static guint64 get_start_time_for_pid (gint pid,
static gint _polkit_unix_process_get_owner (PolkitUnixProcess *process,
GError **error);
-#ifdef HAVE_FREEBSD
+#if defined(HAVE_FREEBSD) || defined(HAVE_OPENBSD)
static gboolean get_kinfo_proc (gint pid, struct kinfo_proc *p);
#endif
@@ -554,12 +557,36 @@ get_kinfo_proc (pid_t pid, struct kinfo_proc *p)
}
#endif
+#ifdef HAVE_OPENBSD
+static gboolean
+get_kinfo_proc (gint pid, struct kinfo_proc *p)
+{
+ int name[6];
+ u_int namelen;
+ size_t sz;
+
+ sz = sizeof(*p);
+ namelen = 0;
+ name[namelen++] = CTL_KERN;
+ name[namelen++] = KERN_PROC;
+ name[namelen++] = KERN_PROC_PID;
+ name[namelen++] = pid;
+ name[namelen++] = sz;
+ name[namelen++] = 1;
+
+ if (sysctl (name, namelen, p, &sz, NULL, 0) == -1)
+ 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(HAVE_OPENBSD)
gchar *filename;
gchar *contents;
size_t length;
@@ -647,7 +674,11 @@ get_start_time_for_pid (pid_t pid,
goto out;
}
+#ifdef HAVE_FREEBSD
start_time = (guint64) p.ki_start.tv_sec;
+#else
+ start_time = (guint64) p.p_ustart_sec;
+#endif
out:
#endif
@@ -662,7 +693,7 @@ _polkit_unix_process_get_owner (PolkitUnixProcess *pr
gint result;
gchar *contents;
gchar **lines;
-#ifdef HAVE_FREEBSD
+#if defined(HAVE_FREEBSD) || defined(HAVE_OPENBSD)
struct kinfo_proc p;
#else
gchar filename[64];
@@ -676,7 +707,7 @@ _polkit_unix_process_get_owner (PolkitUnixProcess *pr
lines = NULL;
contents = NULL;
-#ifdef HAVE_FREEBSD
+#if defined(HAVE_FREEBSD) || defined(HAVE_OPENBSD)
if (get_kinfo_proc (process->pid, &p) == 0)
{
g_set_error (error,
@@ -688,7 +719,11 @@ _polkit_unix_process_get_owner (PolkitUnixProcess *pr
goto out;
}
+#if defined(HAVE_FREEBSD)
result = p.ki_uid;
+#else
+ result = p.p_uid;
+#endif
#else
/* see 'man proc' for layout of the status file

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-src_polkitagent_Makefile_am,v 1.6 2015/07/20 20:16:59 ajacoutot Exp $
From 074df27827fd773f1c76545cd08da568440ca41f Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@gnome.org>
Date: Sun, 19 Jul 2015 02:19:08 +0200
Subject: Add support for OpenBSD
--- src/polkitagent/Makefile.am.orig Mon Jun 4 19:47:39 2012
+++ src/polkitagent/Makefile.am Fri Aug 17 09:23:26 2012
@@ -91,6 +91,9 @@ endif
if POLKIT_AUTHFW_SHADOW
polkit_agent_helper_1_SOURCES += polkitagenthelper-shadow.c
endif
+if POLKIT_AUTHFW_BSDAUTH
+polkit_agent_helper_1_SOURCES += polkitagenthelper-bsdauth.c
+endif
polkit_agent_helper_1_CFLAGS = \
-D_POLKIT_COMPILATION \

View File

@ -1,173 +0,0 @@
$OpenBSD: patch-src_polkitagent_polkitagenthelper-bsdauth_c,v 1.8 2015/07/20 20:16:59 ajacoutot Exp $
From 074df27827fd773f1c76545cd08da568440ca41f Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@gnome.org>
Date: Sun, 19 Jul 2015 02:19:08 +0200
Subject: Add support for OpenBSD
--- src/polkitagent/polkitagenthelper-bsdauth.c.orig Fri Jul 3 08:35:33 2015
+++ src/polkitagent/polkitagenthelper-bsdauth.c Fri Jul 3 08:37:24 2015
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2009-2010 Andrew Psaltis <ampsaltis@gmail.com>
+ * Copyright (C) 2010 Antoine Jacoutot <ajacoutot@openbsd.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Authors: Andrew Psaltis <ampsaltis@gmail.com>, based on
+ * polkitagenthelper.c which was written by
+ * David Zeuthen <davidz@redhat.com>
+ */
+
+#include "config.h"
+#include "polkitagenthelperprivate.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <syslog.h>
+#include <pwd.h>
+#include <login_cap.h>
+#include <bsd_auth.h>
+
+#include <polkit/polkit.h>
+
+static gboolean bsdauth_authenticate (const char *user_to_auth);
+
+int
+main (int argc, char *argv[])
+{
+ struct passwd *pw;
+ const char *user_to_auth;
+ char *cookie;
+
+ /* clear the entire environment to avoid attacks with
+ libraries honoring environment variables */
+ if (_polkit_clearenv () != 0)
+ goto error;
+
+ /* set a minimal environment */
+ setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+
+ /* check that we are setuid root */
+ if (geteuid () != 0)
+ {
+ fprintf (stderr, "polkit-agent-helper-1: needs to be setuid root\n");
+ goto error;
+ }
+
+ openlog ("polkit-agent-helper-1", LOG_CONS | LOG_PID, LOG_AUTHPRIV);
+
+ /* check for correct invocation */
+ if (!(argc == 2 || argc == 3))
+ {
+ syslog (LOG_NOTICE, "inappropriate use of helper, wrong number of arguments [uid=%d]", getuid ());
+ fprintf (stderr, "polkit-agent-helper-1: wrong number of arguments. This incident has been logged.\n");
+ goto error;
+ }
+
+ if (getuid () != 0)
+ {
+ /* check we're running with a non-tty stdin */
+ if (isatty (STDIN_FILENO) != 0)
+ {
+ syslog (LOG_NOTICE, "inappropriate use of helper, stdin is a tty [uid=%d]", getuid ());
+ fprintf (stderr, "polkit-agent-helper-1: inappropriate use of helper, stdin is a tty. This incident has been logged.\n");
+ goto error;
+ }
+ }
+
+ user_to_auth = argv[1];
+ cookie = read_cookie (argc, argv);
+ if (!cookie)
+ goto error;
+
+#ifdef PAH_DEBUG
+ fprintf (stderr, "polkit-agent-helper-1: user to auth is '%s'.\n", user_to_auth);
+#endif /* PAH_DEBUG */
+
+ /* Search the password database for the user requesting authentication */
+ if ((pw = getpwnam (user_to_auth)) == NULL)
+ {
+ syslog (LOG_NOTICE, "password database information request for user %s [uid=%d] failed", user_to_auth, getuid());
+ fprintf(stderr, "polkit-agent-helper-1: could not get user information for '%s'", user_to_auth);
+ goto error;
+ }
+
+ /* Check the user's identity */
+ if (!bsdauth_authenticate (user_to_auth))
+ {
+ syslog (LOG_NOTICE, "authentication failure [uid=%d] trying to authenticate '%s'", getuid (), user_to_auth);
+ fprintf (stderr, "polkit-agent-helper-1: authentication failure. This incident has been logged.\n");
+ goto error;
+ }
+
+#ifdef PAH_DEBUG
+ fprintf (stderr, "polkit-agent-helper-1: sending D-Bus message to polkit daemon\n");
+#endif /* PAH_DEBUG */
+
+ /* now send a D-Bus message to the polkit daemon that
+ * includes a) the cookie; and b) the user we authenticated
+ */
+ if (!send_dbus_message (cookie, user_to_auth))
+ {
+#ifdef PAH_DEBUG
+ fprintf (stderr, "polkit-agent-helper-1: error sending D-Bus message to polkit daemon\n");
+#endif /* PAH_DEBUG */
+ goto error;
+ }
+
+ free (cookie);
+
+#ifdef PAH_DEBUG
+ fprintf (stderr, "polkit-agent-helper-1: successfully sent D-Bus message to polkit daemon\n");
+#endif /* PAH_DEBUG */
+
+ fprintf (stdout, "SUCCESS\n");
+ flush_and_wait ();
+ return 0;
+
+error:
+ free (cookie);
+ fprintf (stdout, "FAILURE\n");
+ flush_and_wait ();
+ return 1;
+}
+
+static gboolean
+bsdauth_authenticate (const char *user_to_auth)
+{
+ char passwd[512];
+
+ fprintf (stdout, "PAM_PROMPT_ECHO_OFF password:\n");
+ fflush (stdout);
+ usleep (10 * 1000); /* since fflush(3) seems buggy */
+
+ if (fgets (passwd, sizeof (passwd), stdin) == NULL)
+ goto error;
+
+ if (strlen (passwd) > 0 && passwd[strlen (passwd) - 1] == '\n')
+ passwd[strlen (passwd) - 1] = '\0';
+
+ if (auth_userokay((char *)user_to_auth, NULL, "auth-polkit", passwd) == 0)
+ goto error;
+ return 1;
+error:
+ return 0;
+}

View File

@ -1,33 +0,0 @@
$OpenBSD: patch-src_polkitbackend_polkitbackendauthority_c,v 1.1 2017/04/16 15:37:41 ajacoutot Exp $
commit af4566e1a7e9031b9a05f49c7d27bf379d822016
Author: Miloslav Trmač <mitr@redhat.com>
Date: Thu Feb 9 19:53:54 2017 +0100
Fix a memory leak per agent authentication
--- src/polkitbackend/polkitbackendauthority.c.orig Sun Apr 16 17:34:05 2017
+++ src/polkitbackend/polkitbackendauthority.c Sun Apr 16 17:34:10 2017
@@ -1007,6 +1007,7 @@ server_handle_unregister_authentication_agent (Server
g_dbus_method_invocation_return_value (invocation, g_variant_new ("()"));
out:
+ g_variant_unref (subject_gvariant);
if (subject != NULL)
g_object_unref (subject);
}
@@ -1057,6 +1058,7 @@ server_handle_authentication_agent_response (Server
g_dbus_method_invocation_return_value (invocation, g_variant_new ("()"));
out:
+ g_variant_unref (identity_gvariant);
if (identity != NULL)
g_object_unref (identity);
}
@@ -1107,6 +1109,7 @@ server_handle_authentication_agent_response2 (Server
g_dbus_method_invocation_return_value (invocation, g_variant_new ("()"));
out:
+ g_variant_unref (identity_gvariant);
if (identity != NULL)
g_object_unref (identity);
}

View File

@ -1,65 +0,0 @@
$OpenBSD: patch-src_polkitbackend_polkitbackendinteractiveauthority_c,v 1.7 2017/04/16 15:37:41 ajacoutot Exp $
From 074df27827fd773f1c76545cd08da568440ca41f Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@gnome.org>
Date: Sun, 19 Jul 2015 02:19:08 +0200
Subject: Add support for OpenBSD
commit 7ecf29a9db86f7161e2ff48e7bb8ea46a90f954f
Author: Miloslav Trma\xc4\x8d <mitr@redhat.com>
Date: Wed Feb 8 22:57:21 2017 +0100
Fix a memory leak in server_handle_authentication_agent_response{,2}
--- src/polkitbackend/polkitbackendinteractiveauthority.c.orig Fri Jun 19 22:39:58 2015
+++ src/polkitbackend/polkitbackendinteractiveauthority.c Sun Apr 16 17:31:32 2017
@@ -23,7 +23,11 @@
#include <errno.h>
#include <pwd.h>
#include <grp.h>
+#ifdef HAVE_NETGROUP_H
+#include <netgroup.h>
+#else
#include <netdb.h>
+#endif
#include <string.h>
#include <glib/gstdio.h>
#include <locale.h>
@@ -1903,15 +1907,15 @@ authentication_agent_begin_cb (GDBusProxy *proxy,
AuthenticationSession *session = user_data;
gboolean gained_authorization;
gboolean was_dismissed;
+ GVariant *result;
GError *error;
was_dismissed = FALSE;
gained_authorization = FALSE;
error = NULL;
- if (!g_dbus_proxy_call_finish (proxy,
- res,
- &error))
+ result = g_dbus_proxy_call_finish (proxy, res, &error);
+ if (result == NULL)
{
g_printerr ("Error performing authentication: %s (%s %d)\n",
error->message,
@@ -1923,6 +1927,7 @@ authentication_agent_begin_cb (GDBusProxy *proxy,
}
else
{
+ g_variant_unref (result);
gained_authorization = session->is_authenticated;
g_debug ("Authentication complete, is_authenticated = %d", session->is_authenticated);
}
@@ -2236,7 +2241,11 @@ get_users_in_net_group (PolkitIdentity
for (;;)
{
+#if defined HAVE_OPENBSD
+ const char *hostname, *username, *domainname;
+#else
char *hostname, *username, *domainname;
+#endif
PolkitIdentity *user;
GError *error = NULL;

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-src_polkitbackend_polkitbackendjsauthority_c,v 1.11 2015/07/20 20:16:59 ajacoutot Exp $
From 074df27827fd773f1c76545cd08da568440ca41f Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@gnome.org>
Date: Sun, 19 Jul 2015 02:19:08 +0200
Subject: Add support for OpenBSD
--- src/polkitbackend/polkitbackendjsauthority.c.orig Fri Jun 19 22:39:58 2015
+++ src/polkitbackend/polkitbackendjsauthority.c Fri Jul 3 07:31:00 2015
@@ -24,7 +24,11 @@
#include <errno.h>
#include <pwd.h>
#include <grp.h>
+#ifdef HAVE_NETGROUP_H
+#include <netgroup.h>
+#else
#include <netdb.h>
+#endif
#include <string.h>
#include <glib/gstdio.h>
#include <locale.h>

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.15 2013/09/22 18:35:58 ajacoutot Exp $
@comment $OpenBSD: PLIST,v 1.16 2018/04/07 10:55:22 ajacoutot Exp $
@comment Error switching to user _polkitd: Error changing to home directory /nonexistent
@newgroup _polkitd:701
@newuser _polkitd:701:_polkitd:daemon:Polkit Daemon User:/var/empty:/sbin/nologin
@ -84,11 +84,25 @@ share/examples/polkit/polkit-1/rules.d/
@owner
share/examples/polkit/polkit-1/rules.d/50-default.rules
@sample ${SYSCONFDIR}/polkit-1/rules.d/50-default.rules
share/gettext/its/polkit.its
share/gettext/its/polkit.loc
share/gir-1.0/
share/gir-1.0/Polkit-1.0.gir
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/
share/polkit-1/actions/
share/polkit-1/actions/org.freedesktop.policykit.examples.pkexec.policy