Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: zmedico@g.o
Subject: Re: [gentoo-dev] RFC: Enable FEATURES="userpriv usersandbox" by default?
Date: Tue, 03 Jul 2012 08:03:47
Message-Id: 20120703100244.4bd7a727@pomiocik.lan
In Reply to: Re: [gentoo-dev] RFC: Enable FEATURES="userpriv usersandbox" by default? by Zac Medico
1 On Mon, 02 Jul 2012 13:45:26 -0700
2 Zac Medico <zmedico@g.o> wrote:
3
4 > On 07/02/2012 01:36 PM, vivo75@×××××.com wrote:
5 > > Il 02/07/2012 22:01, Zac Medico ha scritto:
6 > >> On 07/02/2012 12:48 PM, Pacho Ramos wrote:
7 > >>> El lun, 28-05-2012 a las 14:34 -0700, Zac Medico escribió:
8 > >>>> Hi,
9 > >>>>
10 > >>>> In case you aren't familiar with FEATURES=userpriv, here's the
11 > >>>> description from the make.conf(5) man page:
12 > >>>>
13 > >>>> Allow portage to drop root privileges and compile packages as
14 > >>>> portage:portage without a sandbox (unless usersandbox is also
15 > >>>> used).
16 > >>>>
17 > >>>> The rationale for having the separate "usersandbox" setting, to
18 > >>>> enable use of sys-apps/sandbox, is that people who enable
19 > >>>> userpriv sometimes prefer to have sandbox disabled in order to
20 > >>>> slightly improve performance. However, I would recommend to
21 > >>>> enable usersandbox by default, for the purpose of logging
22 > >>>> sandbox violations.
23 > >>>>
24 > >>>> Note that ebuilds can set RESTRICT="userpriv" if they require
25 > >>>> superuser privileges during any of the src_* phases that
26 > >>>> userpriv affects.
27 > >>>>
28 > >>>> I've been using FEATURES="userpriv usersandbox" for years, and I
29 > >>>> don't remember experiencing any problems because of it, so I
30 > >>>> think that it would be reasonable to have it enabled by default.
31 > >>>> Objections?
32 > >>> Looks like non important problems arised and, then, these could
33 > >>> probably be enabled by default, no? :)
34 > >> I'm not sure about the best way to handle migration for directories
35 > >> inside $DISTDIR that are used by live ebuilds, since src_unpack
36 > >> will run with different privileges when userpriv is enabled.
37 > > tell the user to chown/remove the files/directories if and when
38 > > needed,
39 >
40 > How should we tell them? Elog message, news item, or both?
41
42 I think this deserves a news item anyway.
43
44 > > unless there is a very good reason (try) to automate it.
45 >
46 > I guess something like this might work in pkg_postinst of the portage
47 > ebuild:
48 >
49 > find "$DISTDIR" -maxdepth 1 -type d -uid 0 | xargs chown -R
50 > portage:portage
51
52 find "$DISTDIR" -maxdepth 1 -type d -uid 0 -exec \
53 chown -R portage:portage {} +
54
55 > I would only trigger something like this once, when upgrading from a
56 > version that doesn't have userpriv enabled by default.
57
58 This will work only for users who actually keep those in DISTDIR. Some
59 of them actually redefine E*_STORE_DIR to a more sane location. But
60 that's probably irrelevant.
61
62 --
63 Best regards,
64 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies