]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: check correct variable
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 00:10:27 +0000 (01:10 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 00:45:47 +0000 (01:45 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 394d72650337ad5aaf281e3162be037641be3e8e..e2a4c492e23259b244872737ba409599257fbc2e 100644 (file)
@@ -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);