summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-08 23:47:19 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-08 23:52:27 +0100
commit0aa72be6a02e8bbcb364526b8e1904a94b81a547 (patch)
tree335e74927fcd5e71daf0d8a5c9378b6c2989da1e /src/libsystemd/sd-bus
parent4e7dff9b099bfbf7e367e339f5ddcd387caf78ae (diff)
bus-proxy: fix compat with autostarted services
Diffstat (limited to 'src/libsystemd/sd-bus')
-rw-r--r--src/libsystemd/sd-bus/bus-control.c7
-rw-r--r--src/libsystemd/sd-bus/bus-control.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
index a9a0c1ec19..6a9e9b296a 100644
--- a/src/libsystemd/sd-bus/bus-control.c
+++ b/src/libsystemd/sd-bus/bus-control.c
@@ -600,10 +600,11 @@ static int bus_populate_creds_from_items(
return 0;
}
-static int bus_get_name_creds_kdbus(
+int bus_get_name_creds_kdbus(
sd_bus *bus,
const char *name,
uint64_t mask,
+ bool allow_activator,
sd_bus_creds **creds) {
_cleanup_bus_creds_unref_ sd_bus_creds *c = NULL;
@@ -652,7 +653,7 @@ static int bus_get_name_creds_kdbus(
conn_info = (struct kdbus_info *) ((uint8_t *) bus->kdbus_buffer + cmd->offset);
/* Non-activated names are considered not available */
- if (conn_info->flags & KDBUS_HELLO_ACTIVATOR) {
+ if (!allow_activator && (conn_info->flags & KDBUS_HELLO_ACTIVATOR)) {
if (name[0] == ':')
r = -ENXIO;
else
@@ -875,7 +876,7 @@ _public_ int sd_bus_get_name_creds(
return -ENOTCONN;
if (bus->is_kernel)
- return bus_get_name_creds_kdbus(bus, name, mask, creds);
+ return bus_get_name_creds_kdbus(bus, name, mask, false, creds);
else
return bus_get_name_creds_dbus1(bus, name, mask, creds);
}
diff --git a/src/libsystemd/sd-bus/bus-control.h b/src/libsystemd/sd-bus/bus-control.h
index aa290edac7..5009ca8e61 100644
--- a/src/libsystemd/sd-bus/bus-control.h
+++ b/src/libsystemd/sd-bus/bus-control.h
@@ -29,3 +29,5 @@ int bus_remove_match_internal(sd_bus *bus, const char *match, uint64_t cookie);
int bus_add_match_internal_kernel(sd_bus *bus, struct bus_match_component *components, unsigned n_components, uint64_t cookie);
int bus_remove_match_internal_kernel(sd_bus *bus, uint64_t cookie);
+
+int bus_get_name_creds_kdbus(sd_bus *bus, const char *name, uint64_t mask, bool allow_activator, sd_bus_creds **creds);