commit:     468d6930bad211f5744c1e41d99c496923bae677
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 18 18:34:12 2017 +0000
Commit:     Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Nov 18 18:34:30 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=468d6930

sys-libs/glibc: Output fat warning if NIS is used and sys-auth/libnss-nis is 
not installed

Closes: https://bugs.gentoo.org/637946
Package-Manager: Portage-2.3.14, Repoman-2.3.6

 sys-libs/glibc/glibc-2.26-r3.ebuild | 15 +++++++++++++++
 sys-libs/glibc/glibc-9999.ebuild    | 15 +++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/sys-libs/glibc/glibc-2.26-r3.ebuild 
b/sys-libs/glibc/glibc-2.26-r3.ebuild
index d66113063e9..13aa5ad8bfb 100644
--- a/sys-libs/glibc/glibc-2.26-r3.ebuild
+++ b/sys-libs/glibc/glibc-2.26-r3.ebuild
@@ -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
 }

diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index 2be9e1d411d..732d684a728 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -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
 }

Reply via email to