Bug 25527

Summary: `man ldconfig' does not reflect its behavior
Product: Base System Reporter: Alexey V. Neyman <avn>
Component: confAssignee: Tom Rhodes <trhodes>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Alexey V. Neyman 2001-03-04 20:00:02 UTC
man ldconfig says:
     /etc/ld.so.conf              Conventional configuration file containing
	   			  directory names for invocations with -aout.
     /etc/ld-elf.so.conf          Conventional configuration file containing
				  directory names for invocations with -elf.
though these files are never used; either man page should be updated or
/etc/rc script should call ldconfig with directories from there files
Comment 1 Vanilla I. Shu freebsd_committer freebsd_triage 2001-03-17 00:41:51 UTC
Responsible Changed
From-To: gnats-admin->freebsd-bugs

Misfiled PR.
Comment 2 ru freebsd_committer freebsd_triage 2001-05-18 16:06:12 UTC
Responsible Changed
From-To: freebsd-bugs->jdp

John, could you please look at this?
Comment 3 John Polstra freebsd_committer freebsd_triage 2001-07-21 22:17:43 UTC
State Changed
From-To: open->feedback

I think your patch can be simplified by taking advantage of the fact 
that if a regular file is specified on the ldconfig command line, it 
is expanded by reading a directory name from each line of the file. 
There is no need to expand it in /etc/rc with 

_LDCF=`cat /etc/ld-elf.so.conf` 

since the same result can be attained by simply adding /etc/ld-elf.so.conf 
to the ldconfig command line.  In fact, here is all I think needs 
to be done: 

1. In these loops in /etc/rc: 

for i in ${ldconfig_paths}; do 
if [ -d "${i}" ]; then 
_LDC="${_LDC} ${i}" 
fi 
done 

change "if [ -d" to "if [ -r" so that a regular file will pass the 
test, and 

2. Add /etc/ld-elf.so.conf to the default ldconfig_paths setting in 
/etc/defaults/rc.conf, and likewise for ldconfig_paths_aout. 

Do you agree?
Comment 4 alex.neyman 2001-09-04 10:02:01 UTC
Hello there!

I agree with the solution supplied by John.

Alexey.

-- 
-------------------------------+---------------------------------
     May the Sun and Water     |     Regards, Alexey V. Neyman
     always fall upon you!     |   mailto: alex.neyman@auriga.ru
-------------------------------+---------------------------------
Comment 5 John Polstra freebsd_committer freebsd_triage 2003-05-26 19:41:03 UTC
Responsible Changed
From-To: jdp->freebsd-bugs

Turn this PR back over to freebsd-bugs.  I don't want to be 
responsible for it.
Comment 6 Tom Rhodes freebsd_committer freebsd_triage 2003-06-27 15:56:07 UTC
Responsible Changed
From-To: freebsd-bugs->trhodes

I'll review this.
Comment 7 avn 2003-06-27 17:38:35 UTC
--- /etc/rc.d/ldconfig.orig	Fri Jun 27 20:05:32 2003
+++ /etc/rc.d/ldconfig	Fri Jun 27 20:28:59 2003
@@ -25,8 +25,8 @@
 		checkyesno ldconfig_insecure && _ins="-i"
 		if [ -x "${ldconfig_command}" ]; then
 			_LDC=/usr/lib
-			for i in ${ldconfig_paths}; do
-				if [ -d "${i}" ]; then
+			for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
+				if [ -r "${i}" ]; then
 					_LDC="${_LDC} ${i}"
 				fi
 			done
@@ -39,8 +39,8 @@
 				# Default the a.out ldconfig path.
 				: ${ldconfig_paths_aout=${ldconfig_paths}}
 				_LDC=/usr/lib/aout
-				for i in ${ldconfig_paths_aout}; do
-					if [ -d "${i}" ]; then
+				for i in ${ldconfig_paths_aout} /etc/ld.so.conf; do
+					if [ -r "${i}" ]; then
 						_LDC="${_LDC} ${i}"
 					fi
 				done
Comment 8 alex.neyman 2003-06-27 18:03:01 UTC
--- /etc/rc.d/ldconfig.orig	Fri Jun 27 20:05:32 2003
+++ /etc/rc.d/ldconfig	Fri Jun 27 20:28:59 2003
@@ -25,8 +25,8 @@
 		checkyesno ldconfig_insecure && _ins="-i"
 		if [ -x "${ldconfig_command}" ]; then
 			_LDC=/usr/lib
-			for i in ${ldconfig_paths}; do
-				if [ -d "${i}" ]; then
+			for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
+				if [ -r "${i}" ]; then
 					_LDC="${_LDC} ${i}"
 				fi
 			done
@@ -39,8 +39,8 @@
 				# Default the a.out ldconfig path.
 				: ${ldconfig_paths_aout=${ldconfig_paths}}
 				_LDC=/usr/lib/aout
-				for i in ${ldconfig_paths_aout}; do
-					if [ -d "${i}" ]; then
+				for i in ${ldconfig_paths_aout} /etc/ld.so.conf; do
+					if [ -r "${i}" ]; then
 						_LDC="${_LDC} ${i}"
 					fi
 				done
Comment 9 Tom Rhodes freebsd_committer freebsd_triage 2003-06-30 16:02:24 UTC
State Changed
From-To: feedback->patched

Patch applied, MFC pending.  Thanks!
Comment 10 Matteo Riondato 2005-03-29 16:58:44 UTC
This PR can be closed: the patch was committed and the commit MFCed.
Best Regards

-- 
Rionda aka Matteo Riondato
Disinformato per default
G.U.F.I. Staff Member (http://www.gufi.org)
FreeSBIE Developer (http://www.freesbie.org)
Comment 11 Matteo Riondato 2005-03-29 19:23:36 UTC
This PR can be closed: the patch was committed and the commit MFCed.
Best Regards
-- 
Rionda aka Matteo Riondato
Disinformato per default
G.U.F.I. Staff Member (http://www.gufi.org)
FreeSBIE Developer (http://www.freesbie.org)
Comment 12 Tom Rhodes freebsd_committer freebsd_triage 2005-03-29 22:03:13 UTC
State Changed
From-To: patched->closed

Close long standing PR. 
Reminded by: Matteo Riondato <rionda@gufi.org>