Description of problem: LDB_MODULES_PATH not set in ldb-tools-1.2.1-3.fc27.x86_64 or samba-common-libs-4.7.0-12.fc27.x86_64 Version-Release number of selected component (if applicable): ldb-tools-1.2.1-3.fc27.x86_64 rpm -qf /usr/lib64/samba/ldb/ samba-common-libs-4.7.0-12.fc27.x86_64 How reproducible: Install samba as ADDC with samba-tools ldbsearch -H /var/lib/samba/private/sam.ldb Steps to Reproduce: 1. ldbsearch -H /var/lib/samba/private/sam.ldb 2. 3. Actual results: WARNING: Module [samba_dsdb] not found - do you need to set LDB_MODULES_PATH? Unable to load modules for /var/lib/samba/private/sam.ldb: (null) Failed to connect to /var/lib/samba/private/sam.ldb - (null) Expected results: Records shoud be displayed Additional info: export LDB_MODULES_PATH=/usr/lib64/samba/ldb temporarily fixes the problem, until the next reboot.
ldb-tools is a general package, not tied too much to Samba itself. SSSD, for example, while using ldb database, does not need modules from /usr/lib64/samba/ldb for its own operation. It has own modules that it installs into /usr/lib64/ldb/modules/ldb. As result, you need to know what you do when looking into a particular application's ldb databases. Samba does set up own LDB_MODULES_PATH on start so that its modules used correctly. This piece of information probably needs to be made a part of Samba AD DC documentation upstream.
BTW I got same problem with my custom Samba AD on Centos 7 [1] , my samba use and provide internal ldb-tools I can't start sssd with set or export LDB_MODULES_PATH=/usr/lib64/ldb/modules/ldb/ [2] looking for .spec code [3] ./configure --with-modulesdir=%{_libdir}/ldb/modules when in my samba.spec use --with-modulesdir=%{_libdir}/samba and that makes the difference fedora package reads /usr/lib64/ldb/modules/ldb/memberof.so i.e. to work without exports ldb modules must be install in same directory of sssd [4] [1] https://copr.fedorainfracloud.org/coprs/sergiomb/SambaAD/ [2] LDB_MODULES_PATH=/usr/lib64/ldb/modules/ldb/ ldbsearch -H /var/lib/sss/db/cache_domain.local.ldb (works) [3] https://src.fedoraproject.org/rpms/libldb/blob/master/f/libldb.spec [4] rpm -qf /usr/lib64/ldb/modules/ldb/* libldb-1.3.4-1.el7.x86_64 sssd-common-1.16.0-19.el7.x86_64 libldb-1.3.4-1.el7.x86_64 libldb-1.3.4-1.el7.x86_64 libldb-1.3.4-1.el7.x86_64 libldb-1.3.4-1.el7.x86_64 libldb-1.3.4-1.el7.x86_64 libldb-1.3.4-1.el7.x86_64 libldb-1.3.4-1.el7.x86_64
(*) with set -> without set
the easy way seems add /usr/lib64/ldb/modules/ldb/memberof.so to other ldb modules cd /usr/lib64/samba/ldb/ ln -s /usr/lib64/ldb/modules/ldb/memberof.so .