From 435e1b8784d78ce0f10a6a6bde3088af0ac769d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Fri, 22 Aug 2014 12:36:31 -0400 Subject: [PATCH] ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: S.Çağlar Onur Acked-by: Serge E. Hallyn --- src/lxc/attach.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 1a753c76f..923c4971b 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -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) -- 2.47.2