From owner-freebsd-current Sat Dec 6 15:02:20 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA21797 for current-outgoing; Sat, 6 Dec 1997 15:02:20 -0800 (PST) (envelope-from owner-freebsd-current) Received: from conductor.synapse.net (conductor.synapse.net [199.84.54.18]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id PAA21784 for ; Sat, 6 Dec 1997 15:02:13 -0800 (PST) (envelope-from evanc@synapse.net) Received: (qmail 25630 invoked from network); 6 Dec 1997 23:02:03 -0000 Received: from cello.synapse.net (199.84.54.81) by conductor.synapse.net with SMTP; 6 Dec 1997 23:02:03 -0000 Date: Sat, 6 Dec 1997 18:02:02 -0500 (EST) From: Evan Champion To: Brian Somers cc: freebsd-current@freebsd.org Subject: Re: _POSIX_SAVED_IDS In-Reply-To: <199712062154.VAA00144@awfulhak.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Sat, 6 Dec 1997, Brian Somers wrote: > AFAIK, setreuid() doesn't use saved ids - setreuid() should only be > used to swap your euid and uid. Disclaimer - this is an assumption, > I may be wrong. It does check the saved-set to see if you should be able to setreuid(), but does not touch the saved-set IDs. However, this wasn't what I was trying to imply; setuid() and setreuid() are in the same file (sys/kern/kern_prot.c) and while looking for setreuid() I passed through setuid() where the _POSIX_SAVED_IDS #ifdefs are... The reason behind all this is that the BSD/OS setreuid() doesn't seem to do what it's supposed to which breaks Kerberos 5. Interestingly enough, on BSD/OS 3.1, setreuid(r,e) is just a wrapper around seteuid(e). Even more interesting, in the compat libraries there is a setruid() which uses setreuid() to set the real UID -- but setreuid() is seteuid() so the real ID is never changed :-) Here's a problem for you: on systems where I have a saved-set seteuid(), I would prefer to use it instead of a setreuid() swap. How do I tell if I have a saved-set seteuid() if _POSIX_SAVED_IDS is not defined (besides running a setuid test program -- I'd prefer something that autoconf could figure out on its own)? Evan