summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-bus/bus-creds.c10
-rw-r--r--src/libsystemd/sd-bus/bus-creds.h2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/bus-creds.c b/src/libsystemd/sd-bus/bus-creds.c
index 85509e8819..677e94b3ba 100644
--- a/src/libsystemd/sd-bus/bus-creds.c
+++ b/src/libsystemd/sd-bus/bus-creds.c
@@ -48,6 +48,7 @@ void bus_creds_done(sd_bus_creds *c) {
free(c->unit);
free(c->user_unit);
free(c->slice);
+ free(c->unescaped_conn_name);
strv_free(c->cmdline_array);
strv_free(c->well_known_names);
@@ -471,7 +472,14 @@ _public_ int sd_bus_creds_get_connection_name(sd_bus_creds *c, const char **ret)
return -ENODATA;
assert(c->conn_name);
- *ret = c->conn_name;
+
+ if (!c->unescaped_conn_name) {
+ c->unescaped_conn_name = sd_bus_label_unescape(c->conn_name);
+ if (!c->unescaped_conn_name)
+ return -ENOMEM;
+ }
+
+ *ret = c->unescaped_conn_name;
return 0;
}
diff --git a/src/libsystemd/sd-bus/bus-creds.h b/src/libsystemd/sd-bus/bus-creds.h
index df33d34b65..81b852a596 100644
--- a/src/libsystemd/sd-bus/bus-creds.h
+++ b/src/libsystemd/sd-bus/bus-creds.h
@@ -65,7 +65,7 @@ struct sd_bus_creds {
char *cgroup_root;
- char *conn_name;
+ char *conn_name, *unescaped_conn_name;
};
sd_bus_creds* bus_creds_new(void);