[2339] in Athena Bugs

home help back first fref pref prev next nref lref last post

Postoffices do not allow more than 4 !'s at the end of a line in messages

daemon@ATHENA.MIT.EDU (Stanley R Zanarotti)
Wed Jun 7 19:05:51 1989

Date: Wed, 7 Jun 89 18:23:55 EDT
From: srz@ATHENA.MIT.EDU (Stanley R Zanarotti)
To: bugs@ATHENA.MIT.EDU
Cc: hoffmann@ATHENA.MIT.EDU
There is a bug in the postoffice deliver program (spop) that prevents
lines that end with 4 exclamation points from being received.  spop
changes fourth-to-last bang into a double-quote (").  I've looked at the
code, and the problem is that the program is looking for the mail separator
(\001\001\001\001\n) in a losing case-insensitive way, so that it matches
(!!!!\n) (\041\041\041\041\n).

Here's a possible fix (I haven't tested it):
*** /paris/u2/third_party/mh.6.5/uip/dropsbr.c	Thu Jul  3 16:21:17 1986
--- /mit/srz/mailhack/dropsbr.c	Wed Jun  7 17:55:59 1989
***************
*** 21,26 ****
--- 21,27 ----
  /*  */
  
  static	int	mbx_style = MMDF;
+ static int mystringdex(), myuprf();
  
  
  extern int  errno;
***************
*** 276,284 ****
      (void) fseek (fp, pos, 0);
      while (fgets (buffer, sizeof buffer, fp) != NULL && pos < stop) {
  	i = strlen (buffer);
! 	for (j = 0; (j = stringdex (mmdlm1, buffer)) >= 0; buffer[j]++)
  	    continue;
! 	for (j = 0; (j = stringdex (mmdlm2, buffer)) >= 0; buffer[j]++)
  	    continue;
  	if (write (md, buffer, i) != i)
  	    return NOTOK;
--- 277,285 ----
      (void) fseek (fp, pos, 0);
      while (fgets (buffer, sizeof buffer, fp) != NULL && pos < stop) {
  	i = strlen (buffer);
! 	for (j = 0; (j = mystringdex (mmdlm1, buffer)) >= 0; buffer[j]++)
  	    continue;
! 	for (j = 0; (j = mystringdex (mmdlm2, buffer)) >= 0; buffer[j]++)
  	    continue;
  	if (write (md, buffer, i) != i)
  	    return NOTOK;
***************
*** 341,351 ****
  		    
  	    while ((i = read (fd, buffer, sizeof buffer)) > 0) {
  		for (j = 0;
! 			(j = stringdex (mmdlm1, buffer)) >= 0;
  			buffer[j]++)
  		    continue;
  		for (j = 0;
! 			(j = stringdex (mmdlm2, buffer)) >= 0;
  			buffer[j]++)
  		    continue;
  		if (write (md, buffer, i) != i)
--- 342,352 ----
  		    
  	    while ((i = read (fd, buffer, sizeof buffer)) > 0) {
  		for (j = 0;
! 			(j = mystringdex (mmdlm1, buffer)) >= 0;
  			buffer[j]++)
  		    continue;
  		for (j = 0;
! 			(j = mystringdex (mmdlm2, buffer)) >= 0;
  			buffer[j]++)
  		    continue;
  		if (write (md, buffer, i) != i)
***************
*** 689,692 ****
--- 690,727 ----
      }
  
      return OK;
+ }
+ 
+ /* strindex.c - "signed" lexical index */
+ 
+ 
+ static int  mystringdex (p1, p2)
+ register char  *p1,
+                *p2;
+ {
+     register char  *p;
+ 
+     for (p = p2; *p; p++)
+ 	if (myuprf (p, p1))
+ 	    return (p - p2);
+ 
+     return (-1);
+ }
+ 
+ /* uprf.c - "signed" lexical prefix  */
+ 
+ 
+ myuprf (c1, c2)
+ register char  *c1,
+                *c2;
+ {
+     register int    c;
+ 
+     while (c = *c2++)
+ 	if (c != *c1)
+ 	    return 0;
+ 	else
+ 	    c1++;
+ 
+     return 1;
  }


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

	-stan


home help back first fref pref prev next nref lref last post