From: Christian Brauner Date: Wed, 17 Feb 2021 00:10:27 +0000 (+0100) Subject: cgroups: check correct variable X-Git-Tag: lxc-5.0.0~282^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4db08ed3e70f83eea681fbaa2af168a8a690aa6;p=thirdparty%2Flxc.git cgroups: check correct variable Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 394d72650..e2a4c492e 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1060,10 +1060,10 @@ static int __cgroup_tree_create(int dfd_base, const char *path, mode_t mode, * we're paranoid here and check that the path is neither * absolute nor walks upwards. */ - if (abspath(buf)) + if (abspath(cur)) return syserrno_set(-EINVAL, "No absolute paths allowed"); - if (strnequal(buf, "..", STRLITERALLEN(".."))) + if (strnequal(cur, "..", STRLITERALLEN(".."))) return syserrno_set(-EINVAL, "No upward walking paths allowed"); ret = mkdirat(dfd_cur, cur, mode);