Skip to content

Commit

Permalink
cgroups: check correct variable
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 17, 2021
1 parent e219f8e commit e4db08e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lxc/cgroups/cgfsng.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e4db08e

Please sign in to comment.