From: Christian Brauner Date: Sun, 21 Feb 2021 13:18:28 +0000 (+0100) Subject: cgroups: s/cgroup2_chown/delegate/g X-Git-Tag: lxc-5.0.0~274^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=042f9e9c755ef0fbfb98acc94d166f2d52dcf282;p=thirdparty%2Flxc.git cgroups: s/cgroup2_chown/delegate/g Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index f6209a73e..4a809e5ac 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1326,7 +1326,7 @@ static int chown_cgroup_wrapper(void *data) if (arg->hierarchies[i]->fs_type != UNIFIED_HIERARCHY) continue; - for (char **p = arg->hierarchies[i]->cgroup2_chown; p && *p; p++) + for (char **p = arg->hierarchies[i]->delegate; p && *p; p++) (void)fchowmodat(dirfd, *p, destuid, nsgid, 0664); } @@ -3213,7 +3213,7 @@ static int __initialize_cgroups(struct cgroup_ops *ops, bool relative, move_ptr(controllers); move_ptr(controller_list); if (type == UNIFIED_HIERARCHY) - ops->unified->cgroup2_chown = move_ptr(delegate); + ops->unified->delegate = move_ptr(delegate); } /* determine cgroup layout */ diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c index 79fb2a1f9..95b75a9b8 100644 --- a/src/lxc/cgroups/cgroup.c +++ b/src/lxc/cgroups/cgroup.c @@ -81,9 +81,9 @@ void cgroup_exit(struct cgroup_ops *ops) free(*p); free((*it)->controllers); - for (char **p = (*it)->cgroup2_chown; p && *p; p++) + for (char **p = (*it)->delegate; p && *p; p++) free(*p); - free((*it)->cgroup2_chown); + free((*it)->delegate); free((*it)->at_mnt); free((*it)->at_base); diff --git a/src/lxc/cgroups/cgroup.h b/src/lxc/cgroups/cgroup.h index b7d75ea3b..28db9e97b 100644 --- a/src/lxc/cgroups/cgroup.h +++ b/src/lxc/cgroups/cgroup.h @@ -103,12 +103,7 @@ struct hierarchy { char *at_base; struct /* unified hierarchy specific */ { - /* - * cgroup2 only: what files need to be chowned to delegate a - * cgroup to an unprivileged user. - */ - char **cgroup2_chown; - /* cgroup2 only */ + char **delegate; unsigned int bpf_device_controller : 1; unsigned int freezer_controller : 1; };