Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!nntp.coast.net!howland.reston.ans.net!Germany.EU.net!zib-berlin.de!newsserv.cs.uni-magdeburg.de!dali.cs.uni-magdeburg.de!news From: jesse@csmd49.nntp.cs.UNI-Magdeburg.DE (Roland Jesse) Newsgroups: comp.unix.bsd.freebsd.misc Subject: Re: (getuid() && geteuid()) Date: 20 Feb 1996 14:35:34 GMT Organization: Otto von Guerricke Universitaet Magdeburg Lines: 37 Message-ID: <JESSE.96Feb20153534@csmd49.nntp.cs.UNI-Magdeburg.DE> References: <4ffe84$ed1@dali.cs.uni-magdeburg.de> <4gb1h2$d34@uriah.heep.sax.de> NNTP-Posting-Host: csmd49.cs.uni-magdeburg.de In-reply-to: j@uriah.heep.sax.de's message of 19 Feb 1996 23:36:02 GMT In article <4gb1h2$d34@uriah.heep.sax.de> j@uriah.heep.sax.de (J Wunsch) 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! Okay, not a bug, but the manpage calls it errors. ;) > > 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? As I wrote before. This line should check startup permissions and exit if they are wrong. As far as I understand the code (it is not written by me) this line should check if a user is already root. But it doesn't do that job. So the line doesn't make any sense but checking if the program has the s-Bit set (chmod 4555). But the error was another one - so sorry for my (in this case ;)) superfluous question. Regards, Roland. -- Roland (rj,-) Jesse, stud.rer.nat. et phil. URL: http://www.cs.uni-magdeburg.de/~jesse/ E-Mail: jesse@csmd.cs.uni-magdeburg.de - pgp encrypted mail preferred -