From 95b21cff0ee60ae59b6221c89d84f97bcec33ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 15 Jul 2019 18:16:03 +0200 Subject: [PATCH] Apply empty_to_root() in three more spots for safety --- src/basic/cgroup-util.c | 4 ++-- src/core/cgroup.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index da37b52dbe..dff6543bf5 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -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; diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 0428f62481..9a1aec144e 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -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)