diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-11-27 12:52:13 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-11-27 22:05:23 +0100 |
commit | fb6d9b77a71a5f007392b754bf7d8e06a6bed69a (patch) | |
tree | f66a206d4dc42c0fa35e1d986783e288e53ec0e3 /src/libsystemd/sd-bus/sd-bus.c | |
parent | 38ce47e262fbb76b6f6514e8e80cacfc584bee5a (diff) |
sd-bus: set creds info for "org.freedesktop.DBus.Local" generated messages, too
Diffstat (limited to 'src/libsystemd/sd-bus/sd-bus.c')
-rw-r--r-- | src/libsystemd/sd-bus/sd-bus.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index ea056d8119..8f97a582d7 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -2505,6 +2505,15 @@ null_message: return r; } +static void bus_message_set_sender_local(sd_bus *bus, sd_bus_message *m) { + assert(bus); + assert(m); + + m->sender = m->creds.unique_name = (char*) "org.freedesktop.DBus.Local"; + m->creds.well_known_names_local = true; + m->creds.mask |= (SD_BUS_CREDS_UNIQUE_NAME|SD_BUS_CREDS_WELL_KNOWN_NAMES) & bus->creds_mask; +} + static int process_closing(sd_bus *bus, sd_bus_message **ret) { _cleanup_bus_message_unref_ sd_bus_message *m = NULL; struct reply_callback *c; @@ -2573,7 +2582,7 @@ static int process_closing(sd_bus *bus, sd_bus_message **ret) { if (r < 0) return r; - m->sender = "org.freedesktop.DBus.Local"; + bus_message_set_sender_local(bus, m); r = bus_seal_synthetic_message(bus, m); if (r < 0) |