🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #411

tip doesn't always set uid's properly +FIX

#411
From: Jeff Gilliam
Date: Sat, 15 Nov 1986 01:04
48 lines
1585 bytes
Index: 	usr.bin/tip/acu.c 4.3BSD

Description:
	1) tip can't read a protected /etc/phones file.
	2) tip can't remove the lock file if dialing is aborted.
Repeat-By:
	Use tip.
Fix:

RCS file: RCS/acu.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** /tmp/,RCSt1007279	Fri Nov 14 16:58:24 1986
--- /tmp/,RCSt2007279	Fri Nov 14 16:58:26 1986
***************
*** 62,67 ****
--- 62,69 ----
  			else
  				(*acu->acu_abort)();
  		}
+ 		setreuid(uid, euid);
+ 		setregid(gid, egid);
  		delock(uucplock);
  		exit(1);
  	}
***************
*** 84,93 ****
--- 86,101 ----
  			tried++;
  		}
  	} else {
+ 		setreuid(uid, euid);
+ 		setregid(gid, egid);
  		if ((fd = fopen(PH, "r")) == NOFILE) {
  			printf("%s: ", PH);
+ 			setregid(egid, gid);
+ 			setreuid(euid, uid);
  			return ("can't open phone number file");
  		}
+ 		setregid(egid, gid);
+ 		setreuid(euid, uid);
  		while (fgets(string, sizeof(string), fd) != NOSTR) {
  			for (cp = string; !any(*cp, " \t\n"); cp++)
  				;
-- 

Jeff Gilliam	{ucbvax,pyramid,nsc}!voder!jeff
Technical Details
Message-ID: <2721@voder.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!lll-crg!lll-lcc!pyramid!voder!jeff

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!lll-crg!lll-lcc!pyramid!voder!jeff
From: jeff@voder.UUCP (Jeff Gilliam)
Newsgroups: comp.bugs.4bsd
Subject: tip doesn't always set uid's properly +FIX
Message-ID: <2721@voder.UUCP>
Date: Fri, 14-Nov-86 20:04:38 EST
Article-I.D.: voder.2721
Posted: Fri Nov 14 20:04:38 1986
Date-Received: Sat, 15-Nov-86 05:30:10 EST
Organization: National Semiconductor, Santa Clara
Lines: 48