From: Christian Brauner Date: Tue, 15 Dec 2020 10:56:50 +0000 (+0100) Subject: confile: don't accidently alter lxc.cgroup.dir X-Git-Tag: lxc-5.0.0~327^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c583072d67e3079f9dc4b4b78c141190cd30a6cc;p=thirdparty%2Flxc.git confile: don't accidently alter lxc.cgroup.dir Cc: stable-4.0 Signed-off-by: Christian Brauner --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index b52bd11b4..bcf50ad3c 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -1759,6 +1759,9 @@ static int set_config_cgroup2_controller(const char *key, const char *value, static int set_config_cgroup_dir(const char *key, const char *value, struct lxc_conf *lxc_conf, void *data) { + if (strcmp(key, "lxc.cgroup.dir") != 0) + return ret_errno(EINVAL); + if (lxc_config_value_empty(value)) return clr_config_cgroup_dir(key, lxc_conf, NULL); @@ -3688,6 +3691,9 @@ static int get_config_cgroup_dir(const char *key, char *retv, int inlen, int len; int fulllen = 0; + if (strcmp(key, "lxc.cgroup.dir") != 0) + return ret_errno(EINVAL); + if (!retv) inlen = 0; else @@ -4607,6 +4613,9 @@ static inline int clr_config_cgroup2_controller(const char *key, static int clr_config_cgroup_dir(const char *key, struct lxc_conf *lxc_conf, void *data) { + if (strcmp(key, "lxc.cgroup.dir") != 0) + return ret_errno(EINVAL); + if (lxc_conf->cgroup_meta.dir) free_disarm(lxc_conf->cgroup_meta.dir);