Subject: Re: open_as vs fuid
To: Warner Losh <>
From: Brett Lymn <>
List: tech-kern
Date: 11/06/2000 15:51:46
According to Warner Losh:
>I'd still like to know why code like the following won't work.
>	euid = geteuid();
>	seteuid(getuid());
>	<stuff>
>	seteuid(euid);
>See my previous message for the details as to why I think this will

I am not sure about NetBSD but I have tried this idea on a SunOS
machine and found that some things were checking the ruid regardless
of what the euid was set to (or something like that), and if I tried
setting the ruid then I could not get back to a privileged state.  In
the end I just forked a copy of the program, made all the (r,e)uid's
the unprivileged id and ran what I needed to.  I am not implying that
NetBSD is similarly broken just that this may have caused people to
discard the idea...just a thought.

Brett Lymn, Computer Systems Administrator, BAE SYSTEMS