*BSD News Article 61748


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!newsfeed.internetmci.com!news.mathworks.com!fu-berlin.de!news.belwue.de!news.dfn.de!news.uni-jena.de!news.HRZ.HAB-Weimar.DE!News.HTWM.De!news.tu-chemnitz.de!irz401!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: (getuid() && geteuid())
Date: 19 Feb 1996 23:36:02 GMT
Organization: Private BSD site, Dresden
Lines: 24
Message-ID: <4gb1h2$d34@uriah.heep.sax.de>
References: <4ffe84$ed1@dali.cs.uni-magdeburg.de>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.3

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 ?

What is it supposed to do?  What doesn't work?

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)