]> git.proxmox.com Git - mirror_lxc.git/commitdiff
unshare the utsname in all the cases
authorDaniel Lezcano <dlezcano@fr.ibm.com>
Fri, 12 Jun 2009 14:02:14 +0000 (16:02 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Fri, 12 Jun 2009 14:02:14 +0000 (16:02 +0200)
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 <dlezcano@fr.ibm.com>
src/lxc/start.c

index da4afb9cc0d91460797f6b987e7210ff874f9ab4..e9f4500e878f9d8e2960b3c7f341c14d84feefac 100644 (file)
@@ -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;