Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site geowhiz.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!uwvax!geowhiz!karsh
From: karsh@geowhiz.UUCP (Bruce Karsh)
Newsgroups: net.news.b
Subject: Re: Anyone else have these problems?
Message-ID: <139@geowhiz.UUCP>
Date: Fri, 12-Oct-84 17:33:49 EDT
Article-I.D.: geowhiz.139
Posted: Fri Oct 12 17:33:49 1984
Date-Received: Sun, 14-Oct-84 04:41:02 EDT
References: <165@scorplx.UUCP> <193@scorplx.UUCP>
Distribution: net
Organization: UW Madison, Geology Dept.
Lines: 64

> 
> Anyway, the problems were:
> 
> > 1)	assuming that a setuid program on a USG system can setuid()
> > 	back after doing a setuid(getuid())... (is this just in SysV,
> > 	or am I the only SysIII site that can't do this?)  The function
> > 	involved is mknewsg() in "inews.c"...
> 
> There were only a few people who replied to this one...  According to
> them, only SysV can setuid back.  One person said they thought only SysV
> release 2 could do this.  Apparently we SysIII sites are out of luck...
> Any suggestions on what to do about this?  Maybe instead of #ifdef USG,
> someone should consider #ifdef SYS3, #ifdef SYSV (or something similiar).
> Comments?
> 
  I didn't really want to respond to this one because I am pretty
new at UUCP and news, but since nobody else did, here goes...

  We had some problems in inews.c on our system.  They had to do with
permissions on files.  I believe that we had the problems that you
are referering to here.  What i did is to take the section in vnews
where the setuid(getuid()) occurs and put it into a fork.

  In addition, I experienced sporadic file linking failures.  So
I added some code to log them more carefully and to retry once.
So far, I've had no cases where more than one retry is required.

  If anyone out there in netland can explain why that is necessary,
I'd like to hear from you.

  We are running on a Masscomp system.  I think it was based on
system III, but I think it has a lot of BSD4.2 stuff in it.

  Here are the diffs:

470,482d469
< /* Debugging code added by BK at UW geowhiz */
< 		else
< 			{
< 			logerr("Failed once %s\n",ARTICLE);
< 		        e = errno;	/* keep log from clobbering it */
< 		        logerr("Error code is %d",e);
<                         if(link(ARTICLE,bfr) == 0)
< 				{
< 				logerr("Succeeded on second try\n",ARTICLE);
< 				break;
< 				}
< 			logerr("Failed twice %s\n",ARTICLE);
< 			}
486,489d472
< /* Debugging code added by BK at UW geowhiz */
< 		logerr("Error code is %d",e);
< 		logerr("ARTICLE is %s",ARTICLE);
< 		logerr("bfr is %s",bfr);
794,796d776
< /* Next two lines added by BK at UW geophysics */
< if((pid-fork())<=0)
<   {
808,812d787
< /* Next four lines added by BK at UW geophysics */
<   exit(0);
<   }
< else
<   fwait(pid);