Is libbsd worth the pain?

Andrew Bartlett abartlet at samba.org
Thu Feb 2 20:28:45 MST 2012


Jelmer,

Regarding the recently introduced dependency on libbsd, I am wondering
if optionally depending on another unix portability lib is really worth
the pain.

The issue I have with libbsd is that we gain so little from using it -
we cannot depend on it strictly existing, so we must provide our own
replacement functions anyway, and we need extra code to optionally use
it.

In any case, we have an issue:
$ make quicktest
WAF_MAKE=1 ./buildtools/bin/waf test --quick 
...
[3935/3962] symbol duplicate checking: 
Waf: Leaving directory `/data/samba-2/bin'
Build failed:
default/source3/lib/netapi/examples/localgroup/localgroup_setinfo:
Symbol MD5Init linked in multiple libraries ['samba-util',
'/usr/lib64/libbsd.so.0.2.0']
make: *** [quicktest] Error 1

Because libbsd also implements MD5Init (et al), we now have a symbol
conflict.  (Other projects which implement MD5Init internally may not
have noticed this, as our symbol checking is a samba-only thing).

A partial patch to fix the MD5 issue is attached, but the configure
check to find bsd/md5.h needs to be written, and the result all tested
to ensure that we never use the wrong md5.h.

All this leads me to the question:

That we can then have an empty libreplace is neat, but I wonder if it is
really worth it to avoid having a local copy of strlcat and strlcpy?

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libbsd-md5.patch
Type: text/x-patch
Size: 693 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20120203/370251a5/attachment.bin>


More information about the samba-technical mailing list