Bug 235867 - libmap.conf's /path1 to /path2 replacement doesn't work
Summary: libmap.conf's /path1 to /path2 replacement doesn't work
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 11.2-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2019-02-19 20:27 UTC by Oleg Strizhak
Modified: 2019-02-20 02:02 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Strizhak 2019-02-19 20:27:10 UTC
libmap.conf's /path1 to /path2 replacement doesn't work

e.g.:

$ uname -a
FreeBSD xx.yy.ru 11.2-RELEASE-p9 FreeBSD 11.2-RELEASE-p9 #0 r344133: Thu Feb 14 23:36:20 MSK 2019     xx@yy.zz.ru:/usr/obj/usr/src/sys/GENERIC  amd64

$ cat /etc/libmap.conf 
# $FreeBSD: releng/11.2/etc/libmap.conf 253853 2013-08-01 05:50:42Z jlh $
includedir /usr/local/etc/libmap.d

$ cat /usr/local/etc/libmap.d/error.conf
[/usr/sbin/pmcstat]
/lib /usr/local/php56libz

$ ldd /usr/sbin/pmcstat
/usr/sbin/pmcstat:
	libelf.so.2 => /lib/libelf.so.2 (0x800833000)
	libkvm.so.7 => /lib/libkvm.so.7 (0x800a4a000)
	libpmc.so.5 => /usr/lib/libpmc.so.5 (0x800c58000)
	libm.so.5 => /lib/libm.so.5 (0x800eff000)
	libncursesw.so.8 => /lib/libncursesw.so.8 (0x80112c000)
	libc.so.7 => /lib/libc.so.7 (0x80138b000)

let's add a line with direct lib substitution:

$ cat /usr/local/etc/libmap.d/error.conf
[/usr/sbin/pmcstat]
/lib /usr/local/php56libz
libm.so.5 /usr/local/php56libz/libm.so.5

$ ldd /usr/sbin/pmcstat
/usr/sbin/pmcstat:
	libelf.so.2 => /lib/libelf.so.2 (0x800833000)
	libkvm.so.7 => /lib/libkvm.so.7 (0x800a4a000)
	libpmc.so.5 => /usr/lib/libpmc.so.5 (0x800c58000)
	libm.so.5 => /usr/local/php56libz/libm.so.5 (0x800eff000)
	libncursesw.so.8 => /lib/libncursesw.so.8 (0x80112c000)
	libc.so.7 => /lib/libc.so.7 (0x80138b000)

that works. Definition of LD_LIBMAP also works:

$ env LD_LIBMAP="/lib /usr/local/php56libz" ldd /usr/sbin/pmcstat
/usr/sbin/pmcstat:
	libelf.so.2 => not found (0)
	libkvm.so.7 => not found (0)
	libpmc.so.5 => /usr/lib/libpmc.so.5 (0x800833000)
	libm.so.5 => /usr/local/php56libz/libm.so.5 (0x800ada000)
	libncursesw.so.8 => not found (0)
	libc.so.7 => /usr/local/php56libz/libc.so.7 (0x800d07000)

So, I suppose that the bug occurs while trying to override /path1 to /path2 within libmap.conf subsystem.