lib/replace: avoid using libbsd for builtin linking
authorStefan Metzmacher <metze@samba.org>
Tue, 12 Sep 2023 13:22:03 +0000 (15:22 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 16 Oct 2023 08:23:15 +0000 (10:23 +0200)
commit895233c188c9db19b09262bca769aeec61ff87bd
tree3324cc0f83438f9dec53cf8823e25a4605cdc968
parentf63a989d833be2ab7502033e70dde66cb6979b02
lib/replace: avoid using libbsd for builtin linking

This is similar to commit 66e90b7391bd404580f3919c4f2b8625c9c89c0e:
nsswitch: reduce dependecies to private libraries and link static/builtin if possible

There we tried to hide our internal symbols from applications loading
our plugins (e.g. libnss_winbind.so.2 or pam_winbind.so)

If we find libbsd in the system we link our plugins against it
and inject the symbols from it into the application, as the
symbols in libbsd have very common names, there's a change to
generate symbol conflicts causing unexpected behavior.

So we better use our own replacement functions from lib/replace
for the plugins instead of using the ones from libbsd
as we most likely not really need them. Currently we only
seem to use strlcpy() and we have our own version of it...

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15475

Signed-off-by: Stefan Metzmacher <metze@samba.org>
lib/replace/replace.h
lib/replace/replace_builtin_linking.h [new file with mode: 0644]
lib/replace/wscript