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: Fri, 30 Mar 2018 19:57:00
Message-Id: 20180330205647.33804c91@symphony.aura-online.co.uk
In Reply to: Re: [gentoo-dev] Re : Modification proposal for user/group creation when ROOT!="/" by James Le Cuirot
1 On Fri, 30 Mar 2018 20:47:20 +0100
2 James Le Cuirot <chewi@g.o> wrote:
3
4 > On Fri, 30 Mar 2018 20:23:49 +0100
5 > James Le Cuirot <chewi@g.o> wrote:
6 >
7 > > I did just have a lightbulb moment though. I've been playing with
8 > > unshare recently and I wondered if we could leverage it here.
9 > >
10 > > $ sudo unshare -m /bin/sh -c "mount --bind /mnt/somewhere/etc /etc && groupadd foo"
11 > > groupadd: Cannot determine your user name.
12 >
13 > Aha! I was trying to do this against an NFS share for a system with a
14 > different architecture. If I use a local mount with a compatible
15 > architecture, it actually does work. I'll explore this some more.
16
17 Figured it out! The system I was doing this against has an ancient
18 glibc (long story) with an old nsswitch.conf. I replaced this file with
19 a newer one and it all started working. Do you agree this could be the
20 way forwards?
21
22 --
23 James Le Cuirot (chewi)
24 Gentoo Linux Developer