confile: forbid absolute paths in config items that modify the cgroup layout

This is not a safety measure but merely is supposed to raise awareness that these paths are always relative to the cgroup root as determined by lxc.cgroup.relative. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 98d92d9a
......@@ -1683,6 +1683,9 @@ static int set_config_cgroup_dir(const char *key, const char *value,
if (lxc_config_value_empty(value))
return clr_config_cgroup_dir(key, lxc_conf, NULL);
if (abspath(value))
return syserrno_set(-EINVAL, "%s paths may not be absolute", key);
if (dotdot(value))
return syserrno_set(-EINVAL, "%s paths may not walk upwards via \"../\"", key);
......
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