Date: Tue, 01 Nov 2005 22:14:27 -0500 From: Frank Laszlo <laszlof@vonostingroup.com> To: FreeBSD-gnats-submit@FreeBSD.org Cc: mark@uplink.dk Subject: conf/88383: [PATCH]: etc/rc.d/ldconfig:does not properly handle ld{-elf}.so.conf Message-ID: <E1EX951-0004bi-GV@ritamari.vonostingroup.com> Resent-Message-ID: <200511020320.jA23KIna014721@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 88383 >Category: conf >Synopsis: [PATCH]: etc/rc.d/ldconfig:does not properly handle ld{-elf}.so.conf >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Nov 02 03:20:18 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Frank Laszlo >Release: FreeBSD 5.4-STABLE i386 >Organization: >Environment: System: FreeBSD ritamari.vonostingroup.com 5.4-STABLE FreeBSD 5.4-STABLE #0: Thu Jun 9 22:20:56 EDT 2005 laszlof@ritamari.vonostingroup.com:/usr/obj/usr/src/sys/RITAMARI i386 >Description: etc/rc.d/ldconfig currently is supposed to add files from rc.conf defined by ldconfig_paths as well as paths *within* /etc/ld.so.conf and /etc/ld-elf.so.conf respectively. This is not the case, as the code processes /etc/ld{-elf}.so.conf as a path to be passed to ldconfig. The attached patch will fix this segment of code. >How-To-Repeat: Add a library path to /etc/ld.so.conf or /etc/ld-elf.so.conf and rerun /etc/rc.d/ldconfig. >Fix: --- rc.d-ldconfig.diff begins here --- --- etc/rc.d/ldconfig.orig Tue Nov 1 21:57:47 2005 +++ etc/rc.d/ldconfig Tue Nov 1 22:04:39 2005 @@ -22,11 +22,18 @@ checkyesno ldconfig_insecure && _ins="-i" if [ -x "${ldconfig_command}" ]; then _LDC="/lib /usr/lib" - for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do + for i in ${ldconfig_paths}; do if [ -r "${i}" ]; then _LDC="${_LDC} ${i}" fi done + if [ -r /etc/ld-elf.so.conf ]; then + for i in `cat /etc/ld-elf.so.conf`; do + if [ -r "${i}" ]; then + _LDC="${_LDC} ${i}" + fi + done + fi echo 'ELF ldconfig path:' ${_LDC} ${ldconfig} -elf ${_ins} ${_LDC} @@ -36,11 +43,18 @@ # Default the a.out ldconfig path. : ${ldconfig_paths_aout=${ldconfig_paths}} _LDC=/usr/lib/aout - for i in ${ldconfig_paths_aout} /etc/ld.so.conf; do + for i in ${ldconfig_paths_aout}; do if [ -r "${i}" ]; then _LDC="${_LDC} ${i}" fi done + if [ -r /etc/ld.so.conf ]; then + for i in `cat /etc/ld.so.conf`; do + if [ -r "${i}" ]; then + _LDC="${_LDC} ${i}" + fi + done + fi echo 'a.out ldconfig path:' ${_LDC} ${ldconfig} -aout ${_ins} ${_LDC} ;; --- rc.d-ldconfig.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1EX951-0004bi-GV>