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,
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);
......@@ -3482,6 +3485,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
......@@ -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,
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);
......
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