🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #5937

Re: Unoff4 -- patch to fix crosspost

#5937
From: Jerry Aguirre
Date: Sat, 23 Mar 1996 00:00
78 lines
3062 bytes
If you get "file already exists" then most likely you didn't envoke innd
with the -l option.

In article <4ie1d1$cm1@netnews.nctu.edu.tw> chen@cc.nctu.edu.tw (C.S.Chen) writes:
>-----------------------------------------------------------------------------
>crosspost cant symlink /var/spool/news/comp/binaries/mac/3677 comp/sources/mac/143 : No such file or directory
>... [delete]
>-----------------------------------------------------------------------------

This is a genuine bug.  Not likely to hit this often on a normal server
as by the time someone crossposts there typically has been a direct
posting.  On the other hand if you are re-creating a spool or regularly
remove empty directories this could hit you.

The patch to fix crosspost follows:
*** backends/crosspost.c.bak	Tue Feb  6 11:18:28 1996
--- backends/crosspost.c	Thu Mar 21 10:57:58 1996
***************
*** 51,58 ****
  
  
  /*
! **  Make spool directory.  Return 0 if ok,
! **  else -1.
  */
  STATIC BOOL
  MakeSpoolDir(Name)
--- 51,57 ----
  
  
  /*
! **  Make spool directory.  Return FALSE on error.
  */
  STATIC BOOL
  MakeSpoolDir(Name)
***************
*** 61,69 ****
      register char	*p;
      BOOL		made;
  
-     if (InSpoolDir)
- 	return FALSE;
- 
      /* Optimize common case -- parent almost always exists. */
      if (MakeDir(Name))
  	return TRUE;
--- 60,65 ----
***************
*** 140,151 ****
  		for (j--; (j > 0) && (path[j] != '/'); j--) ;
  		if (path[j] == '/') {
  		    path[j] = '\0';
! 		    if (MakeSpoolDir(path)) { /* try making parent dir */
  			(void)fprintf(stderr, "crosspost cant mkdir %s\n",
  				path);
  		    }
  		    else {
! 			if (link(names[0], names[i]) < 0) { /* 2nd try to link */
  #if	defined(DONT_HAVE_SYMLINK)
  			    (void)fprintf(stderr, "crosspost cant link %s %s",
  				names[0], names[i]);
--- 136,149 ----
  		for (j--; (j > 0) && (path[j] != '/'); j--) ;
  		if (path[j] == '/') {
  		    path[j] = '\0';
! 		    /* try making parent dir */
! 		    if (MakeSpoolDir(path) == FALSE) {
  			(void)fprintf(stderr, "crosspost cant mkdir %s\n",
  				path);
  		    }
  		    else {
! 			/* 2nd try to link */
! 			if (link(names[0], names[i]) < 0) {
  #if	defined(DONT_HAVE_SYMLINK)
  			    (void)fprintf(stderr, "crosspost cant link %s %s",
  				names[0], names[i]);

Technical Details
Message-ID: <4ivrh8$crn@olivea.ATC.Olivetti.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
References: <4id42v$b56@marge.eaglequest.com> <4ie1d1$cm1@netnews.nctu.edu.tw>

Show Full Headers
Complete Article Headers
Message-ID: <4ivrh8$crn@olivea.ATC.Olivetti.Com>
Subject: Re: Unoff4 -- patch to fix crosspost
Date: Sat, 23 Mar 1996 00:00:00 +0000
From: jerry@strobe.ATC.Olivetti.Com (Jerry Aguirre)
References: <4id42v$b56@marge.eaglequest.com> <4ie1d1$cm1@netnews.nctu.edu.tw>
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: 143808997
Organization: Olivetti ATC; Cupertino, CA; USA
Newsgroups: news.software.nntp
Summary: Patch so the crosspost channel feed will create directories