Subject: Re: open_as vs fuid
To: Todd Vierling <tv@wasabisystems.com>
From: Warner Losh <imp@village.org>
List: tech-kern
Date: 11/05/2000 17:57:06
In message <Pine.NEB.4.21.0011051943220.16520-100000@server.int.duh.org> Todd Vierling writes:
: Has ANYONE in this thread considered that we already have a possibly more
: secure mechanism for this, that could be combined simultaneously with
: authentication for use by a non-suid program?
:
: See unix(4) and its description of passing fd's via a "cmsghdr".
I'm not sure that I see how this would solve the original problem.
Namely, how to safely open an arbitrary file with the original user's
creditials while running at elevated priviledge. The above mechanism
requires a central daemon to do something, which strikes me as adding
a lot of hair to the system.
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
work.
Warner