Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Dec 1997 18:02:02 -0500 (EST)
From:      Evan Champion <evanc@synapse.net>
To:        Brian Somers <brian@awfulhak.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: _POSIX_SAVED_IDS 
Message-ID:  <Pine.BSF.3.96.971206174727.219A-100000@cello.synapse.net>
In-Reply-To: <199712062154.VAA00144@awfulhak.demon.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.971206174727.219A-100000>