From f4dfca490cb6d4b4fc7c6b977db56ab0d718de21 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 8 Mar 2016 18:18:05 +0000 Subject: 38114: Fix hang using ^Z with command subst. In subshells started to perform substitutions disable signals that require interactive handling. --- Src/exec.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/exec.c b/Src/exec.c index b60fc90bd..50eff72cb 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -994,9 +994,18 @@ entersubsh(int flags) if ((flags & ESUB_REVERTPGRP) && getpid() == mypgrp) release_pgrp(); shout = NULL; - if (!job_control_ok) { + if (flags & ESUB_NOMONITOR) { /* - * If this process is not goign to be doing job control, + * Allowing any form of interactive signalling here is + * actively harmful as we are in a context where there is no + * control over the process. + */ + signal_ignore(SIGTTOU); + signal_ignore(SIGTTIN); + signal_ignore(SIGTSTP); + } else if (!job_control_ok) { + /* + * If this process is not going to be doing job control, * we don't want to do special things with the corresponding * signals. If it is, we need to keep the special behaviour: * see note about attachtty() above. -- cgit 1.4.1