From 54a6935335f8ef2bb4c56fbc9ab0f9aea6863e69 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Wed, 29 Oct 2014 15:03:14 +0000 Subject: [PATCH] attach: don't ignore sigint/sigkill if stdin is redirected MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/lxc/attach.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 6e5d7b57d..1667d7444 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); -- 2.47.2