Skip to content

Commit

Permalink
ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313
Browse files Browse the repository at this point in the history
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
caglar10ur authored and stgraber committed Sep 19, 2014
1 parent 2b96d9f commit 435e1b8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lxc/attach.c
Expand Up @@ -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>
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 435e1b8

Please sign in to comment.