summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2012-03-05 08:38:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-05 10:34:36 -0800
commit9da18acb6d6db7104ba861e532031594fa4d8db3 (patch)
tree7c828d4bcc6918973ae1ee197ea3b762629d9d7d /meta
parentf8c0e6e79574a2a922ae3bd5757b02e7573c48ac (diff)
downloadpoky-9da18acb6d6db7104ba861e532031594fa4d8db3.tar.gz
polkit 0.104: add 2 backports from upstream to fix crashes during auth
(From OE-Core rev: bcb8e65ab3f7d7f0f884f05c758f8a779c260306) Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/polkit/polkit-0.104/0001-PolkitUnixSession-Set-error-if-we-cannot-find-a-sess.patch70
-rw-r--r--meta/recipes-extended/polkit/polkit-0.104/0002-PolkitUnixSession-Actually-return-TRUE-if-a-session-.patch46
-rw-r--r--meta/recipes-extended/polkit/polkit_0.104.bb4
3 files changed, 119 insertions, 1 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
new file mode 100644
index 0000000000..aaa989e78e
--- /dev/null
+++ b/meta/recipes-extended/polkit/polkit-0.104/0001-PolkitUnixSession-Set-error-if-we-cannot-find-a-sess.patch
@@ -0,0 +1,70 @@
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
diff --git a/meta/recipes-extended/polkit/polkit-0.104/0002-PolkitUnixSession-Actually-return-TRUE-if-a-session-.patch b/meta/recipes-extended/polkit/polkit-0.104/0002-PolkitUnixSession-Actually-return-TRUE-if-a-session-.patch
new file mode 100644
index 0000000000..3fdc7318d5
--- /dev/null
+++ b/meta/recipes-extended/polkit/polkit-0.104/0002-PolkitUnixSession-Actually-return-TRUE-if-a-session-.patch
@@ -0,0 +1,46 @@
1From 8fb8b406bab50c5ef8c5d4f743e3f13924bd5f73 Mon Sep 17 00:00:00 2001
2From: David Zeuthen <davidz@redhat.com>
3Date: Mon, 6 Feb 2012 11:26:06 -0500
4Subject: [PATCH 2/2] PolkitUnixSession: Actually return TRUE if a session exists
5
6Also, don't treat the integer returned by sd_session_get_uid() as a
7boolean because that's just confusing.
8
9Signed-off-by: David Zeuthen <davidz@redhat.com>
10---
11
12Upstream-status: Accepted
13
14 src/polkit/polkitunixsession-systemd.c | 12 +++++-------
15 1 files changed, 5 insertions(+), 7 deletions(-)
16
17diff --git a/src/polkit/polkitunixsession-systemd.c b/src/polkit/polkitunixsession-systemd.c
18index 94a7ee4..8a8bf65 100644
19--- a/src/polkit/polkitunixsession-systemd.c
20+++ b/src/polkit/polkitunixsession-systemd.c
21@@ -361,17 +361,15 @@ polkit_unix_session_to_string (PolkitSubject *subject)
22
23 static gboolean
24 polkit_unix_session_exists_sync (PolkitSubject *subject,
25- GCancellable *cancellable,
26- GError **error)
27+ GCancellable *cancellable,
28+ GError **error)
29 {
30 PolkitUnixSession *session = POLKIT_UNIX_SESSION (subject);
31- gboolean ret;
32+ gboolean ret = FALSE;
33 uid_t uid;
34
35- ret = FALSE;
36-
37- if (!sd_session_get_uid (session->session_id, &uid))
38- ret = FALSE;
39+ if (sd_session_get_uid (session->session_id, &uid) == 0)
40+ ret = TRUE;
41
42 return ret;
43 }
44--
451.7.2.5
46
diff --git a/meta/recipes-extended/polkit/polkit_0.104.bb b/meta/recipes-extended/polkit/polkit_0.104.bb
index 5dc82c5df6..dfbd300582 100644
--- a/meta/recipes-extended/polkit/polkit_0.104.bb
+++ b/meta/recipes-extended/polkit/polkit_0.104.bb
@@ -11,12 +11,14 @@ DEPENDS = "expat dbus-glib eggdbus intltool-native"
11PACKAGECONFIG = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" 11PACKAGECONFIG = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
12PACKAGECONFIG[pam] = "--with-authfw=pam,--with-authfw=none,libpam,libpam" 12PACKAGECONFIG[pam] = "--with-authfw=pam,--with-authfw=none,libpam,libpam"
13 13
14PR = "r3" 14PR = "r4"
15 15
16PAM_SRC_URI = "file://polkit-1_pam.patch" 16PAM_SRC_URI = "file://polkit-1_pam.patch"
17SRC_URI = "http://hal.freedesktop.org/releases/polkit-${PV}.tar.gz \ 17SRC_URI = "http://hal.freedesktop.org/releases/polkit-${PV}.tar.gz \
18 file://introspection.patch \ 18 file://introspection.patch \
19 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ 19 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
20 file://0001-PolkitUnixSession-Set-error-if-we-cannot-find-a-sess.patch \
21 file://0002-PolkitUnixSession-Actually-return-TRUE-if-a-session-.patch \
20 " 22 "
21 23
22SRC_URI[md5sum] = "e380b4c6fb1e7bccf854e92edc0a8ce1" 24SRC_URI[md5sum] = "e380b4c6fb1e7bccf854e92edc0a8ce1"