diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-11-27 02:37:05 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-11-27 22:02:12 +0100 |
commit | ac653862e0a99505727dc8861e734d8d6f2b0afd (patch) | |
tree | d8183f49afbf9800cad1ef165c3b5fa979848303 /src/libsystemd/sd-bus/bus-creds.c | |
parent | 50c4521675e94ade38b8af9e3b0f7fd2f300b6f4 (diff) |
sd-bus: fake valid well-known-names metadata for faked bus messages
Diffstat (limited to 'src/libsystemd/sd-bus/bus-creds.c')
-rw-r--r-- | src/libsystemd/sd-bus/bus-creds.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/bus-creds.c b/src/libsystemd/sd-bus/bus-creds.c index ad0e2e1ba7..e3bdda83de 100644 --- a/src/libsystemd/sd-bus/bus-creds.c +++ b/src/libsystemd/sd-bus/bus-creds.c @@ -551,6 +551,18 @@ _public_ int sd_bus_creds_get_well_known_names(sd_bus_creds *c, char ***well_kno if (!(c->mask & SD_BUS_CREDS_WELL_KNOWN_NAMES)) return -ENODATA; + /* As a special hack we return the bus driver as well-known + * names list when this is requested. */ + if (c->well_known_names_driver) { + static const char* const wkn[] = { + "org.freedesktop.DBus", + NULL + }; + + *well_known_names = (char**) wkn; + return 0; + } + *well_known_names = c->well_known_names; return 0; } |