aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2023-11-16 05:38:00 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2023-11-28 11:39:39 +0000
commit81a5b2389dcfeef12115e28a24ea68f71e5cc1f3 (patch)
treed85283dc04ff9a88afdddf8248fd6e41c5cd6b72
parent5dba91f557f0fb295977a07b2837b0351723b9c8 (diff)
downloadsrc-81a5b2389dcfeef12115e28a24ea68f71e5cc1f3.tar.gz
src-81a5b2389dcfeef12115e28a24ea68f71e5cc1f3.zip
ldconfig: filter out non-existing directories from default path
(cherry picked from commit 806e4e3273bee2e3a12ffc2e74db5c912fbd7aa9)
-rwxr-xr-xlibexec/rc/rc.d/ldconfig6
1 files changed, 5 insertions, 1 deletions
diff --git a/libexec/rc/rc.d/ldconfig b/libexec/rc/rc.d/ldconfig
index ecbbca210ea0..ed3484017d84 100755
--- a/libexec/rc/rc.d/ldconfig
+++ b/libexec/rc/rc.d/ldconfig
@@ -53,7 +53,11 @@ ldconfig_start()
done
_LDC=""
if [ -x /libexec/ld-elf32.so.1 ]; then
- _LDC=$(/libexec/ld-elf32.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' ')
+ for x in $(/libexec/ld-elf32.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' '); do
+ if [ -d "${x}" ]; then
+ _LDC="${_LDC} ${x}"
+ fi
+ done
fi
for i in ${ldconfig32_paths}; do
if [ -r "${i}" ]; then