🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #1328

Re: advance warning of C News changes

#1328
From: Havard Eidnes
Date: Fri, 23 Aug 1991 13:53
91 lines
3828 bytes
In article <1991Aug22.164742.2641@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes:
>In article <1991Aug22.153659.11517@ugle.unit.no> he@spurv.runit.sintef.no (Havard Eidnes) writes:
>>... no change would be needed
>>for newsxd itself (given that nntpxmit was changed already).
>
>Nobody has changed nntpxmit; all the changes have been to the things that
>invoke it, like nntpsend.

Oops!  Sorry, folks.  As a compensation for my mis-information let me offer
the changes to nntpxmit to make it unnecessary to change newsxd or
nntpsend. (I cross my fingers I did this right...)  The changes have been
done in nntpxmit.c from the 1.5.10 version of the NNTP software, but it
applies successfully (albeit with a bit of "fuzz" from patch) to the
1.5.11 version.  The 1.5.10 version has been tested successfully on "my"
news server, a SunOS machine.  Note that I have not yet installed the
latest and greatest C News on this host, but I hand-edited a NNTP batch file 
to contain relative path names and nntpsend still worked like a charm.

- Havard

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

*** /tmp/,RCSt1a24987	Fri Aug 23 15:25:01 1991
--- nntpxmit.c	Fri Aug 23 15:21:07 1991
***************
*** 134,137 ****
--- 134,140 ----
  char	*E_fopen = "fopen(%s, \"%s\"): %s";
  char	*E_unlk = "unlink(%s): %s";
+ char	*E_chdir = "chdir(%s): %s";
+ char	*E_getwd = "getwd: %s";
+ char	oldpath[1024];		/* Where we cd back in cleanup */
  
  ll_t	FailedArticles;		/* list of failed articles */
***************
*** 337,344 ****
  	char	*mode = "r";
  #endif	FTRUNCATE
  
  	if ((Qfp = fopen(file, mode)) == (FILE *)NULL) {
- 		char	buf[BUFSIZ];
- 
  		sprintf(buf, E_fopen, file, mode, errmsg(errno));
  		log(L_WARNING, buf);
--- 340,346 ----
  	char	*mode = "r";
  #endif	FTRUNCATE
+ 	char buf[BUFSIZ];
  
  	if ((Qfp = fopen(file, mode)) == (FILE *)NULL) {
  		sprintf(buf, E_fopen, file, mode, errmsg(errno));
  		log(L_WARNING, buf);
***************
*** 375,380 ****
--- 377,397 ----
  		**	iterate to end of queue file
  		*/
+ 		if(getwd(oldpath) == NULL) {
+ 			sprintf(buf, E_getwd, oldpath);
+ 			log(L_WARNING, buf);
+ 			FCLOSE(Qfp);
+ 			return(FALSE);
+ 		}
+ 			
  		catchsig(interrupted);
  
+ 		/* cd to SPOOLDIR so new C News batch files can be handled */
+ 		if(chdir(SPOOLDIR) != 0){
+ 			sprintf(buf, E_chdir, SPOOLDIR, errmsg(errno));
+ 			log(L_WARNING, buf);
+ 			FCLOSE(Qfp);
+ 			return(FALSE);
+ 		}
+ 
  		while((fp = getfp(Qfp, Article, sizeof(Article))) != (FILE *)NULL) {
  			if (!sendarticle(host, fp)) {
***************
*** 826,829 ****
--- 843,853 ----
  	if (Qfp == (FILE *)NULL || Qfile == (char *)NULL)
  		return;
+ 
+ 	if(chdir(oldpath) != 0) {
+ 		char buf[BUFSIZ];
+ 
+ 		sprintf(buf, E_chdir, oldpath, errmsg(errno));
+ 		log(L_WARNING, buf);
+ 	}
  
  	if ((ReQueue_Fails && Stats.failed > 0) || !feof(Qfp)) {
Technical Details
Message-ID: <1991Aug23.135340.25412@ugle.unit.no>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.mbox.zip!gmdzi!unido!unidui!math.fu-berlin.de!ox.com!yale.edu!yale!mintaka!bloom-beacon!eru!hagbard!sunic!ugle.unit.no!spurv.runit.sintef.no!he
References: <1991Aug20.193337.6453@world.std.com> <1991Aug22.153659.11517@ugle.unit.no> <1991Aug22.164742.2641@zoo.toronto.edu>

Show Full Headers
Complete Article Headers
Message-ID: <1991Aug23.135340.25412@ugle.unit.no>
Subject: Re: advance warning of C News changes
Date: Fri, 23 Aug 1991 13:53:40 +0000
From: he@spurv.runit.sintef.no (Havard Eidnes)
References: <1991Aug20.193337.6453@world.std.com> <1991Aug22.153659.11517@ugle.unit.no> <1991Aug22.164742.2641@zoo.toronto.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.mbox.zip!gmdzi!unido!unidui!math.fu-berlin.de!ox.com!yale.edu!yale!mintaka!bloom-beacon!eru!hagbard!sunic!ugle.unit.no!spurv.runit.sintef.no!he
Newsgroups: news.software.b,news.admin,news.software.nntp
Sender: news@ugle.unit.no (NetNews Administrator)
Organization: Computing Center at the University of Trondheim, Norway
Lines: 90