From: Serge Hallyn Date: Wed, 29 Oct 2014 15:03:14 +0000 (+0000) Subject: attach: don't ignore sigint/sigkill if stdin is redirected X-Git-Tag: lxc-1.1.0.alpha3~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62183f1af7f265b74a12297e0ab2f82f6a1f783e;p=thirdparty%2Flxc.git attach: don't ignore sigint/sigkill if stdin is redirected If attach is being done over passed-in fds, then we shouldn't mess with the caller's signal table to ignore ctrl-c over the fd. Signed-off-by: Serge Hallyn Acked-by: Stéphane Graber --- diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 231801869..4010668b7 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -758,8 +758,10 @@ int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_fun } /* ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313 */ - signal(SIGINT, SIG_IGN); - signal(SIGQUIT, SIG_IGN); + if (options->stdin_fd == 0) { + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + } /* reap intermediate process */ ret = wait_for_pid(pid);