🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #641

nntp 1.5.9 SETPROCTITLE stuff

#641
From: Craig Leres
Date: Fri, 10 Aug 1990 23:40
72 lines
2592 bytes
By now, most everyone knows that the SETPROCTITLE code in 1.5.9 can
cause problems with later exec's. This problem would have been easier
to diagnose except that it's hidden by another bug; the "child" can't
syslog() because the syslog socket has been closed. The fix is to
closelog() before the close() loop so that syslog() will know to reopen
its fd the first time it tries to log an error (say with E2BIG after
the exec fails...) Context diffs follow.

		Craig
------
*** spawn.c.old Fri Aug 10 15:43:12 1990
--- spawn.c.new Fri Aug 10 15:47:23 1990
***************
*** 1,5 ****
  #ifndef lint
! static	char	*sccsid = "@(#)$Header: spawn.c,v 1.1 90/07/29 02:15:32 
leres Exp $";
  #endif
  
  #include "common.h"
--- 1,5 ----
  #ifndef lint
! static	char	*sccsid = "@(#)$Header: spawn.c,v 1.1+ 90/07/29 02:15:32
 leres Exp $";
  #endif
  
  #include "common.h"
***************
*** 168,173 ****
--- 168,177 ----
		}
		(void) dup2(1, 2);
  
+ #ifdef SYSLOG
+		/* Close in such a way that syslog() will know to reopen */
+		closelog();
+ #endif
		for (i = 3; i < 10; ++i) /* XXX but getdtablesize is too big */
			(void) close(i);

diff -c batch.c.old batch.c.new
*** batch.c.old Fri Aug 10 15:41:59 1990
--- batch.c.new Fri Aug 10 15:47:16 1990
***************
*** 1,5 ****
  #ifndef lint
! static	char	*rcsid = "@(#)$Header: batch.c,v 1.1 90/07/29 03:06:18 l
eres Exp $";
  #endif
  /*
   * Batch subroutine for Cnews.
--- 1,5 ----
  #ifndef lint
! static	char	*rcsid = "@(#)$Header: batch.c,v 1.1+ 90/07/29 03:06:18 
leres Exp $";
  #endif
  /*
   * Batch subroutine for Cnews.
***************
*** 365,370 ****
--- 365,374 ----
  #endif
  
	/* child: must exit */
+ #ifdef SYSLOG
+	/* Close in such a way that syslog() will know to reopen */
+	closelog();
+ #endif
	for (fd = 3; fd < 20; fd++)
		(void) close(fd);
	if (chdir(INDIR) < 0) {
Technical Details
Message-ID: <6445@helios.ee.lbl.gov>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utstat!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!helios.ee.lbl.gov!ace.ee.lbl.gov!leres

Show Full Headers
Complete Article Headers
Message-ID: <6445@helios.ee.lbl.gov>
Subject: nntp 1.5.9 SETPROCTITLE stuff
Date: Fri, 10 Aug 1990 23:40:30 +0000
From: leres@ace.ee.lbl.gov (Craig Leres)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utstat!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!helios.ee.lbl.gov!ace.ee.lbl.gov!leres
Newsgroups: news.software.nntp
Sender: usenet@helios.ee.lbl.gov
Organization: Lawrence Berkeley Laboratory, Berkeley
Lines: 71
X-Local-Date: 10 Aug 90 16:40:30 PDT