From: S.Çağlar Onur Date: Fri, 22 Aug 2014 16:36:31 +0000 (-0400) Subject: ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313 X-Git-Tag: lxc-1.1.0.alpha2~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2eef2bda81c8e7d4c64ab90105342918e0e65f9d;p=thirdparty%2Flxc.git ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313 Signed-off-by: S.Çağlar Onur Acked-by: Serge E. Hallyn --- 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)