🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #25816

Re: Enhanced Joe Greco control.cancel patch for inn 1.7.1

#25816
From: Michael Hall
Date: Wed, 04 Feb 1998 00:00
177 lines
6776 bytes
On 3 Feb 1998, Joe Greco wrote:

> :Why on earth release this for 1.7.1 when 1.7.2 is available, and generally
> :considered the preferred version of 1.7?  Or was this just a typo?
> 
> Hey, it's an improvement.  :-)  I only had a 1.5.1 version available.

  Here it is for 1.7.2.insync-1.1d:

*** innd/art.c.ORIG	Mon Jan 26 23:18:37 1998
--- innd/art.c	Thu Jan 29 14:19:22 1998
***************
*** 1735,1740 ****
--- 1735,1741 ----
  {
      static BUFFER	Files;
      static BUFFER	Header;
+     static char		ngpDir[SPOOLNAMEBUFF];
      static char		buff[SPOOLNAMEBUFF];
      static char		path[MAXHEADERSIZE];
      register char	*p;
***************
*** 2197,2210 ****
  	    continue;
  	ngp->PostCount = 0;
  
  	if (Data.Name[0] == '\0') {
  #if	defined(TIMER)
  	    TMRstart(TMR_ARTWRITE);
  #endif /* defined(TIMER) */
  	    /* Write the article the first time. */
! 	    (void)sprintf(Data.Name, "%s/%lu", ngp->Dir, ngp->Filenum);
  	    if (ARTwrite(Data.Name, article, &Data) < 0
! 	     && (!MakeSpoolDirectory(ngp->Dir)
  	      || ARTwrite(Data.Name, article, &Data) < 0)) {
  		i = errno;
  		syslog(L_ERROR, "%s cant write %s %m", LogName, Data.Name);
--- 2198,2220 ----
  	    continue;
  	ngp->PostCount = 0;
  
+         if (! strcmp(ngp->Dir, "control/cancel")) {
+                 /* Use modified directory format - breaks nnrpd, etc.,
+                    but we don't give a rip */
+                 sprintf(ngpDir, "%s/%02d/%02d", ngp->Dir, (ngp->Filenum / 10000) % 100, (ngp->Filenum / 100) % 100);
+         } else {
+                 /* Use standard directory format */
+                 sprintf(ngpDir, "%s", ngp->Dir);
+         }
+ 
  	if (Data.Name[0] == '\0') {
  #if	defined(TIMER)
  	    TMRstart(TMR_ARTWRITE);
  #endif /* defined(TIMER) */
  	    /* Write the article the first time. */
! 	    (void)sprintf(Data.Name, "%s/%lu", ngpDir, ngp->Filenum);
  	    if (ARTwrite(Data.Name, article, &Data) < 0
! 	     && (!MakeSpoolDirectory(ngpDir)
  	      || ARTwrite(Data.Name, article, &Data) < 0)) {
  		i = errno;
  		syslog(L_ERROR, "%s cant write %s %m", LogName, Data.Name);
***************
*** 2235,2243 ****
  	    TMRstart(TMR_ARTLINK);
  #endif	/* defined(TIMER) */
  	    /* Link to the main article. */
! 	    (void)sprintf(linkname, "%s/%lu", ngp->Dir, ngp->Filenum);
  	    if (DoLinks && link(Data.Name, linkname) < 0
! 	     && (!MakeSpoolDirectory(ngp->Dir)
  	      || link(Data.Name, linkname) < 0)) {
  #if	defined(DONT_HAVE_SYMLINK)
  		oerrno = errno;
--- 2245,2253 ----
  	    TMRstart(TMR_ARTLINK);
  #endif	/* defined(TIMER) */
  	    /* Link to the main article. */
! 	    (void)sprintf(linkname, "%s/%lu", ngpDir, ngp->Filenum);
  	    if (DoLinks && link(Data.Name, linkname) < 0
! 	     && (!MakeSpoolDirectory(ngpDir)
  	      || link(Data.Name, linkname) < 0)) {
  #if	defined(DONT_HAVE_SYMLINK)
  		oerrno = errno;
***************
*** 2249,2255 ****
  		/* Try to make a symbolic link to the full pathname. */
  		FileGlue(buff, SPOOL, '/', Data.Name);
  		if (symlink(buff, linkname) < 0
! 		 && (!MakeSpoolDirectory(ngp->Dir)
  		  || symlink(buff, linkname) < 0)) {
  		    oerrno = errno;
  		    syslog(L_ERROR, "%s cant symlink %s and %s %m",
--- 2259,2265 ----
  		/* Try to make a symbolic link to the full pathname. */
  		FileGlue(buff, SPOOL, '/', Data.Name);
  		if (symlink(buff, linkname) < 0
! 		 && (!MakeSpoolDirectory(ngpDir)
  		  || symlink(buff, linkname) < 0)) {
  		    oerrno = errno;
  		    syslog(L_ERROR, "%s cant symlink %s and %s %m",
*** expire/expire.c.ORIG	Mon Jan 26 23:34:18 1998
--- expire/expire.c	Mon Jan 26 23:38:27 1998
***************
*** 540,546 ****
      }
      *p = '\0';
      if ((ngp = NGfind(Entry)) == NULL)
! 	ngp = EXPnotfound(Entry);
      *p = '/';
  
      /* Bad posting date? */
--- 540,549 ----
      }
      *p = '\0';
      if ((ngp = NGfind(Entry)) == NULL)
!         if (EQn(Entry, "control.cancel", STRLEN("control.cancel")))
!             ngp = NGfind("control.cancel");
!     if (ngp == NULL)
!         ngp = EXPnotfound(Entry);
      *p = '/';
  
      /* Bad posting date? */
*** expire/expireover.c.ORIG	Mon Jan 26 23:34:30 1998
--- expire/expireover.c	Mon Jan 26 23:41:34 1998
***************
*** 813,818 ****
--- 813,820 ----
  	    if ((p = strrchr(line, '/')) == NULL)
  		continue;
  	    *p++ = '\0';
+ 	    if (EQn(line, "control/cancel", 14))
+ 	        continue;
  	    if (List.Used == 0) {
  		(void)strcpy(group, line);
  		List.Used = 0;
***************
*** 847,852 ****
--- 849,856 ----
  	    if ((p = strrchr(line, '/')) == NULL)
  		continue;
  	    *p++ = '\0';
+             if (EQn(line, "control/cancel", 14))
+                 continue;
  	    List.Articles[0] = atol(p);
  	    RemoveLines(line, &List);
  	}
*** backends/overchan.c.ORIG	Mon Jan 26 23:42:22 1998
--- backends/overchan.c	Mon Jan 26 23:45:24 1998
***************
*** 225,231 ****
  	    *Art++ = '\0';
  
  	    /* Write data. */
! 	    if (!WriteData(Dir, Art, Rest, FALSE)
  	     && (!MakeOverDir(Dir) || !WriteData(Dir, Art, Rest, TRUE)))
  		(void)fprintf(stderr, "overchan cant update %s %s\n",
  			Dir, strerror(errno));
--- 225,232 ----
  	    *Art++ = '\0';
  
  	    /* Write data. */
!             if (!EQ(Dir,"control/cancel") &&
!                 !WriteData(Dir, Art, Rest, FALSE)
  	     && (!MakeOverDir(Dir) || !WriteData(Dir, Art, Rest, TRUE)))
  		(void)fprintf(stderr, "overchan cant update %s %s\n",
  			Dir, strerror(errno));
--------------
 
--
Mike Hall <mhall@rockisland.com>    *nix, Perl, CGI hacker...
P.O. Box 1065                       Certified OS/2 Specialist
Friday Harbor, WA 98250             Sorry, no Win* :-)
***---***---***---***---***---***---***---***---***---***
To get my PGP key send email with Subject: Request PGP key


Technical Details
Message-ID: <Pine.LNX.3.96.980204001454.21771A-100000@ukiah.riverside.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <6ah8dg$hik$1@canopus.cc.umanitoba.ca> <34cf4cd7.439793069@news.rdc1.sfba.home.com> <6b81hd$b25@newsops.execpc.com>

Show Full Headers
Complete Article Headers
Message-ID: <Pine.LNX.3.96.980204001454.21771A-100000@ukiah.riverside.org>
Subject: Re: Enhanced Joe Greco control.cancel patch for inn 1.7.1
Date: Wed, 04 Feb 1998 00:00:00 +0000
From: Michael Hall <mike@ukiah.riverside.org>
References: <6ah8dg$hik$1@canopus.cc.umanitoba.ca> <34cf4cd7.439793069@news.rdc1.sfba.home.com> <6b81hd$b25@newsops.execpc.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 321938371
Mime-Version: 1.0
Reply-To: mhall@rockisland.com
To: Joe Greco <jgreco@ns.sol.net>
Content-Type: TEXT/PLAIN; charset=US-ASCII
Organization: Riverside BBS
Newsgroups: news.software.nntp