summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-creds.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-22 16:28:58 +0100
committerLennart Poettering <lennart@poettering.net>2014-01-22 16:40:40 +0100
commitcccb0b2cdbd25e90ae92d2d5b107125cb1ca3433 (patch)
treef004ea3e54e6022bfd625b0cbdb4eb97a2a495c0 /src/libsystemd/sd-bus/bus-creds.c
parent8d1db1d154c1134c9bf92b202ef198cc79979ea8 (diff)
bus: include connection name in credentials structure
Diffstat (limited to 'src/libsystemd/sd-bus/bus-creds.c')
-rw-r--r--src/libsystemd/sd-bus/bus-creds.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/bus-creds.c b/src/libsystemd/sd-bus/bus-creds.c
index 52e55fc5e1..85509e8819 100644
--- a/src/libsystemd/sd-bus/bus-creds.c
+++ b/src/libsystemd/sd-bus/bus-creds.c
@@ -92,6 +92,7 @@ _public_ sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c) {
free(c->label);
free(c->unique_name);
free(c->cgroup_root);
+ free(c->conn_name);
free(c);
}
} else {
@@ -462,6 +463,18 @@ _public_ int sd_bus_creds_get_well_known_names(sd_bus_creds *c, char ***well_kno
return 0;
}
+_public_ int sd_bus_creds_get_connection_name(sd_bus_creds *c, const char **ret) {
+ assert_return(c, -EINVAL);
+ assert_return(ret, -EINVAL);
+
+ if (!(c->mask & SD_BUS_CREDS_CONNECTION_NAME))
+ return -ENODATA;
+
+ assert(c->conn_name);
+ *ret = c->conn_name;
+ return 0;
+}
+
static int has_cap(sd_bus_creds *c, unsigned offset, int capability) {
size_t sz;