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
1 On Wed, 2007-04-11 at 15:10 +0200, Fabian Groffen wrote:
2 > Just putting in my two cents:
3 >
4 > I think we should either make functions that do the chown stuff, like
5 > fperms does, or add functions like get_root_uid. If the permissions are
6 > set, this usually means they aren't set correctly from the ebuild
7 > perspective. portage_uid != root_uid, but a function like get_root_uid
8 > could easily do some if-ing on platforms, and also get around the ugly 0
9 > workaround for Solaris/Darwin/FreeBSD where the root group is not
10 > 'root', but sys, wheel, or whatever.
11 >
12 >
13 > On 11-04-2007 09:04:29 -0400, Armando Di Cianno wrote:
14 > > -----BEGIN PGP SIGNED MESSAGE-----
15 > > Hash: SHA1
16 > >
17 > >
18 > > On Apr 11, 2007, at 6:05 AM, Michael Haubenwallner wrote:
19 > > > Thing is that 'chown -R root:0' works on linux, while on non-linux it
20 > > > does not.
21 > > >
22 > > > I'm unsure how to do in prefix:
23 > > > 1) avoid chown in prefix (as the patch does currently)
24 > > > 2) chown to "$PORTAGE_INST_USER:$PORTAGE_INST_GID" instead of "root:0"
25 > >
26 > > This has been perennial question for me, since I starting moving many
27 > > ebuilds to prefix, so I'd like to start a discussion on it.
28 > >
29 > > Obviously, user-privilege use of prefix-portage is sort the main way, as far
30 > > as I can tell, that people use it right now. As a hack -- and as I mainly
31 > > work on Darwin, atm -- I've been wrapping or skipping
32 > > chown/chmod/fperms/etceteras calls in 'if [ "${KERNEL}" == "Darwin" ]', and
33 > > ewarn'ng that "this operation is not happening'. This has worked -- as a
34 > > hack --but raises some questions: if a package requires a change of
35 > > permission for security reasons, especially, it can be considered blatantly
36 > > wrong to _not_ be doing the change of permissions.
37 > >
38 > > Also, I'd like prefix-portage to work in the classic way as root, or with
39 > > sudo, as well as fully working for a normal, non-privileged user.
40
41 What if we use "$PORTAGE_INST_UID:$PORTAGE_INST_GID" where currently
42 "root:0" is used.
43 On native Gentoo-Linux, these are set to "0:0" in /etc/make.globals.
44 Note that I did not find PORTAGE_INST_USER here - is this an extension
45 of prefix-portage ?
46
47 For using prefix as 'root', set them to '0:0' too, and when using prefix
48 as user, set them to '<myuid>:<mygid>'. Portage has some configure-args
49 to set the defaults into installed make.defaults IIRC.
50
51 Don't know on how to do with "root:man" and the like:
52
53 If being used as 'root', creating users and groups might be possible,
54 but I'm unsure if it makes sense at all, as the uid's and gid's of
55 existing users/groups may vary.
56
57 /haubi/
58
59
60 Salomon Automation GmbH - Friesachstraße 15 - A-8114 Friesach bei Graz
61 Sitz der Gesellschaft: Friesach bei Graz
62 UID-NR:ATU28654300 - Firmenbuchnummer: 49324 K
63 Firmenbuchgericht: Landesgericht für Zivilrechtssachen Graz
64
65 --
66 gentoo-alt@g.o mailing list

Replies