[comp.mail.sendmail] EASE source

asp@cos.com (Andrew S. Partan) (05/13/88)

I have the Ease from vol 10 of comp.sources.unix with the patches from
vol 13 applied.

I have also applied a patch from ras@sabre.bellcore.com (Raymond A.
Schnitzler) to give the P (postmaster) option.

I also found & fixed a bug in emitcf.c that was dereferencing NULL
pointers.

Here are these patches.

	--asp (Andrew Partan @ Corporation for Open Systems)
	-- asp@cos.com or asp%cos.com@uunet.uu.net
	-- {uunet, sundc, decuac, hqda-ai, hadron}!cos!asp
	ASN.1 Object Identifier: "{joint-iso-ccitt mhs(6) group(6) 157}"

Patches follow.

First from Raymond A.  Schnitzler:
----------------------------------
Date: Fri, 25 Mar 88 10:36:15 EST
From: sundc!sun!sabre.bellcore.com!ras (Raymond A. Schnitzler)
To: asp@cos.com
Subject: Ease problems/bugs

I have constructed a patch file for you.  I don't know
	whether patch will handle it or not; I haven't
	tested it.  Anyway, it's context diffs.

I keep my cfc source in a subdirectory of my main ease
	directory, and all of the files here are specified
	relative to that ease dir.

There are few comments, if any.

I've defined o_pmaster as the ease version of the P option.

There are other bugs in ease and/or cfc that this still does
	not fix.

Here we go:

*** src/parser.y~	Wed Mar  9 11:46:42 1988
--- src/parser.y	Mon Mar 21 16:03:27 1988
***************
*** 88,93 ****
--- 88,94 ----
  %token MPATH MFLAGS MSENDER MRECIPIENT MARGV MEOL MMAXSIZE
  %token AAOPT AOPT BBOPT COPT DOPT DOPTI DOPTB DOPTQ DDOPT EOPT EOPTP EOPTE 
  %token EOPTM EOPTW EOPTZ FFOPT FOPT GOPT HHOPT IOPT LLOPT MOPT NNOPT OOPT QQOPT
+ %token PPOPT
  %token ROPT SSOPT SOPT TTOPT TOPT UOPT VOPT WWOPT XOPT XXOPT
  %token FFLAG RFLAG SSFLAG NFLAG LFLAG SFLAG MFLAG FFFLAG DDFLAG MMFLAG XFLAG
  %token QOPT YOPT YYOPT ZOPT ZZOPT
***************
*** 310,315 ****
--- 311,319 ----
  			}
  		|	NNOPT {
  				$$ = opt_N;
+ 			}
+ 		|	PPOPT {
+ 				$$ = opt_P;
  			}
  		|	OOPT {
  				$$ = opt_o;

*** src/lexan.l~	Wed Mar  9 11:39:54 1988
--- src/lexan.l	Mon Mar 21 16:17:20 1988
***************
*** 135,140 ****
--- 136,142 ----
  o_hformat			return (OOPT);
  o_qfactor			return (QOPT);
  o_qdir				return (QQOPT);
+ o_pmaster			return (PPOPT);
  o_tread				return (ROPT);
  o_flog				return (SSOPT);
  o_safe				return (SOPT);

*** src/symtab.h~	Wed Mar  9 12:08:45 1988
--- src/symtab.h	Mon Mar 21 16:06:17 1988
***************
*** 48,53 ****
--- 48,54 ----
  	   opt_g, opt_H, opt_i, opt_L, opt_m, opt_N, opt_o, opt_Q, opt_q,
  	   opt_r, opt_S, opt_s, opt_T, opt_t, opt_u, opt_v, opt_W, opt_x,
  	   opt_X, opt_Y, opt_y, opt_Z, opt_z,
+ 	   opt_P,
  	   d_opt_i, d_opt_b, d_opt_q,
  	   e_opt_p, e_opt_e, e_opt_m, e_opt_w, e_opt_z};
  
*** src/strops.c~	Wed Mar  9 11:39:58 1988
--- src/strops.c	Mon Mar 21 16:02:49 1988
***************
*** 80,85 ****
--- 80,86 ----
  		case e_opt_m:	return ("m");
  		case opt_N  :	return ("N");
  		case opt_o  :	return ("o");
+ 		case opt_P  :	return ("P");
  		case e_opt_p:	return ("p");
  		case opt_Q  :	return ("Q");
  		case opt_q  :	return ("q");

*** doc/ap2~	Wed Mar  9 12:39:06 1988
--- doc/ap2	Thu Mar 24 09:08:16 1988
***************
*** 57,62 ****
--- 57,63 ----
  \fIo_rsend\fR	m	
  \fIo_dnet\fR	N	
  \fIo_hformat\fR	o	
+ \fIo_pmaster\fR	P
  \fIo_qdir\fR	Q	
  \fIo_qfactor\fR	q
  \fIo_tread\fR	r	

*** cfc/cfc.c~	Tue Feb 23 14:52:33 1988
--- cfc/cfc.c	Thu Mar 24 08:56:47 1988
***************
*** 973,978 ****
--- 973,979 ----
  	case 'm':	return ("o_rsend");
  	case 'N':	return ("o_dnet");
  	case 'o':	return ("o_hformat");
+ 	case 'P':       return ("o_pmaster");
  	case 'Q':	return ("o_qdir");
  	case 'q':	docompat ("o_qfactor");
  	case 'r':	return ("o_tread");

----------------------------------

Now my patch to emitcf.c:
----------------------------------
From: asp@cos.com (Andrew Partan)
Subject: Patch to emitcf.c to stop dereferencing NULL pointers
Date: Tue May 10 18:27:41 EDT 1988

Found 2 places in emitcf.c where it might dereference a NULL pointer
(and core dump on a Sun).  Stopped it from doing so.

	--asp

*** emitcf.c.ORIG	Tue Feb 23 20:41:37 1988
--- emitcf.c	Tue May 10 18:14:56 1988
***************
*** 73,79 ****
  					targ->idd |= ID_CLASS;  /* signal definition */
  					break;
  
! 		case def_option:	printf ("O%c", *defstr1);
  					PrintDef (def_option, defstr2);
  					break;
  
--- 73,81 ----
  					targ->idd |= ID_CLASS;  /* signal definition */
  					break;
  
! 		case def_option:	if (defstr1 == NULL)
! 						FatalError ("No option passed in EmitDef()", (char *)NULL);
! 					printf ("O%c", *defstr1);
  					PrintDef (def_option, defstr2);
  					break;
  
***************
*** 167,172 ****
--- 169,177 ----
  register char *dstr;		/* definition string		 */
  {
  	register char *tmp;
+ 
+ 	if (dstr == (char *)NULL)
+ 		dstr = "";
  
  	for (tmp = dstr; *tmp != '\0'; tmp++) 	/* search for line continuations */
  		if ((*tmp == '\\') && (*++tmp == '\n'))