summaryrefslogtreecommitdiff
path: root/src/shared/cgroup-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-05-03 19:02:24 +0200
committerLennart Poettering <lennart@poettering.net>2013-05-03 19:06:06 +0200
commita0ab566574303be1ca12cdb334f284cfd407caa5 (patch)
tree3d3d2abf68e2d8472a3511971021715dfc294f90 /src/shared/cgroup-util.c
parent4641a16b15a0e50b61259316b3fda43e0b48f7d5 (diff)
cgroup: when escaping a cgroup object name, also escape names that start with a dot
Diffstat (limited to 'src/shared/cgroup-util.c')
-rw-r--r--src/shared/cgroup-util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c
index c5a5f8df83..43c415d760 100644
--- a/src/shared/cgroup-util.c
+++ b/src/shared/cgroup-util.c
@@ -1527,7 +1527,12 @@ char *cg_escape(const char *p) {
/* The return value of this function (unlike cg_unescape())
* needs free()! */
- if (p[0] == '_' || streq(p, "notify_on_release") || streq(p, "release_agent") || streq(p, "tasks"))
+ if (p[0] == 0 ||
+ p[0] == '_' ||
+ p[0] == '.' ||
+ streq(p, "notify_on_release") ||
+ streq(p, "release_agent") ||
+ streq(p, "tasks"))
need_prefix = true;
else {
const char *dot;