🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #490

NNTP 1.5.8 space checking is broken.

#490
From: News Administration
Date: Sat, 17 Mar 1990 16:01
61 lines
2528 bytes

The 1.5.8 patch for nntp was a real hit. The dfre code looks very
nice now (really). That code verifies that the spool partition is not too full
to accept more articles. What a pity that if/then/else dependenices in C 
are not tabulation sensitive.

(in english: THE CODE TO CHECK FOR FREE SPACE IN 1.5.8 IS BROKEN)

Below is my patch to make this code work again. 

------- ihave.c -------
*** /tmp/da7631	Sat Mar 17 16:52:57 1990
--- ihave.c	Sat Mar 17 14:22:26 1990
***************
*** 74,79 ****
--- 74,81 ----
  
  	if (retcode <= 0){
  		cp = index(errbuf,':');
+ 		if (cp == (char *) NULL)
+ 			cp = "NULL";
  		while (*cp == ' ') cp++;
  		if (strcasecmp(cp,"inbound",7))
  		    printf("%d %s\r\n", ERR_XFERFAIL, errbuf);

------- misc.c -------
*** /tmp/da7634	Sat Mar 17 16:52:59 1990
--- misc.c	Sat Mar 17 16:52:39 1990
***************
*** 788,798 ****
       if (filfree(fsys) < MINFILES )
   	return( DFREE_INODES );
  # endif
!     if (blkavail(fsys) == -1)
! 	/* the bavail field doesn't apply to this file system */
  	if(blkfree(fsys) < free_space)
  	    return( DFREE_BLOCKS );
!      else if (blkavail(fsys) < free_space )
  	    return( DFREE_BLOCKS );
      return( DFREE_OK );
  }
--- 788,801 ----
       if (filfree(fsys) < MINFILES )
   	return( DFREE_INODES );
  # endif
!     if (blkavail(fsys) == -1) {
! #if !defined(sun)
! 	/* on suns this is -1 if the partition is _very_ full. */
  	if(blkfree(fsys) < free_space)
+ #endif
  	    return( DFREE_BLOCKS );
!     }
!     else if (blkavail(fsys) < free_space )
  	    return( DFREE_BLOCKS );
      return( DFREE_OK );
  }
-- 

Toerless Eckert     Internet: eckert@informatik.uni-erlangen.de
                    X.400: /C=de/A=dbp/P=uni-erlangen/OU=informatik/S=eckert/
Technical Details
Message-ID: <2545@medusa.informatik.uni-erlangen.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utstat!helios.physics.utoronto.ca!news-server.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!ira.uka.de!fauern!fauern!news

Show Full Headers
Complete Article Headers
Message-ID: <2545@medusa.informatik.uni-erlangen.de>
Subject: NNTP 1.5.8 space checking is broken.
Date: Sat, 17 Mar 1990 16:01:01 +0000
From: news@medusa.informatik.uni-erlangen.de (News Administration)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utstat!helios.physics.utoronto.ca!news-server.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!ira.uka.de!fauern!fauern!news
Newsgroups: news.software.b,news.software.nntp
Organization: CSD, University of Erlangen, W-Germany
Lines: 60