Subject: Re: csh bug
To: None <mickey@openbsd.org, cgd@netbsd.org, itohy@netbsd.org, mycroft@netbsd.org,>
From: Christos Zoulas <christos@zoulas.com>
List: netbsd-bugs
Date: 09/04/2000 01:27:07
On Aug 29,  9:54pm, mickey@lucifier.remote.dti.net (Michael Shalayeff) wrote:
-- Subject: csh bug

Hi Michael,

can you please send also an example that exercises the bug?

thanks,

christos

| re
| you've been choosen as people last comitted to csh.
| i've just found this bug in bsd csh.
| i hope it will be usefull.
| it fixes a coredump under certain conditions.
| cu
| 
| Index: csh.c
| ===================================================================
| RCS file: /cvs/src/bin/csh/csh.c,v
| retrieving revision 1.10
| diff -u -r1.10 csh.c
| --- csh.c	1999/02/21 08:28:00	1.10
| +++ csh.c	2000/08/30 01:43:02
| @@ -522,6 +522,7 @@
|       * start-up scripts.
|       */
|      reenter = setexit();	/* PWP */
| +    exitset++;
|      haderr = 0;			/* In case second time through */
|      if (!fast && reenter == 0) {
|  	/* Will have value(STRhome) here because set fast if don't */
| Index: csh.h
| ===================================================================
| RCS file: /cvs/src/bin/csh/csh.h,v
| retrieving revision 1.5
| diff -u -r1.5 csh.h
| --- csh.h	1999/08/06 20:41:04	1.5
| +++ csh.h	2000/08/30 01:43:03
| @@ -185,6 +185,7 @@
|  
|  #include <setjmp.h>
|  jmp_buf reslab;
| +int exitset;
|  
|  #define	setexit()	(setjmp(reslab))
|  #define	reset()		longjmp(reslab, 1)
| Index: error.c
| ===================================================================
| RCS file: /cvs/src/bin/csh/error.c,v
| retrieving revision 1.2
| diff -u -r1.2 error.c
| --- error.c	1997/11/15 21:51:28	1.2
| +++ error.c	2000/08/30 01:43:03
| @@ -398,7 +398,7 @@
|      /*
|       * Go away if -e or we are a child shell
|       */
| -    if (exiterr || child)
| +    if (!exitset || exiterr || child)
|  	xexit(1);
|  
|      /*
| -- 
|     paranoic mickey       (my employers have changed but, the name has remained)
-- End of excerpt from Michael Shalayeff