diff options
-rw-r--r-- | meta/recipes-core/systemd/systemd/0023-backported-fixes-for-null-messages.patch | 101 | ||||
-rw-r--r-- | meta/recipes-core/systemd/systemd_225.bb | 1 |
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 @@ | |||
1 | From ce88232a1c8e914936e18edbee2551ab95fc4c1d Mon Sep 17 00:00:00 2001 | ||
2 | From: Bill Randle <william.c.randle@intel.com> | ||
3 | Date: Mon, 21 Mar 2016 15:52:30 -0700 | ||
4 | Subject: [PATCH] backported fixes for null messages | ||
5 | |||
6 | Apply upstream commits 5744f59a3ee883ef3a78214bd5236157acdc35ba, | ||
7 | 2cf088b56d72cb6a3243041524f1fbae7c1cb28e and | ||
8 | c7430c3d1a0c14aed631864b9da504ba1a9352c2 to fix Yocto #9265. | ||
9 | |||
10 | Upstream-Status: Backport | ||
11 | |||
12 | Signed-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 | |||
17 | diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c | ||
18 | index 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 | -- | ||
100 | 2.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 | " |
50 | SRC_URI_append_qemuall = " file://qemuall_io_latency-core-device.c-Change-the-default-device-timeout-to-2.patch" | 51 | SRC_URI_append_qemuall = " file://qemuall_io_latency-core-device.c-Change-the-default-device-timeout-to-2.patch" |
51 | 52 | ||