[news.software.nntp] catastrophic failure in rn/nntp combination

stewart@netxcom.iad-nxe.global-mis.dhl.com (John Stewart) (02/21/90)

We've been having some LAN problems in the past few days.  Users have been
complaining about bogus messages complaining about bogus news groups.
What makes this catastrophic is that some users will let rn trash their
.newsrc files.

Investigation showed that the transfer of the active file was aborting
with no error indication, so rn was working with a truncated file.
The fix to ngdata.c follows.  getactive.c has the same problem, but I have
not patched it yet.
--------------------------------------------------------------
*** ngdata.c+  Mon Jan  8 18:47:10 1990
--- ngdata.c	Tue Feb 20 17:30:49 1990
***************
*** 51,56
  #ifdef SERVER
      char ser_line[256];
      char *cp;
  #endif
  /* The following is only for systems that do not zero globals properly */
  #ifdef ZEROGLOB

--- 51,57 -----
  #ifdef SERVER
      char ser_line[256];
      char *cp;
+     int entries;
  #endif
  /* The following is only for systems that do not zero globals properly */
  #ifdef ZEROGLOB
***************
*** 79,86
  	finalize(1);
      }
  
!     while (get_server(ser_line, sizeof(ser_line)) >= 0) {  /* while */
! 	if (ser_line[0] == '.')		/* there's another line */
  		break;			/* get it and write it to */
  	fputs(ser_line, actfp);
  	putc('\n', actfp);

--- 80,92 -----
  	finalize(1);
      }
  
!     entries = 0;
!     while (1) {
! 	if (get_server(ser_line, sizeof(ser_line)) < 0) {
! 	    printf("Can't get active file from server:\ntransfer failed after %d entries\n", entries);
! 	    finalize(1);
! 	}
! 	if (ser_line[0] == '.')		/* while there's another line */
  		break;			/* get it and write it to */
  	entries++;
  	fputs(ser_line, actfp);
***************
*** 82,87
      while (get_server(ser_line, sizeof(ser_line)) >= 0) {  /* while */
  	if (ser_line[0] == '.')		/* there's another line */
  		break;			/* get it and write it to */
  	fputs(ser_line, actfp);
  	putc('\n', actfp);
      }

--- 88,94 -----
  	}
  	if (ser_line[0] == '.')		/* while there's another line */
  		break;			/* get it and write it to */
+ 	entries++;
  	fputs(ser_line, actfp);
  	putc('\n', actfp);
      }