[bash/f18] Signal handler fix and man page tweak
Roman Rakus
rrakus at fedoraproject.org
Tue Aug 28 14:00:20 UTC 2012
commit 06616c6e2a9883eebf9a988952bc4830b3a08289
Author: Roman Rakus <rrakus at redhat.com>
Date: Tue Aug 28 14:46:34 2012 +0200
Signal handler fix and man page tweak
Resolves: #799958, #695656
Signed-off-by: Roman Rakus <rrakus at redhat.com>
Conflicts:
bash.spec
Signed-off-by: Roman Rakus <rrakus at redhat.com>
bash-4.2-manpage_trap.patch | 12 ++++++++++++
bash-4.2-signal.patch | 36 ++++++++++++++++++++++++++++++++++++
bash.spec | 18 +++++++++++++++++-
3 files changed, 65 insertions(+), 1 deletions(-)
---
diff --git a/bash-4.2-manpage_trap.patch b/bash-4.2-manpage_trap.patch
new file mode 100644
index 0000000..6923d25
--- /dev/null
+++ b/bash-4.2-manpage_trap.patch
@@ -0,0 +1,12 @@
+diff -up bash-4.1/doc/bash.1.manpage_trap bash-4.1/doc/bash.1
+--- bash-4.1/doc/bash.1.manpage_trap 2012-08-28 10:06:00.561999092 +0200
++++ bash-4.1/doc/bash.1 2012-08-28 10:06:24.225304505 +0200
+@@ -9251,7 +9251,7 @@ being inverted via
+ These are the same conditions obeyed by the \fBerrexit\fP option.
+ .if t .sp 0.5
+ .if n .sp 1
+-Signals ignored upon entry to the shell cannot be trapped or reset.
++Signals ignored upon entry to the shell cannot be trapped, reset or listed.
+ Trapped signals that are not being ignored are reset to their original
+ values in a subshell or subshell environment when one is created.
+ The return status is false if any
diff --git a/bash-4.2-signal.patch b/bash-4.2-signal.patch
new file mode 100644
index 0000000..a08630d
--- /dev/null
+++ b/bash-4.2-signal.patch
@@ -0,0 +1,36 @@
+diff -up bash-4.1/sig.h.signal bash-4.1/sig.h
+--- bash-4.1/sig.h.signal 2009-01-04 20:32:41.000000000 +0100
++++ bash-4.1/sig.h 2012-08-28 11:19:14.920224571 +0200
+@@ -96,6 +96,8 @@ do { \
+ sigprocmask (SIG_BLOCK, &nvar, &ovar); \
+ } while (0)
+
++#define UNBLOCK_SIGNAL(ovar) sigprocmask (SIG_SETMASK, &ovar, (sigset_t *)NULL)
++
+ #if defined (HAVE_POSIX_SIGNALS)
+ # define BLOCK_CHILD(nvar, ovar) \
+ BLOCK_SIGNAL (SIGCHLD, nvar, ovar)
+diff -up bash-4.1/trap.c.signal bash-4.1/trap.c
+--- bash-4.1/trap.c.signal 2009-10-10 23:21:44.000000000 +0200
++++ bash-4.1/trap.c 2012-08-28 10:58:14.746345797 +0200
+@@ -516,6 +516,8 @@ set_signal (sig, string)
+ int sig;
+ char *string;
+ {
++ sigset_t set, oset;
++
+ if (SPECIAL_TRAP (sig))
+ {
+ change_signal (sig, savestring (string));
+@@ -546,9 +548,10 @@ set_signal (sig, string)
+ environment in which it is safe to do so. */
+ if ((sigmodes[sig] & SIG_NO_TRAP) == 0)
+ {
+- set_signal_handler (sig, SIG_IGN);
++ BLOCK_SIGNAL (sig, set, oset);
+ change_signal (sig, savestring (string));
+ set_signal_handler (sig, trap_handler);
++ UNBLOCK_SIGNAL (oset);
+ }
+ else
+ change_signal (sig, savestring (string));
diff --git a/bash.spec b/bash.spec
index 2870bb6..5a173aa 100644
--- a/bash.spec
+++ b/bash.spec
@@ -6,7 +6,7 @@
Version: %{baseversion}%{patchleveltag}
Name: bash
Summary: The GNU Bourne Again shell
-Release: 5%{?dist}
+Release: 6%{?dist}
Group: System Environment/Shells
License: GPLv3+
Url: http://www.gnu.org/software/bash
@@ -95,6 +95,12 @@ Patch121: bash-4.2-coverity.patch
# Don't call malloc in signal handler
Patch122: bash-4.1-defer-sigchld-trap.patch
+# 799958, updated info about trap
+Patch123: bash-4.2-manpage_trap.patch
+
+# 695656, block the signal and unblock it after the new handler is installed
+Patch124: bash-4.2-signal.patch
+
BuildRequires: texinfo bison
BuildRequires: ncurses-devel
BuildRequires: autoconf, gettext
@@ -184,6 +190,8 @@ This package contains documentation files for %{name}.
%patch120 -p1 -b .logout
%patch121 -p1 -b .coverity
%patch122 -p1 -b .defer_sigchld_trap
+%patch123 -p1
+%patch124 -p1 -b .signal
echo %{version} > _distribution
echo %{release} > _patchlevel
@@ -374,6 +382,14 @@ end
#%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
%changelog
+* Tue Aug 28 2012 Roman Rakus <rrakus at redhat.com> - 4.2.37-6
+- Update info about trap in man page
+ Resolves: #799958
+- instead of setting the signal handler to SIG_IGN while installing
+ the new trap handler, block the signal and unblock it after the new handler
+ is installed
+ Resolves: #695656
+
* Wed Aug 22 2012 Ondrej Oprala <ooprala at redhat.com> - 4.2.37-5
- Revert revision 4.2.37-4 - already fixed upstream
More information about the scm-commits
mailing list