NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Reverse of promoting to root: downgrade root to unprivileged



On Tue, Jan 30, 2024 at 02:35:02PM +0100, Rhialto wrote:
> On Mon 29 Jan 2024 at 15:23:24 +0100, tlaronde%kergis.com@localhost wrote:
> > The typical example is say, with pkgsrc (or any kind of packages
> > system). One wants to build unprivileged, but installation may be
> > privileged. So instead of running as non root and having to enter the
> > password each time the installation of a dependency requires it, one
> > starts as root, but the privileged rights are only used when needed.
> > (I know that one can build in a chroot unprivileged and so.
> > The curiosity is to know if another way to achieve things has been
> > attempted.)
> 
> This can also be done with sudo (or su), just with the sudo calls placed
> in different locations. That is what the sudo -u parameter is for.  As
> long as the granularity is on process level, su (or sudo) could do it.

That something can be written is sure. But I wondered if there was
some attempt of some library (in whatever language) or some utility
that will "fence" a root user, and will, allow, without modifying
existing (say, as an example, using pkgsrc compilation and
installation procedure), to downgrade root for running and, when
hitting the fence (trying to transgress the rights), will consult a
list of commands---may be script lines: "make install"---and then
respawn the part with updated rights if the commands were listed.

The question arises when I asked (wanting to write something for my
own): OK, but _what_ unprivileged user exists that I can safely "su"
to and accomplish the unprivileged part as? "nobody" does not seem the
answer; "operator" neither. This opened a can of worm-questions ;-)
-- 
        Thierry Laronde <tlaronde +AT+ kergis +dot+ com>
                     http://www.kergis.com/
                    http://kertex.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index