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

Michael Tokarev mjt at tls.msk.ru
Sun Apr 10 11:06:35 BST 2022


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?

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?

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.

Thanks,

/mjt



More information about the Pkg-samba-maint mailing list