]> git.proxmox.com Git - mirror_lxc.git/commitdiff
ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313
authorS.Çağlar Onur <caglar@10ur.org>
Fri, 22 Aug 2014 16:36:31 +0000 (12:36 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 22 Aug 2014 18:55:07 +0000 (13:55 -0500)
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/attach.c

index 1a753c76f39cee49091d714b7ecb7f94c4dedccd..923c4971b4013a320e22fd48c5b4da50623a0605 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <signal.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <grp.h>
@@ -601,7 +602,7 @@ static bool fetch_seccomp(const char *name, const char *lxcpath,
                struct lxc_proc_context_info *i, lxc_attach_options_t *options)
 {
        struct lxc_container *c;
-       
+
        if (!(options->namespaces & CLONE_NEWNS) || !(options->attach_flags & LXC_ATTACH_LSM))
                return true;
 
@@ -771,6 +772,10 @@ int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_fun
                        goto cleanup_error;
                }
 
+               /* ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313 */
+               signal(SIGINT, SIG_IGN);
+               signal(SIGQUIT, SIG_IGN);
+
                /* reap intermediate process */
                ret = wait_for_pid(pid);
                if (ret < 0)