Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Nov 2023 19:59:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 275031] rc.d/ldconfig missing hard-coded /lib/casper from rtld-elf STANDARD_LIBRARY_PATH
Message-ID:  <bug-275031-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275031

            Bug ID: 275031
           Summary: rc.d/ldconfig missing hard-coded /lib/casper from
                    rtld-elf STANDARD_LIBRARY_PATH
           Product: Base System
           Version: 13.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: conf
          Assignee: bugs@FreeBSD.org
          Reporter: john@saltant.com

Created attachment 246246
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D246246&action=
=3Dedit
stable/12: Prepend /lib/casper to rc.d/ldconfig's baseline

Synopsis
=3D=3D=3D=3D=3D=3D=3D=3D

ldconfig manages the file at _PATH_ELF_HINTS and always includes a baseline=
 set
of directories independent of its rc vars such as ldconfig_paths and
ldconfig_local_dirs. After consulting the hints, rtld falls back to a
hard-coded list of library directories. The ldconfig hard-coded path is a
subset of the rtld hard-coded path whereas they should be identical.


Context
=3D=3D=3D=3D=3D=3D=3D

% ldd /usr/local/sbin/tcpdump | grep libcap_dns
        libcap_dns.so.2 =3D> /lib/casper/libcap_dns.so.2 (0x21349571a000)
% /usr/local/sbin/tcpdump --version
tcpdump version 4.99.4
libpcap version 1.10.4
OpenSSL 1.1.1w  11 Sep 2023
%


Expected behavior
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

% sudo pkg check -B tcpdump
Checking tcpdump: 100%
%


Observed behavior
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

% sudo pkg check -B tcpdump
Checking tcpdump:   0%
(tcpdump-4.99.4_1) /usr/local/sbin/tcpdump - required shared library
libcap_dns.so.2 not found
Checking tcpdump: 100%
%


Analysis
=3D=3D=3D=3D=3D=3D=3D=3D

The "pkg check -B" command has no hard-coded default path and relies on the
elf-hints maintained by ldconfig. The ldconfig baseline (_LDC) is set to "/=
lib
/usr/lib" in libexec/rc/rc.d/ldconfig on the (still supported) stable/12 and
stable/13 branches. The rtld baseline (STANDARD_LIBRARY_PATH) is set to=20
"/lib/casper:/lib:/usr/lib" in libexec/rtld-elf/paths.h on the stable/12 br=
anch
and in libexec/rtld-elf/rtld_paths.h on the stable/13 branch. Considering r=
tld
to be authoritative, ldconfig's baseline needs correction.

The main and stable/14 branches are not affected because the casper shared =
libs
have been moved to /lib, so the rtld and ldconfig baselines agree.


See also
=3D=3D=3D=3D=3D=3D=3D=3D

https://lists.freebsd.org/archives/freebsd-ports/2023-November/004889.html


Testing
=3D=3D=3D=3D=3D=3D=3D

% echo /lib/casper |
     sudo tee /usr/local/libdata/ldconfig/casper > /dev/null
% sudo service ldconfig restart
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib=20
/usr/local/lib/compat/pkg /lib/casper /usr/local/lib/compat/pkg=20
/usr/local/lib/perl5/5.36/mach/CORE /usr/local/llvm15/lib
32-bit compatibility ldconfig path: /usr/lib32
% sudo pkg check -B tcpdump
Checking tcpdump: 100%

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-275031-227>