]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Apply empty_to_root() in three more spots for safety 13063/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 15 Jul 2019 16:16:03 +0000 (18:16 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 15 Jul 2019 16:39:26 +0000 (18:39 +0200)
src/basic/cgroup-util.c
src/core/cgroup.c

index da37b52dbec34ed111c3f97554baa72c946c2bcf..dff6543bf595eb117ad86750d6f3b12283bfa99d 100644 (file)
@@ -388,7 +388,7 @@ int cg_kill_recursive(
         while ((r = cg_read_subgroup(d, &fn)) > 0) {
                 _cleanup_free_ char *p = NULL;
 
-                p = path_join(path, fn);
+                p = path_join(empty_to_root(path), fn);
                 free(fn);
                 if (!p)
                         return -ENOMEM;
@@ -522,7 +522,7 @@ int cg_migrate_recursive(
         while ((r = cg_read_subgroup(d, &fn)) > 0) {
                 _cleanup_free_ char *p = NULL;
 
-                p = path_join(pfrom, fn);
+                p = path_join(empty_to_root(pfrom), fn);
                 free(fn);
                 if (!p)
                         return -ENOMEM;
index 0428f624813d5384652c61aa20c534e23df2e8bb..9a1aec144e4c82da4786c397cec833a34c08a1ea 100644 (file)
@@ -2490,7 +2490,7 @@ static int unit_watch_pids_in_path(Unit *u, const char *path) {
                 while ((r = cg_read_subgroup(d, &fn)) > 0) {
                         _cleanup_free_ char *p = NULL;
 
-                        p = path_join(path, fn);
+                        p = path_join(empty_to_root(path), fn);
                         free(fn);
 
                         if (!p)