SHA256
1
0
forked from pool/systemd

- Add 5002-systemctl-explicitly-cast-the-constants-to-uint64_t.patch (bsc#1209305)

Added temporarily until it's merged in either the stable v253 branch or in the
  SUSE git repo.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1359
This commit is contained in:
Franck Bui 2023-03-16 07:35:14 +00:00 committed by Git OBS Bridge
parent 53f4c09eaa
commit a84752c1af
3 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,46 @@
From 1d88ce4c9ca16b95d6c29d107f26265ffc7d4379 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Fri, 3 Mar 2023 12:17:27 +0100
Subject: [PATCH 5002/5002] systemctl: explicitly cast the constants to
uint64_t
Otherwise under certain conditions `va_arg()` might get garbage instead
of the expected value, i.e.:
$ sudo build-o0/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 0
Failed to disable unit: Unit file asdfasfaf.service does not exist.
$ sudo build-o1/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 7954875719681572864
Failed to disable unit: Invalid argument
(reproduced on an armv7hl machine)
Resolves: #26568
Follow-up to: bf1bea43f15
Related issue: https://github.com/systemd/systemd/pull/14470#discussion_r362893735
(cherry picked from commit c63bfd0884cf20e48befbee49d41f667660a8802)
[fbui: fixes bsc#1209305]
---
src/systemctl/systemctl-enable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/systemctl/systemctl-enable.c b/src/systemctl/systemctl-enable.c
index 86d9f602fa..f94a286122 100644
--- a/src/systemctl/systemctl-enable.c
+++ b/src/systemctl/systemctl-enable.c
@@ -211,7 +211,7 @@ int verb_enable(int argc, char *argv[], void *userdata) {
if (send_runtime) {
if (streq(method, "DisableUnitFilesWithFlagsAndInstallInfo"))
- r = sd_bus_message_append(m, "t", arg_runtime ? UNIT_FILE_RUNTIME : 0);
+ r = sd_bus_message_append(m, "t", arg_runtime ? (uint64_t) UNIT_FILE_RUNTIME : UINT64_C(0));
else
r = sd_bus_message_append(m, "b", arg_runtime);
if (r < 0)
--
2.35.3

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Mar 16 07:33:21 UTC 2023 - Franck Bui <fbui@suse.com>
- Add 5002-systemctl-explicitly-cast-the-constants-to-uint64_t.patch (bsc#1209305)
Added temporarily until it's merged in either the stable v253 branch or in the
SUSE git repo.
-------------------------------------------------------------------
Thu Mar 16 07:29:24 UTC 2023 - Franck Bui <fbui@suse.com>

View File

@ -214,6 +214,7 @@ Patch12: 0009-pid1-handle-console-specificities-weirdness-for-s390.patch
# will be removed as soon as a proper fix will be merged by upstream.
Patch5000: 5000-core-manager-run-generators-directly-when-we-are-in-.patch
Patch5001: 5001-Revert-core-propagate-stop-too-if-restart-is-issued.patch
Patch5002: 5002-systemctl-explicitly-cast-the-constants-to-uint64_t.patch
%description
Systemd is a system and service manager, compatible with SysV and LSB