sys-libs/glibc: Output fat warning if NIS is used and sys-auth/libnss-nis is not...
authorAndreas K. Hüttel <dilfridge@gentoo.org>
Sat, 18 Nov 2017 18:34:12 +0000 (19:34 +0100)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Sat, 18 Nov 2017 18:34:30 +0000 (19:34 +0100)
Closes: https://bugs.gentoo.org/637946
Package-Manager: Portage-2.3.14, Repoman-2.3.6

sys-libs/glibc/glibc-2.26-r3.ebuild
sys-libs/glibc/glibc-9999.ebuild

index d66113063e92093cc898083d95eca6bc9642a00d..13aa5ad8bfb6b6a24186a9eb2d227647595f79ee 100644 (file)
@@ -800,4 +800,19 @@ pkg_postinst() {
                fi
                locale-gen -j $(makeopts_jobs) --config "${locale_list}"
        fi
+
+       # Check for sanity of /etc/nsswitch.conf, take 2
+       if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then
+               local entry
+               for entry in passwd group shadow; do
+                       if egrep -q "^[ \t]*${entry}:.*nis" "${EROOT}"/etc/nsswitch.conf; then
+                               ewarn ""
+                               ewarn "Your ${EROOT}/etc/nsswitch.conf uses NIS. Support for that has been"
+                               ewarn "removed from glibc and is now provided by the package"
+                               ewarn "  sys-auth/libnss-nis"
+                               ewarn "Install it now to keep your NIS setup working."
+                               ewarn ""
+                       fi
+               done
+       fi
 }
index 2be9e1d411d4417b1270911a37d9d1fe3ec7b4c8..732d684a7281e879dba5c57c17de6959b1cd9ca7 100644 (file)
@@ -808,4 +808,19 @@ pkg_postinst() {
 
                use compile-locales || run_locale_gen "${EROOT}"
        fi
+
+       # Check for sanity of /etc/nsswitch.conf, take 2
+       if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then
+               local entry
+               for entry in passwd group shadow; do
+                       if egrep -q "^[ \t]*${entry}:.*nis" "${EROOT}"/etc/nsswitch.conf; then
+                               ewarn ""
+                               ewarn "Your ${EROOT}/etc/nsswitch.conf uses NIS. Support for that has been"
+                               ewarn "removed from glibc and is now provided by the package"
+                               ewarn "  sys-auth/libnss-nis"
+                               ewarn "Install it now to keep your NIS setup working."
+                               ewarn ""
+                       fi
+               done
+       fi
 }