summaryrefslogtreecommitdiff
path: root/src/bus-proxyd
diff options
context:
space:
mode:
Diffstat (limited to 'src/bus-proxyd')
-rw-r--r--src/bus-proxyd/bus-proxyd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index 1bd7feed7a..6fd722e5e1 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -875,7 +875,7 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m) {
} else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "RequestName")) {
const char *name;
- uint32_t flags;
+ uint32_t flags, param;
r = sd_bus_message_read(m, "su", &name, &flags);
if (r < 0)
@@ -886,7 +886,15 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m) {
if ((flags & ~(BUS_NAME_ALLOW_REPLACEMENT|BUS_NAME_REPLACE_EXISTING|BUS_NAME_DO_NOT_QUEUE)) != 0)
return synthetic_reply_method_errno(m, -EINVAL, NULL);
- r = sd_bus_request_name(a, name, flags);
+ param = 0;
+ if (flags & BUS_NAME_ALLOW_REPLACEMENT)
+ param |= SD_BUS_NAME_ALLOW_REPLACEMENT;
+ if (flags & BUS_NAME_REPLACE_EXISTING)
+ param |= SD_BUS_NAME_REPLACE_EXISTING;
+ if (!(flags & BUS_NAME_DO_NOT_QUEUE))
+ param |= SD_BUS_NAME_QUEUE;
+
+ r = sd_bus_request_name(a, name, param);
if (r < 0) {
if (r == -EEXIST)
return synthetic_reply_method_return(m, "u", BUS_NAME_EXISTS);