Make check-ldap run on Ubuntu

Apparmor on Ubuntu prevents slapd from using the Unix domain socket we
want it to.  The fix is to copy the slapd executable into the objdir,
which disables the apparmor profile for slapd.

Also, make sure the ldapi: URI has the right path for the socket in
krb5.conf.
This commit is contained in:
Nicolas Williams
2016-11-15 15:35:29 -06:00
parent 995966f9d1
commit 274021f7db
2 changed files with 13 additions and 4 deletions

View File

@@ -12,7 +12,7 @@
[kdc]
database = {
dbname = ldapi://ldap-socket:OU=KerberosPrincipals,o=test,DC=h5l,DC=se
dbname = ldapi://.%2Fldap-socket:OU=KerberosPrincipals,o=test,DC=h5l,DC=se
realm = TEST.H5L.SE
mkey_file = @objdir@/mkey.file
log_file = @objdir@/log.current-db.log

View File

@@ -7,7 +7,7 @@ rm -rf db schema
mkdir db
# kill of old slapd if running
sh ${srcdir}/slapd-stop > /dev/null
sh "${srcdir}/slapd-stop" > /dev/null
SCHEMA_NEEDED="hdb core nis cosine inetorgperson openldap samba"
@@ -31,9 +31,18 @@ done
touch modules.conf || exit 1
slapadd -d 0 -f ${srcdir}/slapd.conf < ${srcdir}/init.ldif || exit 0
if ! slapadd -d 0 -f "${srcdir}/slapd.conf" < "${srcdir}/init.ldif"; then
echo "moduleload back_bdb.la" >> modules.conf
if ! slapadd -d 0 -f "${srcdir}/slapd.conf" < "${srcdir}/init.ldif"; then
echo "modulepath /usr/lib/ldap" > modules.conf
echo "moduleload back_bdb.la" >> modules.conf
slapadd -d 0 -f "${srcdir}/slapd.conf" < "${srcdir}/init.ldif" || exit 1
fi
fi
cp "`which slapd`" . || true # fails if running
echo "starting slapd"
slapd -d0 -f ${srcdir}/slapd.conf -h ldapi://.%2Fldap-socket &
./slapd -d0 -f "${srcdir}/slapd.conf" -h ldapi://.%2Fldap-socket &
sleep 4