Gentoo Archives: gentoo-dev

From: "vivo75@×××××.com" <vivo75@×××××.com>
To: gentoo-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: Re: [gentoo-dev] RFC: Enable FEATURES="userpriv usersandbox" by default?
Date: Tue, 03 Jul 2012 08:12:21
Message-Id: 4FF2A92C.3040105@gmail.com
In Reply to: Re: [gentoo-dev] RFC: Enable FEATURES="userpriv usersandbox" by default? by Zac Medico
1 Il 02/07/2012 22:45, Zac Medico ha scritto:
2 > On 07/02/2012 01:36 PM, vivo75@×××××.com wrote:
3 >> Il 02/07/2012 22:01, Zac Medico ha scritto:
4 >>> On 07/02/2012 12:48 PM, Pacho Ramos wrote:
5 >>>> El lun, 28-05-2012 a las 14:34 -0700, Zac Medico escribió:
6 >>>>> Hi,
7 >>>>>
8 >>>>> In case you aren't familiar with FEATURES=userpriv, here's the
9 >>>>> description from the make.conf(5) man page:
10 >>>>>
11 >>>>> Allow portage to drop root privileges and compile packages as
12 >>>>> portage:portage without a sandbox (unless usersandbox is also used).
13 >>>>>
14 >>>>> The rationale for having the separate "usersandbox" setting, to enable
15 >>>>> use of sys-apps/sandbox, is that people who enable userpriv sometimes
16 >>>>> prefer to have sandbox disabled in order to slightly improve
17 >>>>> performance. However, I would recommend to enable usersandbox by
18 >>>>> default, for the purpose of logging sandbox violations.
19 >>>>>
20 >>>>> Note that ebuilds can set RESTRICT="userpriv" if they require superuser
21 >>>>> privileges during any of the src_* phases that userpriv affects.
22 >>>>>
23 >>>>> I've been using FEATURES="userpriv usersandbox" for years, and I don't
24 >>>>> remember experiencing any problems because of it, so I think that it
25 >>>>> would be reasonable to have it enabled by default. Objections?
26 >>>> Looks like non important problems arised and, then, these could probably
27 >>>> be enabled by default, no? :)
28 >>> I'm not sure about the best way to handle migration for directories
29 >>> inside $DISTDIR that are used by live ebuilds, since src_unpack will run
30 >>> with different privileges when userpriv is enabled.
31 >> tell the user to chown/remove the files/directories if and when needed,
32 > How should we tell them? Elog message, news item, or both?
33 both seem reasonable, additionally emerge will and should fail when it
34 meet a incorrect owned directory, the most sensitive place where to
35 output the message is exactly there if possible.
36 "Failed to update $DIR, check permission and/or correctness, as a last
37 resort remove it" something like this, written by someone who speak english.
38 >> unless there is a very good reason (try) to automate it.
39 > I guess something like this might work in pkg_postinst of the portage
40 > ebuild:
41 >
42 > find "$DISTDIR" -maxdepth 1 -type d -uid 0 | xargs chown -R
43 > portage:portage
44 >
45 > I would only trigger something like this once, when upgrading from a
46 > version that doesn't have userpriv enabled by default.
47 baaaaa, I've totally inverted the logic, it was meant "do _not_
48 automate it", even if the chown work flawlessy it become additional
49 cruft that will be forever with us.
50
51 thanks,
52 Francesco