summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/polkit/polkit-0.104/0001-PolkitUnixSession-Set-error-if-we-cannot-find-a-sess.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/polkit/polkit-0.104/0001-PolkitUnixSession-Set-error-if-we-cannot-find-a-sess.patch')
-rw-r--r--meta/recipes-extended/polkit/polkit-0.104/0001-PolkitUnixSession-Set-error-if-we-cannot-find-a-sess.patch70
1 files changed, 0 insertions, 70 deletions
diff --git a/meta/recipes-extended/polkit/polkit-0.104/0001-PolkitUnixSession-Set-error-if-we-cannot-find-a-sess.patch b/meta/recipes-extended/polkit/polkit-0.104/0001-PolkitUnixSession-Set-error-if-we-cannot-find-a-sess.patch
deleted file mode 100644
index c021bfb96f..0000000000
--- a/meta/recipes-extended/polkit/polkit-0.104/0001-PolkitUnixSession-Set-error-if-we-cannot-find-a-sess.patch
+++ /dev/null
@@ -1,70 +0,0 @@
1From c46d2d13eac240d2a609b2dd8fc617ea18a78bfa Mon Sep 17 00:00:00 2001
2From: David Zeuthen <davidz@redhat.com>
3Date: Mon, 6 Feb 2012 11:24:53 -0500
4Subject: [PATCH 1/2] PolkitUnixSession: Set error if we cannot find a session for the given pid
5
6Also, don't treat the integer returned by sd_pid_get_session() as a
7boolean because that's just confusing. Also, don't confuse memory
8supposed to be freed by g_free() and free(3) with each other. See
9
10 https://bugzilla.redhat.com/show_bug.cgi?id=787222
11
12for more details.
13
14Signed-off-by: David Zeuthen <davidz@redhat.com>
15---
16
17Upstream-Status: Accepted
18
19 src/polkit/polkitunixsession-systemd.c | 21 ++++++++++++++++-----
20 1 files changed, 16 insertions(+), 5 deletions(-)
21
22diff --git a/src/polkit/polkitunixsession-systemd.c b/src/polkit/polkitunixsession-systemd.c
23index e7e913f..94a7ee4 100644
24--- a/src/polkit/polkitunixsession-systemd.c
25+++ b/src/polkit/polkitunixsession-systemd.c
26@@ -23,6 +23,7 @@
27 # include "config.h"
28 #endif
29
30+#include <stdlib.h>
31 #include <string.h>
32 #include "polkitunixsession.h"
33 #include "polkitsubject.h"
34@@ -450,9 +451,8 @@ polkit_unix_session_initable_init (GInitable *initable,
35 GError **error)
36 {
37 PolkitUnixSession *session = POLKIT_UNIX_SESSION (initable);
38- gboolean ret;
39-
40- ret = FALSE;
41+ gboolean ret = FALSE;
42+ char *s;
43
44 if (session->session_id != NULL)
45 {
46@@ -461,8 +461,19 @@ polkit_unix_session_initable_init (GInitable *initable,
47 goto out;
48 }
49
50- if (!sd_pid_get_session (session->pid, &session->session_id))
51- ret = TRUE;
52+ if (sd_pid_get_session (session->pid, &s) == 0)
53+ {
54+ session->session_id = g_strdup (s);
55+ free (s);
56+ ret = TRUE;
57+ goto out;
58+ }
59+
60+ g_set_error (error,
61+ POLKIT_ERROR,
62+ POLKIT_ERROR_FAILED,
63+ "No session for pid %d",
64+ (gint) session->pid);
65
66 out:
67 return ret;
68--
691.7.2.5
70