ldconfig: filter out non-existing directories from default path

(cherry picked from commit 806e4e3273bee2e3a12ffc2e74db5c912fbd7aa9)
This commit is contained in:
Konstantin Belousov 2023-11-16 07:38:00 +02:00
parent 5dba91f557
commit 81a5b2389d

View file

@ -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