Gentoo Archives: gentoo-dev

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Impl. egetent in user.eclass using script from sys-apps/getent?
Date: Wed, 10 Jun 2015 18:49:13
Message-Id: robbat2-20150610T180514-382866925Z@orbis-terrarum.net
In Reply to: [gentoo-dev] Impl. egetent in user.eclass using script from sys-apps/getent? by Joakim Tjernlund
1 On Wed, Jun 10, 2015 at 04:44:17PM +0000, Joakim Tjernlund wrote:
2 > I wonder if it would be possible to use the script from sys-apps/getent(included below)
3 > to impl. getent in user.eclass instead of using glibc's getent? I
4 > cannot see any downside, is there one?
5 >
6 > This would help a lot(just seed your groups/users is in ROOT/etc/{passwd,group ...} first)
7 > when cross building or ROOT != / as it would be trivial for the script to respect ROOT/EPREFIX
8 This would totally break when those services come from an NSS provider
9 other than files or compat.
10
11 There was a non-upstream patch to support NSS on non-root filesystems,
12 which would probably help a lot more; I haven't seen that original patch
13 in a while, so here's a very quick and completely untested
14 re-implementation of it.
15
16 In your case, you probably should MAKE sure that regardless of the
17 system nsswitch settings, the NSS file provider gets used.
18
19 Usage: NSS_FILES_ROOT=$ROOT/etc getent -s files passwd ...
20
21 --
22 Robin Hugh Johnson
23 Gentoo Linux: Developer, Infrastructure Lead
24 E-Mail : robbat2@g.o
25 GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85

Attachments

File name MIME type
glibc-2.21-nss_files_root.patch text/x-diff

Replies

Subject Author
Re: [gentoo-dev] Impl. egetent in user.eclass using script from sys-apps/getent? Joakim Tjernlund <joakim.tjernlund@×××××××××.se>