confile: don't accidently alter lxc.cgroup.dir

Cc: stable-4.0 Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent ef0e4460
...@@ -1678,6 +1678,9 @@ static int set_config_cgroup2_controller(const char *key, const char *value, ...@@ -1678,6 +1678,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, static int set_config_cgroup_dir(const char *key, const char *value,
struct lxc_conf *lxc_conf, void *data) struct lxc_conf *lxc_conf, void *data)
{ {
if (strcmp(key, "lxc.cgroup.dir") != 0)
return ret_errno(EINVAL);
if (lxc_config_value_empty(value)) if (lxc_config_value_empty(value))
return clr_config_cgroup_dir(key, lxc_conf, NULL); return clr_config_cgroup_dir(key, lxc_conf, NULL);
...@@ -3482,6 +3485,9 @@ static int get_config_cgroup_dir(const char *key, char *retv, int inlen, ...@@ -3482,6 +3485,9 @@ static int get_config_cgroup_dir(const char *key, char *retv, int inlen,
int len; int len;
int fulllen = 0; int fulllen = 0;
if (strcmp(key, "lxc.cgroup.dir") != 0)
return ret_errno(EINVAL);
if (!retv) if (!retv)
inlen = 0; inlen = 0;
else else
...@@ -4293,6 +4299,9 @@ static inline int clr_config_cgroup2_controller(const char *key, ...@@ -4293,6 +4299,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, static int clr_config_cgroup_dir(const char *key, struct lxc_conf *lxc_conf,
void *data) void *data)
{ {
if (strcmp(key, "lxc.cgroup.dir") != 0)
return ret_errno(EINVAL);
if (lxc_conf->cgroup_meta.dir) if (lxc_conf->cgroup_meta.dir)
free_disarm(lxc_conf->cgroup_meta.dir); free_disarm(lxc_conf->cgroup_meta.dir);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment