1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00

sd-bus: when credentials of the "org.freedesktop.DBus" service are queried return the bus owner's credentials

The bus driver service is always implemented by the owner of the bus,
hence let's shortcut the credential operation and use our cached data.
This makes sure things simply work, given that dbus itself doesn't
support GetConnectionSELinuxSecurityContext() on the bus driver name
itself.

Fixes: #6120
This commit is contained in:
Lennart Poettering 2017-06-26 18:24:58 +02:00
parent f52b982cc9
commit 51c7d5aa36

View File

@ -926,6 +926,9 @@ _public_ int sd_bus_get_name_creds(
if (streq(name, "org.freedesktop.DBus.Local"))
return -EINVAL;
if (streq(name, "org.freedesktop.DBus"))
return sd_bus_get_owner_creds(bus, mask, creds);
if (!BUS_IS_OPEN(bus->state))
return -ENOTCONN;