Gentoo Archives: gentoo-alt

From: Michael Haubenwallner <michael.haubenwallner@×××××××.at>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] [prefix][linux] permission problem mergingapr-util on linux
Date: Wed, 11 Apr 2007 14:00:28
Message-Id: 1176299756.11181.77.camel@sapc154
In Reply to: Re: [gentoo-alt] [prefix][linux] permission problem merging apr-util on linux by Fabian Groffen
On Wed, 2007-04-11 at 15:10 +0200, Fabian Groffen wrote:
> Just putting in my two cents: > > I think we should either make functions that do the chown stuff, like > fperms does, or add functions like get_root_uid. If the permissions are > set, this usually means they aren't set correctly from the ebuild > perspective. portage_uid != root_uid, but a function like get_root_uid > could easily do some if-ing on platforms, and also get around the ugly 0 > workaround for Solaris/Darwin/FreeBSD where the root group is not > 'root', but sys, wheel, or whatever. > > > On 11-04-2007 09:04:29 -0400, Armando Di Cianno wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > > > On Apr 11, 2007, at 6:05 AM, Michael Haubenwallner wrote: > > > Thing is that 'chown -R root:0' works on linux, while on non-linux it > > > does not. > > > > > > I'm unsure how to do in prefix: > > > 1) avoid chown in prefix (as the patch does currently) > > > 2) chown to "$PORTAGE_INST_USER:$PORTAGE_INST_GID" instead of "root:0" > > > > This has been perennial question for me, since I starting moving many > > ebuilds to prefix, so I'd like to start a discussion on it. > > > > Obviously, user-privilege use of prefix-portage is sort the main way, as far > > as I can tell, that people use it right now. As a hack -- and as I mainly > > work on Darwin, atm -- I've been wrapping or skipping > > chown/chmod/fperms/etceteras calls in 'if [ "${KERNEL}" == "Darwin" ]', and > > ewarn'ng that "this operation is not happening'. This has worked -- as a > > hack --but raises some questions: if a package requires a change of > > permission for security reasons, especially, it can be considered blatantly > > wrong to _not_ be doing the change of permissions. > > > > Also, I'd like prefix-portage to work in the classic way as root, or with > > sudo, as well as fully working for a normal, non-privileged user.
What if we use "$PORTAGE_INST_UID:$PORTAGE_INST_GID" where currently "root:0" is used. On native Gentoo-Linux, these are set to "0:0" in /etc/make.globals. Note that I did not find PORTAGE_INST_USER here - is this an extension of prefix-portage ? For using prefix as 'root', set them to '0:0' too, and when using prefix as user, set them to '<myuid>:<mygid>'. Portage has some configure-args to set the defaults into installed make.defaults IIRC. Don't know on how to do with "root:man" and the like: If being used as 'root', creating users and groups might be possible, but I'm unsure if it makes sense at all, as the uid's and gid's of existing users/groups may vary. /haubi/ Salomon Automation GmbH - Friesachstraße 15 - A-8114 Friesach bei Graz Sitz der Gesellschaft: Friesach bei Graz UID-NR:ATU28654300 - Firmenbuchnummer: 49324 K Firmenbuchgericht: Landesgericht für Zivilrechtssachen Graz -- gentoo-alt@g.o mailing list