Gentoo Archives: gentoo-dev

From: Constanze Hausner <constanze@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] eclass for handling of file-based capabilities
Date: Sun, 06 Mar 2011 16:33:43
Message-Id: 20110306163428.GB14815@totoro.lan.kfr
In Reply to: Re: [gentoo-dev] eclass for handling of file-based capabilities by Ciaran McCreesh
1 On 17:44 Sat 05 Mar , Ciaran McCreesh wrote:
2 > On Sat, 5 Mar 2011 18:41:46 +0100
3 > Constanze Hausner <constanze@g.o> wrote:
4 > > > You're requiring special package manager behaviour if that flag is
5 > > > set?
6 > >
7 > > I'm requiring, that the package manager preserves the xattrs, when
8 > > stripping the binary and when moving it from the sandbox to the
9 > > live-fs.
10 >
11 > Currently we've got wording in PMS forbidding anything from relying
12 > upon xattrs being preserved correctly, since that's what Portage did
13 > when we wrote it. So if you're looking to change that, you'll need to
14 > EAPI control it.
15 Yes, there would be the need for a new EAPI, if the caps should be set
16 from src_install and therefore need to be preserved by the PMS.
17 As long as there is no such garantee one could use the eclass to set the
18 caps from pkg_postinst. I know it's really ugly, but it would be a
19 start. Otherwise we will never be able to use caps.
20
21 > But it's not as simple as just requiring attributes to be preserved in
22 > future EAPIs, since:
23 >
24 > * some xattrs are fs specific
25 >
26 > * some xattrs (selinux?) can't be copied
27 I said something different than I thought, sorry. I only thought of the
28 caps and not other kinds of xattr, as I only require caps to be
29 preserved.
30 Caps do either work on a fs or they don't and they can be copied.
31
32 > * some filesystems don't support xattrs at all, and the package manager
33 > needs to support installing to them, even if the user is building on
34 > a filesystem that does support it
35 That's true, additionaly even if the fs is able to support xattr, there
36 are kernel options, which need to be set. I agree with you, that that's
37 a huge problem. We need to have a good fallback mechanism.
38
39 Zac metioned that we could have three modes for movefile:
40 1) no caps
41 2) tolerant mode, which does not fail if caps could not be copied
42 3) strict mode, which fails if caps can't be copied
43
44 ferringb metioned some kind of marker with which one can indicate xattr
45 support.
46
47 While GSoC I was not able to come up with a good fallback mechanism.
48 I'm going to give the new ideas some thought over the week and hopefully
49 come up with something good :).
50
51 > * tar and xattrs is a massive problem, so how do binaries work?
52 tar can be patched to support xattrs. If we want to use caps, we will
53 have to apply those patches too. (iirc Fedora already uses such
54 patches).
55
56 > I think it'd help if you provided a description of how all the above
57 > (plus the other issues that I've forgotten about) can be handled.
58 I hope I cleared things up at least a bit :).
59
60 Cheers,
61 constanze

Replies

Subject Author
Re: [gentoo-dev] eclass for handling of file-based capabilities Brian Harring <ferringb@×××××.com>
Re: [gentoo-dev] eclass for handling of file-based capabilities "Michał Górny" <mgorny@g.o>