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>
This commit is contained in:
Karel Zak 2012-03-08 16:02:28 +01:00
parent 90e57677a5
commit a17f32645d
1 changed files with 10 additions and 0 deletions

View File

@ -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