rpms/tcsh/devel tcsh-6.14.00-sigint.patch, NONE, 1.1 tcsh-6.14.00-wide-crash.patch, NONE, 1.1 tcsh.spec, 1.36, 1.37

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Sat Mar 18 03:19:34 UTC 2006


Author: mitr

Update of /cvs/dist/rpms/tcsh/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv14681

Modified Files:
	tcsh.spec 
Added Files:
	tcsh-6.14.00-sigint.patch tcsh-6.14.00-wide-crash.patch 
Log Message:
* Sat Mar 18 2006 Miloslav Trmac <mitr at redhat.com> - 6.14-7
- Fix a crash when reading scripts with multibyte characters (#183267)
- Block SIGINT while waiting for children (#177366)


tcsh-6.14.00-sigint.patch:
 sh.proc.c |   28 ++++++++--------------------
 1 files changed, 8 insertions(+), 20 deletions(-)

--- NEW FILE tcsh-6.14.00-sigint.patch ---
--- 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);

tcsh-6.14.00-wide-crash.patch:
 sh.lex.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

--- NEW FILE tcsh-6.14.00-wide-crash.patch ---
--- 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;
 }


Index: tcsh.spec
===================================================================
RCS file: /cvs/dist/rpms/tcsh/devel/tcsh.spec,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- tcsh.spec	11 Feb 2006 05:48:39 -0000	1.36
+++ tcsh.spec	18 Mar 2006 03:19:31 -0000	1.37
@@ -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 @@
 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 @@
 %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 @@
 %{_mandir}/*/*
 
 %changelog
+* Sat Mar 18 2006 Miloslav Trmac <mitr at 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 at redhat.com> - 6.14-5.2.1
 - bump again for double-long bug on ppc(64)
 




More information about the fedora-cvs-commits mailing list