From: Lennart Poettering Date: Mon, 26 Jun 2017 16:24:58 +0000 (+0200) Subject: sd-bus: when credentials of the "org.freedesktop.DBus" service are queried return... X-Git-Tag: chiark/234.4-1+devuan1.1+iwj1~93 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=a9b6e5b5d6a83f2ec8c85b0896cdbdc505d51617 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 --- diff --git a/src/libelogind/sd-bus/bus-control.c b/src/libelogind/sd-bus/bus-control.c index 609904940..4fd1d79cc 100644 --- a/src/libelogind/sd-bus/bus-control.c +++ b/src/libelogind/sd-bus/bus-control.c @@ -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;