From 25fbe4af0a468fb23a53190fc590031928b54948 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20K=2E=20H=C3=BCttel?= Date: Sat, 18 Nov 2017 19:17:01 +0100 Subject: [PATCH] sys-libs/glibc: Forward-port safety checks to 9999 Commits 5d8d827255a5f831247dc838879c4582b46210c4 66b10cf352d69a96824cba2c2a2bdea8e8094d7b Package-Manager: Portage-2.3.14, Repoman-2.3.6 --- sys-libs/glibc/glibc-9999.ebuild | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index 25412dcedbb8..2be9e1d411d4 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -196,6 +196,21 @@ pkg_pretend() { die "old __guard detected" fi fi + + # Check for sanity of /etc/nsswitch.conf + if [[ -e ${EROOT}/etc/nsswitch.conf ]] ; then + local entry + for entry in passwd group shadow; do + if ! egrep -q "^[ \t]*${entry}:.*files" "${EROOT}"/etc/nsswitch.conf; then + eerror "Your ${EROOT}/etc/nsswitch.conf is out of date." + eerror "Please make sure you have 'files' entries for" + eerror "'passwd:', 'group:' and 'shadow:' databases." + eerror "For more details see:" + eerror " https://wiki.gentoo.org/wiki/Project:Toolchain/nsswitch.conf_in_glibc-2.26" + die "nsswitch.conf has no 'files' provider in '${entry}'." + fi + done + fi } # todo: shouldn't most of these checks be called also in src_configure again? # (since consistency is not guaranteed between pkg_ and src_) -- 2.26.2