| Summary: | `man ldconfig' does not reflect its behavior | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Alexey V. Neyman <avn> | ||||
| Component: | conf | Assignee: | Tom Rhodes <trhodes> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.2-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Responsible Changed From-To: gnats-admin->freebsd-bugs Misfiled PR. Responsible Changed From-To: freebsd-bugs->jdp John, could you please look at this? 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?
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
-------------------------------+---------------------------------
Responsible Changed From-To: jdp->freebsd-bugs Turn this PR back over to freebsd-bugs. I don't want to be responsible for it. Responsible Changed From-To: freebsd-bugs->trhodes I'll review this. --- /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
--- /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
State Changed From-To: feedback->patched Patch applied, MFC pending. Thanks! 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) 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) State Changed From-To: patched->closed Close long standing PR. Reminded by: Matteo Riondato <rionda@gufi.org> |
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