summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiloslav Trmac <mitr@fedoraproject.org>2006-03-18 03:19:31 +0000
committerMiloslav Trmac <mitr@fedoraproject.org>2006-03-18 03:19:31 +0000
commit5533df3a657a5e2ee22b06d1013bb9945c75750e (patch)
tree2e860abedc3aabad498c2a136243e9bdc7f4be6e
parent8d6eb0008aedf6e339bf248cb60038ad1fdd02f4 (diff)
downloadtcsh-rebase-6.19.00-5533df3a657a5e2ee22b06d1013bb9945c75750e.tar.gz
tcsh-rebase-6.19.00-5533df3a657a5e2ee22b06d1013bb9945c75750e.tar.xz
tcsh-rebase-6.19.00-5533df3a657a5e2ee22b06d1013bb9945c75750e.zip
- Fix a crash when reading scripts with multibyte characters (#183267)
- Block SIGINT while waiting for children (#177366)
-rw-r--r--tcsh-6.14.00-sigint.patch60
-rw-r--r--tcsh-6.14.00-wide-crash.patch27
-rw-r--r--tcsh.spec10
3 files changed, 96 insertions, 1 deletions
diff --git a/tcsh-6.14.00-sigint.patch b/tcsh-6.14.00-sigint.patch
new file mode 100644
index 0000000..82bda30
--- /dev/null
+++ b/tcsh-6.14.00-sigint.patch
@@ -0,0 +1,60 @@
+--- tcsh-6.14.00/sh.proc.c.sigint 2006-02-19 05:07:32.000000000 +0100
++++ tcsh-6.14.00/sh.proc.c 2006-02-19 05:29:52.000000000 +0100
+@@ -543,9 +543,7 @@
+ {
+ struct process *fp;
+ int jobflags, reason;
+-#ifdef BSDSIGS
+- sigmask_t omask;
+-#endif /* BSDSIGS */
++ sigset_t omask, pause_mask;
+ #ifdef UNRELSIGS
+ signalfun_t inthandler;
+ #endif /* UNRELSIGS */
+@@ -562,17 +560,16 @@
+ * target process, or any of its friends, are running
+ */
+ fp = pp;
+-#ifdef BSDSIGS
+- omask = sigblock(sigmask(SIGCHLD));
+-#endif /* BSDSIGS */
++ sigprocmask(SIG_BLOCK, NULL, &omask);
++ sighold(SIGINT);
++ sigprocmask(SIG_BLOCK, NULL, &pause_mask);
++ sighold(SIGCHLD);
++ sigdelset(&pause_mask, SIGCHLD);
+ #ifdef UNRELSIGS
+ if (setintr)
+ inthandler = signal(SIGINT, SIG_IGN);
+ #endif /* UNRELSIGS */
+ for (;;) {
+-#ifndef BSDSIGS
+- (void) sighold(SIGCHLD);
+-#endif /* !BSDSIGS */
+ jobflags = 0;
+ do
+ jobflags |= fp->p_flags;
+@@ -583,21 +580,12 @@
+ xprintf("%d starting to sigpause for SIGCHLD on %d\n",
+ getpid(), fp->p_procid);
+ #endif /* JOBDEBUG */
+-#ifdef BSDSIGS
+- /* (void) sigpause(sigblock((sigmask_t) 0) &~ sigmask(SIGCHLD)); */
+- (void) sigpause(omask & ~sigmask(SIGCHLD));
+-#else /* !BSDSIGS */
+- (void) sigpause(SIGCHLD);
+-#endif /* !BSDSIGS */
++ sigsuspend(&pause_mask);
+ }
+ #ifdef JOBDEBUG
+ xprintf("%d returned from sigpause loop\n", getpid());
+ #endif /* JOBDEBUG */
+-#ifdef BSDSIGS
+- (void) sigsetmask(omask);
+-#else /* !BSDSIGS */
+- (void) sigrelse(SIGCHLD);
+-#endif /* !BSDSIGS */
++ sigprocmask(SIG_SETMASK, &omask, NULL);
+ #ifdef UNRELSIGS
+ if (setintr)
+ (void) signal(SIGINT, inthandler);
diff --git a/tcsh-6.14.00-wide-crash.patch b/tcsh-6.14.00-wide-crash.patch
new file mode 100644
index 0000000..5b2e1b8
--- /dev/null
+++ b/tcsh-6.14.00-wide-crash.patch
@@ -0,0 +1,27 @@
+--- tcsh-6.14.00/sh.lex.c.wide-crash 2006-02-28 03:34:58.000000000 +0100
++++ tcsh-6.14.00/sh.lex.c 2006-02-28 03:35:31.000000000 +0100
+@@ -1710,13 +1710,13 @@
+ break;
+ partial += r;
+ i = 0;
+- while (i < partial) {
++ while (i < partial && nchars != 0) {
+ int len;
+
+ len = normal_mbtowc(buf + res, cbuf + i, partial - i);
+ if (len == -1) {
+ reset_mbtowc();
+- if (partial < MB_LEN_MAX && r > 0)
++ if (partial - i < MB_LEN_MAX && r > 0)
+ /* Maybe a partial character and there is still a chance
+ to read more */
+ break;
+@@ -1735,7 +1735,7 @@
+ if (i != partial)
+ memmove(cbuf, cbuf + i, partial - i);
+ partial -= i;
+- } while (partial != 0);
++ } while (partial != 0 && nchars != 0);
+ /* Throwing away possible partial multibyte characters on error */
+ return res != 0 ? res : r;
+ }
diff --git a/tcsh.spec b/tcsh.spec
index 3364264..ee48607 100644
--- a/tcsh.spec
+++ b/tcsh.spec
@@ -3,7 +3,7 @@
Summary: An enhanced version of csh, the C shell.
Name: tcsh
Version: 6.14
-Release: 5.2.1
+Release: 7
License: distributable
Group: System Environment/Shells
Source: ftp://ftp.astron.com/pub/tcsh/tcsh-%{version}.00.tar.gz
@@ -13,6 +13,8 @@ Patch2: tcsh-6.14.00-iconv.patch
Patch3: tcsh-6.14.00-lsF.patch
Patch4: tcsh-6.14.00-dashn.patch
Patch5: tcsh-6.14.00-read.patch
+Patch6: tcsh-6.14.00-sigint.patch
+Patch7: tcsh-6.14.00-wide-crash.patch
Provides: csh = %{version}
Prereq: fileutils, grep
URL: http://www.tcsh.org/
@@ -35,6 +37,8 @@ like syntax.
%patch3 -p1 -b .lsF
%patch4 -p1 -b .dashn
%patch5 -p1 -b .read
+%patch6 -p1 -b .sigint
+%patch7 -p1 -b .wide-crash
nroff -me eight-bit.me > eight-bit.txt
@@ -102,6 +106,10 @@ fi
%{_mandir}/*/*
%changelog
+* Sat Mar 18 2006 Miloslav Trmac <mitr@redhat.com> - 6.14-7
+- Fix a crash when reading scripts with multibyte characters (#183267)
+- Block SIGINT while waiting for children (#177366)
+
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 6.14-5.2.1
- bump again for double-long bug on ppc(64)