summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-bus')
-rw-r--r--src/libsystemd-bus/bus-message.c10
-rw-r--r--src/libsystemd-bus/bus-message.h2
-rw-r--r--src/libsystemd-bus/sd-bus.c2
3 files changed, 13 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index b0f4b16d41..39a85d58f7 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -5524,3 +5524,13 @@ int bus_message_remarshal(sd_bus *bus, sd_bus_message **m) {
return 0;
}
+
+int bus_message_append_sender(sd_bus_message *m, const char *sender) {
+ assert(m);
+ assert(sender);
+
+ assert_return(!m->sealed, -EPERM);
+ assert_return(!m->sender, -EPERM);
+
+ return message_append_field_string(m, BUS_MESSAGE_HEADER_SENDER, SD_BUS_TYPE_STRING, sender, &m->sender);
+}
diff --git a/src/libsystemd-bus/bus-message.h b/src/libsystemd-bus/bus-message.h
index cd1fb0e546..589c819c73 100644
--- a/src/libsystemd-bus/bus-message.h
+++ b/src/libsystemd-bus/bus-message.h
@@ -234,3 +234,5 @@ int bus_message_to_errno(sd_bus_message *m);
int bus_message_new_synthetic_error(sd_bus *bus, uint64_t serial, const sd_bus_error *e, sd_bus_message **m);
int bus_message_remarshal(sd_bus *bus, sd_bus_message **m);
+
+int bus_message_append_sender(sd_bus_message *m, const char *sender);
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index 5ea27ee7ef..ee62b3487e 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -374,7 +374,7 @@ static int bus_send_hello(sd_bus *bus) {
r = sd_bus_message_new_method_call(
bus,
"org.freedesktop.DBus",
- "/",
+ "/org/freedesktop/DBus",
"org.freedesktop.DBus",
"Hello",
&m);