[net.sources.bugs] Rn bug patch #17

jonab@sdcrdcf.UUCP (Jonathan Biggar) (11/17/84)

System: rn version 4.1
Bug #: 17
Priority: HIGH
Subject: null junk files and checkgroups that want to remove everything
Index: inews.c (version 2.10.2)

Description:
	Due to differences between 2.10.1 and 2.10.2, the DOXREFS patch
	sent out with the rn kit for inews 2.10.2 can cause inews to do
	certain strange things.  All your files in the junk newsgroup will
	end up empty, and the checkgroups control message will ask you to
	remove all non-local newsgroups.

Repeat-By:
	If you installed inews.c.2.pat, you've got the problem, and are
	already repeating it.

Fix:	Apply the following to a 2.10.2 inews that *already* has the DOXREFS
	patch.  This new patch merely changes some LINKART's into DOXREFS's
	(the code was already there, I just short-circuited), and moves the
	call to control() to after the article file is copied.  Someone
	suggested changing the code in control() regarding checkgroups, but
	changing inews.c is more general, and besides, I'm lazy and don't
	want to patch two files when I could patch one.

	From rn, say "| patch -d DIR", where DIR is your news source
	directory.  Outside of rn, say "cd DIR; patch <thisarticle".  If
	you don't have the patch program, apply the following by hand, or
	get patch.

Prereq: DOXREFS
*** inews.c.oldpat	Thu Oct 18 09:39:54 1984
--- inews.c		Thu Oct 18 09:36:44 1984
***************
*** 576,582
  		logerr("No valid newsgroups found, moved to junk");
  		if (localize("junk"))
  			savehist(histline);
! #ifndef LINKART
  		xxit(1);
  #endif
  	}

--- 576,582 -----
  		logerr("No valid newsgroups found, moved to junk");
  		if (localize("junk"))
  			savehist(histline);
! #ifndef DOXREFS
  		xxit(1);
  #endif
  	}
***************
*** 580,586
  		xxit(1);
  #endif
  	}
! #ifdef LINKART
  	else
  #endif
  	if (time((time_t)0) > (cgtdate(header.subdate) + DFLTEXP) ){

--- 580,586 -----
  		xxit(1);
  #endif
  	}
! #ifdef DOXREFS
  	else
  #endif
  	if (time((time_t)0) > (cgtdate(header.subdate) + DFLTEXP) ){
***************
*** 587,593
  		logerr("Article too old, moved to junk");
  		if (localize("junk"))
  			savehist(histline);
! #ifndef LINKART
  		xxit(1);
  #endif
  	}

--- 587,593 -----
  		logerr("Article too old, moved to junk");
  		if (localize("junk"))
  			savehist(histline);
! #ifndef DOXREFS
  		xxit(1);
  #endif
  	}
***************
*** 591,597
  		xxit(1);
  #endif
  	}
! #ifdef LINKART
  	else
  #endif
  	if (is_ctl) {

--- 591,597 -----
  		xxit(1);
  #endif
  	}
! #ifdef DOXREFS
  	else
  #endif
  	if (is_ctl) {
***************
*** 595,600
  	else
  #endif
  	if (is_ctl) {
  		control(&header);
  		localize("control");
  	} else {

--- 595,601 -----
  	else
  #endif
  	if (is_ctl) {
+ #ifndef DOXREFS
  		control(&header);
  #endif
  		localize("control");
***************
*** 596,601
  #endif
  	if (is_ctl) {
  		control(&header);
  		localize("control");
  	} else {
  		if (s_find(&srec, FULLSYSNAME) == FALSE)

--- 597,603 -----
  	if (is_ctl) {
  #ifndef DOXREFS
  		control(&header);
+ #endif
  		localize("control");
  	} else {
  		if (s_find(&srec, FULLSYSNAME) == FALSE)
***************
*** 656,661
  	fclose(tfp);
  	fclose(infp);
  #endif LINKART || DOXREFS
  
  	broadcast();
  	savehist(histline);

--- 658,668 -----
  	fclose(tfp);
  	fclose(infp);
  #endif LINKART || DOXREFS
+ 
+ #ifdef DOXREFS
+ 	if (is_ctl)	/* moved here cuz checkgroups uses ARTICLE! */
+ 		control(&header);
+ #endif
  
  	broadcast();
  	savehist(histline);