🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #730

nntp-1.5.8 server/spawn.c patch for stupid exec's

#730
From: Simon J. Gerraty
Date: Fri, 05 Oct 1990 01:17
27 lines
1574 bytes
Some UNIX systems cannot handle exec'ing a shell script.
These are usually the same systems whose shell's do not grok #!/bin/sh
The following simple patch, handles the case where execl fails due to ENOEXEC
and simply punts the thing to /bin/sh to try.

*** spawn.c~1~	Thu Oct  4 14:34:50 1990
--- spawn.c	Thu Oct  4 15:09:14 1990
***************
*** 164,169 ****
--- 164,175 ----
  		}
  
  		execl(path, name, flag, (char *) NULL);
+ 		/*
+ 		 * 90-10-04 <sjg@melb.bull.oz.au>
+ 		 * stupid exec()'s barf trying to exec a shell script!
+ 		 */
+ 		if (errno == ENOEXEC)
+ 		  execl("/bin/sh", "-c", path, flag, (char *) NULL);
  		fprintf(stderr, "spawn: execl ");
  		perror(path);
  		_exit(-1);	/* Error */
--
Simon J. Gerraty			<sjg@sun0.melb.bull.oz.au>

#include <disclaimer>             /* imagine something *very* witty here */
Technical Details
Message-ID: <1990Oct5.011738.9167@melb.bull.oz.au>
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!math.lsa.umich.edu!zaphod.mps.ohio-state.edu!usc!hacgate!ladcgw.ladc.bull.com!melb.bull.oz.au!taureau.melb.bull.oz.au!sun0!sjg

Show Full Headers
Complete Article Headers
Message-ID: <1990Oct5.011738.9167@melb.bull.oz.au>
Subject: nntp-1.5.8 server/spawn.c patch for stupid exec's
Date: Fri, 05 Oct 1990 01:17:38 +0000
From: sjg@sun0.melb.bull.oz.au (Simon J. Gerraty)
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!math.lsa.umich.edu!zaphod.mps.ohio-state.edu!usc!hacgate!ladcgw.ladc.bull.com!melb.bull.oz.au!taureau.melb.bull.oz.au!sun0!sjg
Newsgroups: news.software.nntp
Sender: news@melb.bull.oz.au (USENET News Account)
Organization: Bull HN Information Systems Australia
Lines: 26