Subject: install as non-root (was Re: make update hell)
To: Pavel Cahyna <email@example.com>
From: Jeremy C. Reed <firstname.lastname@example.org>
Date: 10/08/2004 09:24:31
On Fri, 8 Oct 2004, Pavel Cahyna wrote:
> (BTW I also don't like that the install is done as root. That way,
> packages can install files elsewhere than they should, overwriting any
> other files, etc. I would prefer building a binary package as non-root
> user, root should only execute the pkg_add command. Sorry for the
It needs root to properly change ownership (and group) of files and for
setuid/setgid, etc. I guess one alternative would be to have a custom
install tool that saved the attributes in an mtree specification and then
use NetBSD's awesome pax to create the tarball using those specifications.
But that would only help with the packages using install. We would have to
patch many other packages that manually use chown, chmod, chgrp, cp, etc.
(Unless we attempted to do wrappers for all those too, but would be
difficult to know if use was for install or not.)
Alternatively, do it all as non-root. Set your SU_CMD and other settings
to do it all as non-root. I do that on a few systems.
Jeremy C. Reed
BSD News, BSD tutorials, BSD links