From 1f9fe814fe58e3d27b7c51c7cf35510bc3779692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 3 Mar 2024 11:05:41 +0100 Subject: [PATCH] Use map for nsswitch.conf uniquification. Don't try to find [NOTFOUND or whatever stanzas as libraries --- initrd/install.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initrd/install.h b/initrd/install.h index c864d55..4d4aaf4 100644 --- a/initrd/install.h +++ b/initrd/install.h @@ -32,7 +32,7 @@ if [ -e /etc/nsswitch.conf ]; then INST_CFG /etc/nsswitch.conf - databases="$(awk '/^(group|hosts)/ {for(i = 2; i <= NF; ++i) print $i}' /etc/nsswitch.conf | LC_ALL=C sort -u)" + databases="$(awk '/^(group|hosts)/ {for(i = 2; i <= NF; ++i) if($i !~ /[^a-z0-9_-]/) db[$i]=0} END {for(d in db) print d}' /etc/nsswitch.conf)" for db in $databases; do for f in /lib/*/"libnss_$db"*; do INST_LIB "$f"