Hello all,
What I'm trying to do is enable the lastbind module in a centos7 server, so I applied this patch to the rpmbuild process:
# cat /root/rpmbuild/SOURCES/openldap-lastbind-overlay.patch
--- a/servers/slapd/overlays/Makefile.in 2017-04-12 12:14:46.617978071 +0100
+++ b/servers/slapd/overlays/Makefile.in 2017-04-12 12:21:12.569292484 +0100
@@ -36,6 +36,7 @@
valsort.c \
smbk5pwd.c \
allop.c \
+ lastbind.c \
sha2.c slapd-sha2.c
OBJS = statover.o \
@SLAPD_STATIC_OVERLAYS@ \
@@ -56,7 +57,7 @@
UNIX_LINK_LIBS = $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
LIBRARY = ../liboverlays.a
-PROGRAMS = @SLAPD_DYNAMIC_OVERLAYS@ smbk5pwd.la allop.la pw-sha2.la
+PROGRAMS = @SLAPD_DYNAMIC_OVERLAYS@ smbk5pwd.la allop.la pw-sha2.la lastbind.la
XINCPATH = -I.. -I$(srcdir)/..
XDEFS = $(MODULES_CPPFLAGS)
@@ -140,6 +141,12 @@
allop.la : allop.lo
$(LTLINK_MOD) -module -o $@ allop.lo version.lo $(LINK_LIBS) $(shell pkg-config openssl --libs)
+lastbind.lo : lastbind.c
+ $(LTCOMPILE_MOD) -DDO_SAMBA -UHAVE_MOZNSS -DHAVE_OPENSSL $(shell pkg-config openssl --cflags) $<
+
+lastbind.la : lastbind.lo
+ $(LTLINK_MOD) -module -o $@ lastbind.lo version.lo $(LINK_LIBS) $(shell pkg-config openssl --libs)
+
sha2.lo : sha2.c
$(LTCOMPILE_MOD) $<
the resulting package contains the module:
# rpm -qpl /root/rpmbuild/RPMS/x86_64/openldap-servers-2.4.44-1.x86_64.rpm | grep lastbind
/usr/lib64/openldap/lastbind-2.4.so.2
/usr/lib64/openldap/lastbind-2.4.so.2.10.7
/usr/lib64/openldap/lastbind.la
/usr/share/man/man5/slapo-lastbind.5.gz
but a configuration file as simple as the following one, fails to load:
# cat test.conf
modulepath /usr/lib64/openldap/
moduleload back_bdb.la
moduleload back_hdb.la
moduleload back_ldap.la
moduleload unique.la
moduleload ppolicy.la
moduleload dynlist.la
moduleload memberof.la
moduleload syncprov.la
moduleload accesslog.la
moduleload lastbind.la
moduleload auditlog.la
# slaptest -d -1 -f ./test.conf
58ee0ebd slaptest init: initiated tool.
58ee0ebd slap_sasl_init: initialized!
58ee0ebd bdb_back_initialize: initialize BDB backend
58ee0ebd bdb_back_initialize: Berkeley DB 5.3.21: (May 11, 2012)
58ee0ebd hdb_back_initialize: initialize HDB backend
58ee0ebd hdb_back_initialize: Berkeley DB 5.3.21: (May 11, 2012)
58ee0ebd mdb_back_initialize: initialize MDB backend
58ee0ebd mdb_back_initialize: LMDB 0.9.18: (February 5, 2016)
58ee0ebd reading config file ./test.conf
58ee0ebd ./test.conf: line 1 (modulepath /usr/lib64/openldap/)
58ee0ebd ./test.conf: line 2 (moduleload back_bdb.la)
58ee0ebd module_load: (back_bdb.la) already present (static)
58ee0ebd ./test.conf: line 3 (moduleload back_hdb.la)
58ee0ebd module_load: (back_hdb.la) already present (static)
58ee0ebd ./test.conf: line 4 (moduleload back_ldap.la)
58ee0ebd loaded module back_ldap.la
58ee0ebd module back_ldap.la: null module registered
58ee0ebd ./test.conf: line 5 (moduleload unique.la)
58ee0ebd loaded module unique.la
58ee0ebd module unique.la: null module registered
58ee0ebd ./test.conf: line 6 (moduleload ppolicy.la)
58ee0ebd loaded module ppolicy.la
58ee0ebd module ppolicy.la: null module registered
58ee0ebd ./test.conf: line 7 (moduleload dynlist.la)
58ee0ebd loaded module dynlist.la
58ee0ebd module dynlist.la: null module registered
58ee0ebd ./test.conf: line 8 (moduleload memberof.la)
58ee0ebd loaded module memberof.la
58ee0ebd module memberof.la: null module registered
58ee0ebd ./test.conf: line 9 (moduleload syncprov.la)
58ee0ebd loaded module syncprov.la
58ee0ebd module syncprov.la: null module registered
58ee0ebd ./test.conf: line 10 (moduleload accesslog.la)
58ee0ebd loaded module accesslog.la
58ee0ebd module accesslog.la: null module registered
58ee0ebd ./test.conf: line 11 (moduleload lastbind.la)
58ee0ebd loaded module lastbind.la
58ee0ebd module lastbind.la: init_module() failed
58ee0ebd ./test.conf: line 11: <moduleload> handler exited with 1!
slaptest: bad configuration file!
any idea about where I make the mistake?