[28862] in Source-Commits

home help back first fref pref prev next nref lref last post

nsswitch-config commit: Try to configure all installed nss modules, not just libnss-mdns

daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Mon May 7 17:56:20 2018

Date: Mon, 7 May 2018 17:56:04 -0400
From: Anders Kaseorg <andersk@mit.edu>
Message-Id: <201805072156.w47Lu4Qn023100@drugstore.mit.edu>
To: source-commits@mit.edu

https://github.com/mit-athena/nsswitch-config/commit/b9f99f031ff2e5ab5a170b9d5ae0c9269a564ce1
commit b9f99f031ff2e5ab5a170b9d5ae0c9269a564ce1
Author: Anders Kaseorg <andersk@mit.edu>
Date:   Sat May 5 17:09:49 2018 -0400

    Try to configure all installed nss modules, not just libnss-mdns
    
    Also, find postinst paths with dpkg-query --control-path.
    (Trac: #1050)
    
    Signed-off-by: Anders Kaseorg <andersk@mit.edu>

 debian/changelog                          |    7 +++++++
 debian/debathena-nsswitch-config.postinst |   18 +++++++++++++++---
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 059f01e..9155450 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+debathena-nsswitch-config (1.16) UNRELEASED; urgency=medium
+
+  * Try to configure all installed nss modules, not just libnss-mdns.
+  * Find postinst paths with dpkg-query --control-path.  (Trac: #1050)
+
+ -- Anders Kaseorg <andersk@mit.edu>  Sat, 05 May 2018 17:08:24 -0400
+
 debathena-nsswitch-config (1.15) unstable; urgency=low
 
   [ Jonathan Reed ]
diff --git a/debian/debathena-nsswitch-config.postinst b/debian/debathena-nsswitch-config.postinst
index 7cae435..874b759 100644
--- a/debian/debathena-nsswitch-config.postinst
+++ b/debian/debathena-nsswitch-config.postinst
@@ -22,9 +22,21 @@ set -e
 
 case "$1" in
     configure)
-	if [ -x /var/lib/dpkg/info/libnss-mdns.postinst ]; then
-	    /var/lib/dpkg/info/libnss-mdns.postinst configure
-	fi
+	(
+	    IFS='
+'
+	    set -f
+	    for postinst in \
+		$(ldconfig -p \
+		      | sed -n '/\.so$/d; s/^\s*libnss_.* => \(.*\)$/\1/p' \
+		      | xargs -d '\n' -r dpkg -S -- \
+		      | sed -n '/^libc6[:-]/d; s/: .*$//p' \
+		      | sort -u \
+		      | xargs -d '\n' -r -I@ dpkg-query --control-path -- @ postinst); do
+		echo "debathena-nsswitch-config: Running $postinst configure"
+		"$postinst" configure
+	    done
+	)
 	if ! [ -L /etc/nsswitch.conf ]; then
 	    echo "warning: /etc/nsswitch.conf is no longer a symbolic link!  Fixing." >&2
 	    if [ -s /etc/nsswitch.conf ]; then

home help back first fref pref prev next nref lref last post