*BSD News Article 61833


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.bhp.com.au!mel.dit.csiro.au!munnari.OZ.AU!news.hawaii.edu!ames!lll-winken.llnl.gov!news.larc.nasa.gov!maui.cc.odu.edu!reliant.cs.odu.edu!bowden
From: Ragnar <bowden@cs.odu.edu>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: (getuid() && geteuid())
Date: Tue, 20 Feb 1996 16:06:35 -0500
Organization: Old Dominion University
Lines: 33
Message-ID: <Pine.3.91.960220155947.24055F-100000@reliant.cs.odu.edu>
References: <4ffe84$ed1@dali.cs.uni-magdeburg.de> <4gb1h2$d34@uriah.heep.sax.de>
NNTP-Posting-Host: reliant.cs.odu.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
In-Reply-To: <4gb1h2$d34@uriah.heep.sax.de> 

On 19 Feb 1996, J Wunsch wrote:

> jesse@csmd.cs.UNI-Magdeburg.DE (Roland Jesse) writes:
> 
> > How may I handle the bug in getuid() and geteuid() that both are always 
> > successful ?
> 
> Huh?  Why do you consider it a bug?  Any process does have a real and
> an effective UID, hence both functions must always be successful!
> 
> > I want to install a little programm to get root-permissions for executing 
> > one command. To check the startup permissions there is a line like:
> > 
> > if (geteuid() && getuid()) (void) exit(1);
> > 
> > This works for SunOS 4.1.3 but doesn't for FreeBSD 2.1.
> > Are there _any_ other ways to go around ?

If the original poster is looking for the latest version of runas, (runas 
<command>, executes as root), he can mail bowden@cs.odu.edu, and I will 
mail the source to him...I have it compiled and working just fine on my 
freebsd 2.1 box at home.  runas is maintained by boyd@ccpo.odu.edu, if 
any additional info is needed.  For those of not familiar with runas, it 
is a replacement for sudo, written a long time ago, rewritten by someone 
here, and last rewrite was done by chris carpinello.  It uses a much 
simpler access file than sudo, and is more secure (imho, but chris is a 
friend, so i gotta trust him. :)  There is a problem with it on SysV 
systems, but it runs and compiles just fine on BSD based systems.

Jamie

I am Lysdexic of Borg, your ass will be laminated.