aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2009-03-30 08:17:17 +0800
committermarcus <marcus@FreeBSD.org>2009-03-30 08:17:17 +0800
commitfd92c4560c4f27da9d36c764d88c2bb1cbf86051 (patch)
treeb238973e6f564e4c4415938af4b59b3069acc635
parent2c91fa5308ba181d1f2043980c5a1d64f06ab6ed (diff)
downloadfreebsd-ports-gnome-fd92c4560c4f27da9d36c764d88c2bb1cbf86051.tar.gz
freebsd-ports-gnome-fd92c4560c4f27da9d36c764d88c2bb1cbf86051.tar.zst
freebsd-ports-gnome-fd92c4560c4f27da9d36c764d88c2bb1cbf86051.zip
* Fix a problem where waitpid() may return EINTR which causes the various
polkit helpers to report a failure. This fix allows dynamic polkit policies to actually work (e.g. mounting fixed drives with proper authorization). * Workaround a bug in our version of getline(3), and check for EOF when getline does not return -1.
-rw-r--r--sysutils/policykit/Makefile2
-rw-r--r--sysutils/policykit/files/patch-src_kit_kit-spawn.c13
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c11
3 files changed, 25 insertions, 1 deletions
diff --git a/sysutils/policykit/Makefile b/sysutils/policykit/Makefile
index b0987ea4e079..582955bada1a 100644
--- a/sysutils/policykit/Makefile
+++ b/sysutils/policykit/Makefile
@@ -8,7 +8,7 @@
PORTNAME= policykit
PORTVERSION= 0.9
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= sysutils gnome
MASTER_SITES= http://hal.freedesktop.org/releases/
DISTNAME= PolicyKit-${PORTVERSION}
diff --git a/sysutils/policykit/files/patch-src_kit_kit-spawn.c b/sysutils/policykit/files/patch-src_kit_kit-spawn.c
new file mode 100644
index 000000000000..1521a6a99f8a
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_kit_kit-spawn.c
@@ -0,0 +1,13 @@
+--- src/kit/kit-spawn.c.orig 2009-03-29 20:11:24.000000000 -0400
++++ src/kit/kit-spawn.c 2009-03-29 20:11:43.000000000 -0400
+@@ -396,7 +396,10 @@ kit_spawn_sync (const char *working_
+ }
+ }
+
++again:
+ if (waitpid (pid, out_exit_status, 0) == -1) {
++ if (errno == EINTR)
++ goto again;
+ goto out;
+ }
+ pid = -1;
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c
new file mode 100644
index 000000000000..7c22acea573a
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c
@@ -0,0 +1,11 @@
+--- src/polkit-grant/polkit-grant.c.orig 2009-03-29 20:12:16.000000000 -0400
++++ src/polkit-grant/polkit-grant.c 2009-03-29 20:13:15.000000000 -0400
+@@ -303,7 +303,7 @@ polkit_grant_io_func (PolKitGrant *polki
+ g_return_if_fail (polkit_grant != NULL);
+ g_return_if_fail (polkit_grant->helper_is_running);
+
+- while (kit_getline (&line, &line_len, polkit_grant->child_stdout_f) != -1) {
++ while (kit_getline (&line, &line_len, polkit_grant->child_stdout_f) != -1 && !feof (polkit_grant->child_stdout_f)) {
+ if (strlen (line) > 0 &&
+ line[strlen (line) - 1] == '\n')
+ line[strlen (line) - 1] = '\0';