From d18559631620763245c7b3b664673f7f8be7eb9c Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Sun, 28 Nov 1999 03:07:19 +0000 Subject: Bash1 incorrectly restores signals when executing programs. This causes many programs to use 100% CPU after a login session was ungracefully closed because SIGHUP will not be delivered to processes started from bash1 used as login shell (SIGHUP is ignored when bash1 is running as login shell and telnet connection is made because ignored SIGHUP is inherited from inetd->telnetd->getty->login; ignored SIGHUP is restored before starting any program from shell). These patches were derived from Bash 2.03, and attempt to impliement the Bash 2.03 behavior. PR: 14943 Submitted by: Max Khon (fjoe@iclub.nsu.ru) --- shells/bash1/files/patch-aj | 12 ++++++++++++ shells/bash1/files/patch-ak | 13 +++++++++++++ shells/bash1/files/patch-al | 13 +++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 shells/bash1/files/patch-aj create mode 100644 shells/bash1/files/patch-ak create mode 100644 shells/bash1/files/patch-al (limited to 'shells') diff --git a/shells/bash1/files/patch-aj b/shells/bash1/files/patch-aj new file mode 100644 index 000000000000..fed357fc09d3 --- /dev/null +++ b/shells/bash1/files/patch-aj @@ -0,0 +1,12 @@ +*** ./subst.c.orig Wed Nov 17 18:40:38 1999 +--- ./subst.c Wed Nov 17 18:40:59 1999 +*************** process_substitute (string, open_for_rea +*** 2021,2026 **** +--- 2021,2027 ---- + pid = make_child ((char *)NULL, 1); + if (pid == 0) + { ++ reset_terminating_signals(); + /* Cancel traps, in trap.c. */ + restore_original_signals (); + setup_async_signals (); diff --git a/shells/bash1/files/patch-ak b/shells/bash1/files/patch-ak new file mode 100644 index 000000000000..db1ef8527ed3 --- /dev/null +++ b/shells/bash1/files/patch-ak @@ -0,0 +1,13 @@ +*** ./trap.c.orig Wed Nov 17 18:36:19 1999 +--- ./trap.c Wed Nov 17 18:36:29 1999 +*************** restore_original_signals () +*** 556,563 **** + { + register int i; + +- reset_terminating_signals (); /* in shell.c */ +- + if (sigmodes[0] & SIG_TRAPPED) + { + free_trap_command (0); +--- 556,561 ---- diff --git a/shells/bash1/files/patch-al b/shells/bash1/files/patch-al new file mode 100644 index 000000000000..77f2b3aa1e06 --- /dev/null +++ b/shells/bash1/files/patch-al @@ -0,0 +1,13 @@ +*** ./execute_cmd.c.orig Wed Nov 17 18:37:45 1999 +--- ./execute_cmd.c Wed Nov 17 18:37:53 1999 +*************** execute_command_internal (command, async +*** 340,345 **** +--- 340,347 ---- + { + int user_subshell, return_code, function_value; + ++ reset_terminating_signals(); ++ + /* Cancel traps, in trap.c. */ + restore_original_signals (); + if (asynchronous) -- cgit v1.2.3