cgroup: when escaping a cgroup object name, also escape names that start with a dot

This commit is contained in:
Lennart Poettering
2013-05-03 19:06:06 +02:00
parent 4641a16b15
commit a0ab566574
2 changed files with 10 additions and 1 deletions
+6 -1
View File
@@ -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;