systemd/backport-dbus-util-let-s-take-it-down-a-notch-when-converting.patch
wangyuhang a4f95d3244 sync patch from systemd community
(cherry picked from commit 88369f234ec01b60fb047caf87b90ef10a92b0db)
2023-10-10 10:04:24 +08:00

46 lines
1.7 KiB
Diff

From 0d8dd903ff55c9aba7322005c374522387cf2713 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Thu, 1 Jun 2023 20:22:20 +0200
Subject: [PATCH] dbus-util: let's take it down a notch when converting file
mode to string
I'm definitely a fan of precision, but in this case it's a bit too much:
$ systemd-run --unit=test --socket-property=ListenFIFO=/tmp/foo --socket-property=SocketMode=0644 true
$ systemctl cat test.socket
# /run/systemd/transient/test.socket
# This is a transient unit file, created programmatically via the systemd API. Do not edit.
[Unit]
Description=/usr/bin/true
[Socket]
ListenFIFO=/tmp/foo
SocketMode=0000000000000000000000000000000000000644
(cherry picked from commit b86ed7f710b89b7a7e36da158c1bb8c69ffed144)
(cherry picked from commit 47edca1731788fc53249b95d28c66d88a85b4165)
(cherry picked from commit f566389f239addd529824e3d7b5bd9ad184b1590)
Conflict:NA
Reference:https://github.com/systemd/systemd-stable/commit/0d8dd903ff55c9aba7322005c374522387cf2713
---
src/core/dbus-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/dbus-util.c b/src/core/dbus-util.c
index 32a2ec0ff9..c253f44c35 100644
--- a/src/core/dbus-util.c
+++ b/src/core/dbus-util.c
@@ -30,7 +30,7 @@ int bus_property_get_triggered_unit(
return sd_bus_message_append(reply, "s", trigger ? trigger->id : NULL);
}
-BUS_DEFINE_SET_TRANSIENT(mode_t, "u", uint32_t, mode_t, "%040o");
+BUS_DEFINE_SET_TRANSIENT(mode_t, "u", uint32_t, mode_t, "%04o");
BUS_DEFINE_SET_TRANSIENT(unsigned, "u", uint32_t, unsigned, "%" PRIu32);
static inline bool valid_user_group_name_or_id_relaxed(const char *u) {
--
2.33.0