Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/
Date: Mon, 13 Nov 2017 23:26:11
Message-Id: 1510615559.66b10cf352d69a96824cba2c2a2bdea8e8094d7b.slyfox@gentoo
1 commit: 66b10cf352d69a96824cba2c2a2bdea8e8094d7b
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 13 23:23:10 2017 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 13 23:25:59 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66b10cf3
7
8 sys-libs/glibc: guard against rendering system unusable, bug #627338
9
10 For cases like FEATURES=config-protect-if-modified
11 or custom /etc/nsswitch.conf with only 'compat' resolver
12 and external providers glibc upgrade will break local
13 user resolution when switching from older glibc.
14
15 Bad /etc/nsswitch.conf:
16 passwd: compat
17 shadow: compat
18 group: compat
19
20 Good /etc/nsswitch.conf:
21 passwd: files
22 shadow: files
23 group: files
24
25 Ok /etc/nsswitch.conf:
26 passwd: compat files
27 shadow: compat files
28 group: compat files
29
30 More up-to-date doc:
31 https://wiki.gentoo.org/wiki/Project:Toolchain/nsswitch.conf_in_glibc-2.26
32
33 Bug: https://bugs.gentoo.org/627338
34 Package-Manager: Portage-2.3.13, Repoman-2.3.4
35
36 sys-libs/glibc/glibc-2.26-r3.ebuild | 15 +++++++++++++++
37 1 file changed, 15 insertions(+)
38
39 diff --git a/sys-libs/glibc/glibc-2.26-r3.ebuild b/sys-libs/glibc/glibc-2.26-r3.ebuild
40 index 2234b26a084..98ab050e12f 100644
41 --- a/sys-libs/glibc/glibc-2.26-r3.ebuild
42 +++ b/sys-libs/glibc/glibc-2.26-r3.ebuild
43 @@ -189,6 +189,21 @@ pkg_pretend() {
44 die "old __guard detected"
45 fi
46 fi
47 +
48 + # Check for sanity of /etc/nsswitch.conf
49 + if [[ -e ${EROOT}/etc/nsswitch.conf ]] ; then
50 + local entry
51 + for entry in passwd group shadow; do
52 + if ! egrep -q "[ \t]*${entry}:.*files" "${EROOT}"/etc/nsswitch.conf; then
53 + eerror "Your ${EROOT}/etc/nsswitch.conf is out of date."
54 + eerror "Please make sure you have 'files' entries for"
55 + eerror "'passwd:', 'group:' and 'shadow:' databases."
56 + eerror "For more details see:"
57 + eerror " https://wiki.gentoo.org/wiki/Project:Toolchain/nsswitch.conf_in_glibc-2.26"
58 + die "nsswitch.conf has no 'files' provider in '${entry}'."
59 + fi
60 + done
61 + fi
62 }
63
64 src_unpack() {