From 1ea6db2923761b45b4400c32810b17f58785057a Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Fri, 12 Jun 2009 16:02:14 +0200 Subject: [PATCH] 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: Daniel Lezcano --- src/lxc/start.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index da4afb9cc..e9f4500e8 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -459,9 +459,7 @@ int lxc_spawn(const char *name, struct lxc_handler *handler, char *const argv[]) goto out; } - clone_flags = CLONE_NEWPID|CLONE_NEWIPC|CLONE_NEWNS; - if (conf_has_utsname(name)) - clone_flags |= CLONE_NEWUTS; + clone_flags = CLONE_NEWUTS|CLONE_NEWPID|CLONE_NEWIPC|CLONE_NEWNS; if (conf_has_network(name)) clone_flags |= CLONE_NEWNET; -- 2.39.5