[Pkg-samba-maint] ldb modules dir and <ldb.h> placement: is ldb samba-specific or not?

Andrew Bartlett abartlet at samba.org
Sun Apr 10 22:04:24 BST 2022


On Sun, 2022-04-10 at 13:06 +0300, Michael Tokarev wrote:
> Hi!
> 
> A question popped up when in Debian, we switched building ldb
> from its own source package to be a part of samba build.
> 
> After this, ldb modules (plugins) directory changed from
> 
>    /usr/lib/ldb/modules/ldb/  to
>    /usr/lib/samba/ldb/
> 
> (minus the multiarch details).
> 
> This is because in a separate ldb we had
> 
>   --with-modulesdir=/usr/lib/$(DEB_HOST_MULTIARCH)/ldb/modules
> 
> but with samba it is not anymore b/c, since samba ships their
> own modules and in samba we have
> 
>   --with-modulesdir=/usr/lib/$(DEB_HOST_MULTIARCH)/samba
> 
> instead.  That's why ldb modules becomes samba/ldb modules.
> As far as I can see, --with-modulesdir in samba is because
> of all the private libraries out there which are dropped into
> a subdir (with extra rpath added to each binary linking with
> any of them).
> 
> Maybe we should drop this --with-modulesdir= from the samba
> build rules?

The original intent was that Samba modules (the dsdb modules) would be
separated from the 'normal' ldb modules.  But if you have them all in
the same spot then you get all the Samba features (NTLM authentication
etc) 'out of the box' for the ldb tools, but on the flip side you put
our GPLv3 code into every user of libldb.

I tried to counsel for keeping the paths as they were, and I think that
is still right - an original patch for this merge did most of the work
by changing the value of 'standlone_ldb' in the wscript. 

I am concerned that the 'private' version of these libs might have a
strange ABI signature / version suffix also.  Please check.

> This is what broke sssd with the new libldb2 built from samba
> sources: the wrong placement of sssd-providing ldb module.
> Once they stopped specifying --with-ldb-lib-dir for their
> configure script, it started to work.
> 
> And here comes another interesting question/observation.
> While libldb itself provides stable ABI, so that programs
> linking to it should work with more recent versions of
> libldb, how about the modules interface? Should modules
> compiled with old libldb work with new libldb?  How should
> we specify libldb2 dependencies for sssd package, - should
> it be an exact same version of ldb which sssd were built with?

The modules interface is not a stable ABI.  It doesn't change often,
but upstream Samba does not plan to issue a compatibility interface or
new libldb.so.3 just because we change something there. 

> A similar question (wrt the file placement) comes about ldb.h which
> is moved from /usr/include/ldb.h to /usr/include/samba-4.0/ldb.h.
> This is easier since all stuff is in pkg-config and it is picked up
> automatically. But there, the question is a bit different:
> is ldb.h specific to samba or is it actually not tied to samba?
> If it is the latter, we can move this very include file back
> into /usr/include where it goes when built from separate ldb
> package.

I think things should stay where they were.  That is certainly what I
would expect to be accepted upstream once this is demonstrated in
Debian - we want the patches learnt here to go upstream.

I hope this helps.

Andrew Bartlett

-- 
Andrew Bartlett (he/him)       https://samba.org/~abartlet/
Samba Team Member (since 2001) https://samba.org
Samba Team Lead, Catalyst IT   https://catalyst.net.nz/services/samba

Samba Development and Support, Catalyst IT - Expert Open Source
Solutions




More information about the Pkg-samba-maint mailing list