Commit 1ea6db29 by Daniel Lezcano

unshare the utsname in all the cases

The current code implies we have to define a utsname in order to unshare it. This problematic in case of system container because we want them to set their hostname. As the utsname namespace is a COW, we can safely unshare it in all the cases. Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent ddceb1f9
...@@ -459,9 +459,7 @@ int lxc_spawn(const char *name, struct lxc_handler *handler, char *const argv[]) ...@@ -459,9 +459,7 @@ int lxc_spawn(const char *name, struct lxc_handler *handler, char *const argv[])
goto out; goto out;
} }
clone_flags = CLONE_NEWPID|CLONE_NEWIPC|CLONE_NEWNS; clone_flags = CLONE_NEWUTS|CLONE_NEWPID|CLONE_NEWIPC|CLONE_NEWNS;
if (conf_has_utsname(name))
clone_flags |= CLONE_NEWUTS;
if (conf_has_network(name)) if (conf_has_network(name))
clone_flags |= CLONE_NEWNET; clone_flags |= CLONE_NEWNET;
......
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