sys-libs/glibc: Forward-port safety checks to 9999
authorAndreas K. Hüttel <dilfridge@gentoo.org>
Sat, 18 Nov 2017 18:17:01 +0000 (19:17 +0100)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Sat, 18 Nov 2017 18:34:30 +0000 (19:34 +0100)
Commits
5d8d827255a5f831247dc838879c4582b46210c4
66b10cf352d69a96824cba2c2a2bdea8e8094d7b

Package-Manager: Portage-2.3.14, Repoman-2.3.6

sys-libs/glibc/glibc-9999.ebuild

index 25412dcedbb89d1c5c0122581247f6f656f7b5d3..2be9e1d411d4417b1270911a37d9d1fe3ec7b4c8 100644 (file)
@@ -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_)