Re: BEWARE! Linux seteuid is broken!

really kuznet@ms2.inr.ac.ru (inr-linux-kernel@ms2.inr.ac.ru)
18 Jun 1996 20:23:44 +0400


Stephen R. van den Berg (srb@cuci.NL) wrote:

: I'd say, drop the whole saved [ug]id changes whenever setre[ug]id() are
: called and the world will be a better place.

I thought about it.
The only objection: if not-root set-uid program wants to drop privileges
without exec f.e. before jumping into huge/obscure library,
or if it does not believe itself 8)8) there will be no way to reset suid.
Now it may be done with setreuid(getuid(), getuid()).

Really, setresuid() looks as the most reasonable idea.
(and getresuid()! It was pretty silly not to have getsuid()
function. Yes, and getfsuid(), if we do not want to kill setfsuid())

Alexey Kuznetsov.