rc.d/ldconfig: Prepend rtld stdlib paths to ldconfig(32)_paths

Ensure that ldconfig-managed elf and elf32 hints always include
the standard library paths that are known independently to rtld.

PR:			275031
Reviewed by:		kib
MFC after:		2 weeks
Sponsored by:		Saltant Solutions LLC
Differential Revision:	https://reviews.freebsd.org/D42557
This commit is contained in:
John W. O'Brien 2023-11-12 17:45:27 -05:00 committed by Konstantin Belousov
parent da8238d6cf
commit 99132daf6f

View File

@ -22,7 +22,7 @@ ldconfig_start()
ldconfig=${ldconfig_command}
checkyesno ldconfig_insecure && _ins="-i"
if [ -x "${ldconfig_command}" ]; then
_LDC="/lib /usr/lib"
_LDC=$(/libexec/ld-elf.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' ')
for i in ${ldconfig_local_dirs}; do
if [ -d "${i}" ]; then
_files=`find ${i} -type f`
@ -52,6 +52,9 @@ ldconfig_start()
fi
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 : ' ')
fi
for i in ${ldconfig32_paths}; do
if [ -r "${i}" ]; then
_LDC="${_LDC} ${i}"