1 |
interresting aproach. |
2 |
this could work. however, i can see a few limitations: |
3 |
- you must be root. |
4 |
- this is specific to linux as of today. |
5 |
- if you want to hide the mechanism, i don't see how without doing the same portage modifications as in my solution. |
6 |
|
7 |
|
8 |
but this is maybe worth investigating. my solution isn't perfect too, I admit. |
9 |
|
10 |
|
11 |
|
12 |
-------------------------------------------- |
13 |
En date de : Ven 30.3.18, James Le Cuirot <chewi@g.o> a écrit : |
14 |
|
15 |
Objet: Re: [gentoo-dev] Re : Modification proposal for user/group creation when ROOT!="/" |
16 |
À: gentoo-dev@l.g.o |
17 |
Date: Vendredi 30 mars 2018, 21h56 |
18 |
|
19 |
On Fri, 30 Mar 2018 20:47:20 |
20 |
+0100 |
21 |
James Le Cuirot <chewi@g.o> |
22 |
wrote: |
23 |
|
24 |
> On Fri, 30 Mar |
25 |
2018 20:23:49 +0100 |
26 |
> James Le Cuirot |
27 |
<chewi@g.o> |
28 |
wrote: |
29 |
> |
30 |
> > I did |
31 |
just have a lightbulb moment though. I've been playing |
32 |
with |
33 |
> > unshare recently and I |
34 |
wondered if we could leverage it here. |
35 |
> |
36 |
> |
37 |
> > $ sudo unshare -m /bin/sh |
38 |
-c "mount --bind /mnt/somewhere/etc /etc && |
39 |
groupadd foo" |
40 |
> > groupadd: |
41 |
Cannot determine your user name. |
42 |
> |
43 |
> Aha! I was trying to do this against an |
44 |
NFS share for a system with a |
45 |
> different |
46 |
architecture. If I use a local mount with a compatible |
47 |
> architecture, it actually does work. |
48 |
I'll explore this some more. |
49 |
|
50 |
Figured it out! The system I was doing this |
51 |
against has an ancient |
52 |
glibc (long story) |
53 |
with an old nsswitch.conf. I replaced this file with |
54 |
a newer one and it all started working. Do you |
55 |
agree this could be the |
56 |
way forwards? |
57 |
|
58 |
-- |
59 |
James Le Cuirot (chewi) |
60 |
Gentoo Linux |
61 |
Developer |