Gentoo Archives: gentoo-alt

From: Armando Di Cianno <armando@××××××××.net>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] [prefix][linux] permission problem merging apr-util on linux
Date: Wed, 11 Apr 2007 13:05:59
Message-Id: 65C28055-78BE-4C3C-A87E-50DC34F9A92B@goodship.net
In Reply to: [gentoo-alt] [prefix][linux] permission problem merging apr-util on linux by Michael Haubenwallner
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4
5 On Apr 11, 2007, at 6:05 AM, Michael Haubenwallner wrote:
6 > Thing is that 'chown -R root:0' works on linux, while on non-linux it
7 > does not.
8 >
9 > I'm unsure how to do in prefix:
10 > 1) avoid chown in prefix (as the patch does currently)
11 > 2) chown to "$PORTAGE_INST_USER:$PORTAGE_INST_GID" instead of "root:0"
12
13 This has been perennial question for me, since I starting moving many
14 ebuilds to prefix, so I'd like to start a discussion on it.
15
16 Obviously, user-privilege use of prefix-portage is sort the main way,
17 as far as I can tell, that people use it right now. As a hack -- and
18 as I mainly work on Darwin, atm -- I've been wrapping or skipping
19 chown/chmod/fperms/etceteras calls in 'if [ "${KERNEL}" ==
20 "Darwin" ]', and ewarn'ng that "this operation is not happening'.
21 This has worked -- as a hack --but raises some questions: if a
22 package requires a change of permission for security reasons,
23 especially, it can be considered blatantly wrong to _not_ be doing
24 the change of permissions.
25
26 Also, I'd like prefix-portage to work in the classic way as root, or
27 with sudo, as well as fully working for a normal, non-privileged user.
28
29 Now, a number of packages simply want to ensure that they have a user
30 to run as, and the directories/homes/whatever are owned by that
31 user. In this case, working with user privileges, it's easy enough
32 to ensure installed files bear the permissions of the user running
33 emerge.
34
35 For packages that practically *require* permission changes, I suggest
36 something like the following; if we can inject userpriv as the
37 'default' into FEATURES, we can simply RESTRICT these temperamental-
38 security-wise ebuilds with userpriv.
39
40 If we do something like the above, we can easily move all the chown/
41 chmod/fperms calls to "echown, echmod, efperms" and have these
42 decisions happen in the background (or tossing an error that sudo is
43 required or something).
44
45 Specifics aside, I'd like to know if this is generally the idea most
46 of us have in our heads about how prefix-portage should work. And
47 then, specifically, I wonder if we can co-opt 'userpriv' in that way,
48 since it seems pretty apt to be used in this fashion.
49
50 __armando
51 aka fafhrd
52
53 -----BEGIN PGP SIGNATURE-----
54 Version: GnuPG v1.4.6 (Darwin)
55
56 iD8DBQFGHNzg1uuRqaoClwIRAhBUAJoCap/qHrjoWgmqX13hUmNhTFWHEgCeJT3D
57 AlUApd1EWMQ1DhskjYjVvP4=
58 =s+bC
59 -----END PGP SIGNATURE-----
60 --
61 gentoo-alt@g.o mailing list

Replies