From: Karel Zak Date: Thu, 8 Mar 2012 15:02:28 +0000 (+0100) Subject: script: play well with csh when invoked from within /etc/csh.login X-Git-Tag: v2.22-rc1~707 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a17f32645df6850242bfac1f162cd7dd63d8d033;p=thirdparty%2Futil-linux.git 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 --- diff --git a/term-utils/script.c b/term-utils/script.c index 58f9790add..0d891b8ee7 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