summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorBill Randle <william.c.randle@intel.com>2016-04-11 00:29:09 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-11 22:02:03 +0100
commit2aeac77235245a1026d74e86a72dfbd593db650d (patch)
tree2ac1309d507abf971a6f60207dc66bb5be25dc0d /meta
parent9e5370d2e67b0525dd7b955a22e771520cb40861 (diff)
downloadpoky-2aeac77235245a1026d74e86a72dfbd593db650d.tar.gz
systemd: fix segfault on shutdown
This applies upstream fixes to fix a segfault in systemd-logind on shutdown. [Fixes YOCTO #9265] (From OE-Core rev: 4939402d8c67d68e20618cdfdd091bd8cc3f535a) Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/systemd/systemd/0023-backported-fixes-for-null-messages.patch101
-rw-r--r--meta/recipes-core/systemd/systemd_225.bb1
2 files changed, 102 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0023-backported-fixes-for-null-messages.patch b/meta/recipes-core/systemd/systemd/0023-backported-fixes-for-null-messages.patch
new file mode 100644
index 0000000000..b39037f8d9
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0023-backported-fixes-for-null-messages.patch
@@ -0,0 +1,101 @@
1From ce88232a1c8e914936e18edbee2551ab95fc4c1d Mon Sep 17 00:00:00 2001
2From: Bill Randle <william.c.randle@intel.com>
3Date: Mon, 21 Mar 2016 15:52:30 -0700
4Subject: [PATCH] backported fixes for null messages
5
6Apply upstream commits 5744f59a3ee883ef3a78214bd5236157acdc35ba,
72cf088b56d72cb6a3243041524f1fbae7c1cb28e and
8c7430c3d1a0c14aed631864b9da504ba1a9352c2 to fix Yocto #9265.
9
10Upstream-Status: Backport
11
12Signed-off-by: Bill Randle <william.c.randle@intel.com>
13---
14 src/login/logind-dbus.c | 31 ++++++++++++++++++-------------
15 1 file changed, 18 insertions(+), 13 deletions(-)
16
17diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
18index 5b2b36b..e433549 100644
19--- a/src/login/logind-dbus.c
20+++ b/src/login/logind-dbus.c
21@@ -1339,8 +1339,7 @@ static int bus_manager_log_shutdown(
22 InhibitWhat w,
23 const char *unit_name) {
24
25- const char *p;
26- const char *q;
27+ const char *p, *q;
28
29 assert(m);
30 assert(unit_name);
31@@ -1365,8 +1364,8 @@ static int bus_manager_log_shutdown(
32 q = NULL;
33 }
34
35- if (m->wall_message)
36- p = strjoina(p, " (", m->wall_message, ")", NULL);
37+ if (!isempty(m->wall_message))
38+ p = strjoina(p, " (", m->wall_message, ")");
39
40 return log_struct(LOG_NOTICE,
41 LOG_MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
42@@ -1797,9 +1796,11 @@ static int update_schedule_file(Manager *m) {
43 if (r < 0)
44 return log_error_errno(r, "Failed to create shutdown subdirectory: %m");
45
46- t = cescape(m->wall_message);
47- if (!t)
48- return log_oom();
49+ if (!isempty(m->wall_message)) {
50+ t = cescape(m->wall_message);
51+ if (!t)
52+ return log_oom();
53+ }
54
55 r = fopen_temporary("/run/systemd/shutdown/scheduled", &f, &temp_path);
56 if (r < 0)
57@@ -1815,7 +1816,7 @@ static int update_schedule_file(Manager *m) {
58 m->enable_wall_messages,
59 m->scheduled_shutdown_type);
60
61- if (!isempty(m->wall_message))
62+ if (t)
63 fprintf(f, "WALL_MESSAGE=%s\n", t);
64
65 r = fflush_and_check(f);
66@@ -2294,7 +2295,7 @@ static int method_set_wall_message(
67 int r;
68 Manager *m = userdata;
69 char *wall_message;
70- bool enable_wall_messages;
71+ int enable_wall_messages;
72
73 assert(message);
74 assert(m);
75@@ -2310,15 +2311,19 @@ static int method_set_wall_message(
76 UID_INVALID,
77 &m->polkit_registry,
78 error);
79-
80 if (r < 0)
81 return r;
82 if (r == 0)
83 return 1; /* Will call us back */
84
85- r = free_and_strdup(&m->wall_message, wall_message);
86- if (r < 0)
87- return log_oom();
88+ if (isempty(wall_message))
89+ m->wall_message = mfree(m->wall_message);
90+ else {
91+ r = free_and_strdup(&m->wall_message, wall_message);
92+ if (r < 0)
93+ return log_oom();
94+ }
95+
96 m->enable_wall_messages = enable_wall_messages;
97
98 return sd_bus_reply_method_return(message, NULL);
99--
1002.5.0
101
diff --git a/meta/recipes-core/systemd/systemd_225.bb b/meta/recipes-core/systemd/systemd_225.bb
index 18c2448124..7c66ba20e4 100644
--- a/meta/recipes-core/systemd/systemd_225.bb
+++ b/meta/recipes-core/systemd/systemd_225.bb
@@ -46,6 +46,7 @@ SRC_URI = "git://github.com/systemd/systemd.git;protocol=git \
46 file://init \ 46 file://init \
47 file://run-ptest \ 47 file://run-ptest \
48 file://rules-whitelist-hd-devices.patch \ 48 file://rules-whitelist-hd-devices.patch \
49 file://0023-backported-fixes-for-null-messages.patch \
49 " 50 "
50SRC_URI_append_qemuall = " file://qemuall_io_latency-core-device.c-Change-the-default-device-timeout-to-2.patch" 51SRC_URI_append_qemuall = " file://qemuall_io_latency-core-device.c-Change-the-default-device-timeout-to-2.patch"
51 52