Commit 435e1b87 by S.Çağlar Onur Committed by Stéphane Graber

ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313

parent 2b96d9f6
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <grp.h> #include <grp.h>
...@@ -601,7 +602,7 @@ static bool fetch_seccomp(const char *name, const char *lxcpath, ...@@ -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_proc_context_info *i, lxc_attach_options_t *options)
{ {
struct lxc_container *c; struct lxc_container *c;
if (!(options->namespaces & CLONE_NEWNS) || !(options->attach_flags & LXC_ATTACH_LSM)) if (!(options->namespaces & CLONE_NEWNS) || !(options->attach_flags & LXC_ATTACH_LSM))
return true; return true;
...@@ -771,6 +772,10 @@ int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_fun ...@@ -771,6 +772,10 @@ int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_fun
goto cleanup_error; goto cleanup_error;
} }
/* ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313 */
signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
/* reap intermediate process */ /* reap intermediate process */
ret = wait_for_pid(pid); ret = wait_for_pid(pid);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment