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
+4
View File
@@ -146,11 +146,15 @@ static void test_escape_one(const char *s, const char *r) {
static void test_escape(void) {
test_escape_one("foobar", "foobar");
test_escape_one(".foobar", "_.foobar");
test_escape_one("foobar.service", "foobar.service");
test_escape_one("cgroup.service", "_cgroup.service");
test_escape_one("cpu.service", "_cpu.service");
test_escape_one("tasks", "_tasks");
test_escape_one("_foobar", "__foobar");
test_escape_one("", "_");
test_escape_one("_", "__");
test_escape_one(".", "_.");
}
static void test_controller_is_valid(void) {