Gentoo Archives: gentoo-dev

From: James Le Cuirot <chewi@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re : Modification proposal for user/group creation when ROOT!="/"
Date: Sat, 31 Mar 2018 10:06:51
Message-Id: 20180331110632.66da870b@symphony.aura-online.co.uk
In Reply to: Re: [gentoo-dev] Re : Modification proposal for user/group creation when ROOT!="/" by Farid BENAMROUCHE
1 On Sat, 31 Mar 2018 09:39:47 +0000 (UTC)
2 Farid BENAMROUCHE <fariouche@×××××.fr> wrote:
3
4 > interresting aproach.
5 > this could work. however, i can see a few limitations:
6 > - you must be root.
7
8 Actually you don't if you add -r to unshare, which gives you what is
9 sometimes called fakeroot. Obviously you still can't modify the files
10 if they are really owned by root but that's true of any solution.
11
12 > - this is specific to linux as of today.
13
14 True and I am only interested in Linux but I like to play nice. Other
15 platforms could potentially still briefly bind mount but it wouldn't be
16 isolated from the other processes so it wouldn't be entirely safe. Safe
17 enough though? You'd need to weigh this up against how many people use
18 ROOT!=/ on other platforms. Not many at all, I imagine.
19
20 > - if you want to hide the mechanism, i don't see how without doing
21 > the same portage modifications as in my solution.
22
23 You could handle this in the eclass functions but as you pointed out,
24 many things call chown/chgrp directly. Usage by ebuilds themselves can
25 be addressed but if a build system calls these then eclass functions
26 will not help. What would work is adding some identically-named
27 wrappers to the PATH.
28
29 --
30 James Le Cuirot (chewi)
31 Gentoo Linux Developer