]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: setsid in init task as well 851/head
authorTycho Andersen <tycho.andersen@canonical.com>
Fri, 26 Feb 2016 00:04:01 +0000 (17:04 -0700)
committerTycho Andersen <tycho.andersen@canonical.com>
Fri, 26 Feb 2016 00:04:01 +0000 (17:04 -0700)
If we don't do this, we'll leak the parent's session id to the container,
which maybe doesn't matter, but it still seems better to set it anyway.

Also, it breaks CRIU for containers that don't call setsid themselves.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
src/lxc/start.c

index acf32e4b5dc124cbcf5308379494ffb90bdb9c1c..6a3ab9523743e39fc085a83d5083597712c34ce5 100644 (file)
@@ -851,6 +851,8 @@ static int do_start(void *data)
                goto out_warn_father;
        }
 
+       setsid();
+
        /* after this call, we are in error because this
         * ops should not return as it execs */
        handler->ops->start(handler, handler->data);