diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-11-28 17:03:35 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-11-28 20:29:43 +0100 |
commit | 224b3787679a7dc57732d29c5b0cbec7b14e0c10 (patch) | |
tree | e70d9e929e700c1bad5c856c32b745b2a53f0554 /src/libsystemd | |
parent | 5b820358cf2a5cb6d67cc0b1faaaca3b0171f1ac (diff) |
sd-bus: make more connection properties readable
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-bus/sd-bus.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index 6b35036c06..ff01d608c5 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -3432,3 +3432,47 @@ _public_ int sd_bus_get_address(sd_bus *bus, const char **address) { return -ENODATA; } + +int sd_bus_get_creds_mask(sd_bus *bus, uint64_t *mask) { + assert_return(bus, -EINVAL); + assert_return(mask, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + + *mask = bus->creds_mask; + return 0; +} + +int sd_bus_is_bus_client(sd_bus *bus) { + assert_return(bus, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + + return bus->bus_client; +} + +int sd_bus_is_server(sd_bus *bus) { + assert_return(bus, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + + return bus->is_server; +} + +int sd_bus_is_anonymous(sd_bus *bus) { + assert_return(bus, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + + return bus->anonymous_auth; +} + +int sd_bus_is_trusted(sd_bus *bus) { + assert_return(bus, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + + return bus->trusted; +} + +int sd_bus_is_monitor(sd_bus *bus) { + assert_return(bus, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + + return !!(bus->hello_flags & KDBUS_HELLO_MONITOR); +} |