summaryrefslogtreecommitdiffstats
path: root/term-utils/script.c
diff options
context:
space:
mode:
authorKarel Zak2012-03-08 16:02:28 +0100
committerKarel Zak2012-03-08 16:02:28 +0100
commita17f32645df6850242bfac1f162cd7dd63d8d033 (patch)
tree7e7c51994c06a84c3883aabbf4691b25e5496b76 /term-utils/script.c
parentfdisk: fix to build for IA32 (diff)
downloadkernel-qcow2-util-linux-a17f32645df6850242bfac1f162cd7dd63d8d033.tar.gz
kernel-qcow2-util-linux-a17f32645df6850242bfac1f162cd7dd63d8d033.tar.xz
kernel-qcow2-util-linux-a17f32645df6850242bfac1f162cd7dd63d8d033.zip
script: play well with csh when invoked from within /etc/csh.login
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797888 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/script.c')
-rw-r--r--term-utils/script.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/term-utils/script.c b/term-utils/script.c
index 58f9790ad..0d891b8ee 100644
--- a/term-utils/script.c
+++ b/term-utils/script.c
@@ -437,6 +437,16 @@ doshell(void) {
else
shname = shell;
+ /*
+ * When invoked from within /etc/csh.login, script spawns a csh shell
+ * that spawns programs that cannot be killed with a SIGTERM. This is
+ * because csh has a documented behaviour wherein it disables all
+ * signals when processing the /etc/csh.* files.
+ *
+ * Let's restore the default behavior.
+ */
+ signal(SIGTERM, SIG_DFL);
+
if (cflg)
execl(shell, shname, "-c", cflg, NULL);
else