1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-25 17:57:42 +03:00

Make the 'modules.conf' generation in the LDAP selftest simpler

The versions of OpenLDAP that we require don't need us to specify the
location any more - slaptest knows this from it's build time.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2009-02-24 20:41:50 +11:00
parent 997dfbbf54
commit 022946d196

View File

@ -242,77 +242,32 @@ sub mk_openldap($$$)
$ENV{PATH} = "$olpath/usr/local/sbin:/usr/sbin:/sbin:$ENV{PATH}";
unlink($modconf);
#This code tries to guess what modules we need to load (if any) by trying different combinations in the modules.conf
# Try without any slapd modules
open(CONF, ">$modconf"); close(CONF);
if (system("slaptest -u -f $slapd_conf >&2") != 0) {
open(CONF, ">$modconf");
# enable slapd modules
print CONF "
modulepath $olroot/libexec/openldap
moduleload syncprov
moduleload memberof
moduleload refint
moduleload deref
";
close(CONF);
}
if (system("slaptest -u -f $slapd_conf >&2") != 0) {
open(CONF, ">$modconf");
# enable slapd modules
print CONF "
modulepath $olroot/libexec/openldap
moduleload back_hdb
moduleload syncprov
moduleload memberof
moduleload refint
";
close(CONF);
}
if (system("slaptest -u -f $slapd_conf >&2") != 0) {
open(CONF, ">$modconf");
# enable slapd modules
# enable slapd modules, and the module for back_hdb
print CONF "
moduleload back_hdb
moduleload syncprov
moduleload memberof
moduleload refint
";
close(CONF);
}
if (system("slaptest -u -f $slapd_conf >&2") != 0) {
open(CONF, ">$modconf");
# enable slapd modules
print CONF "
modulepath /usr/lib/ldap
moduleload back_hdb
moduleload syncprov
moduleload memberof
moduleload refint
";
close(CONF);
}
if (system("slaptest -u -f $slapd_conf >&2") != 0) {
open(CONF, ">$modconf");
# enable slapd modules (Fedora layout)
print CONF "
modulepath /usr/lib/openldap
moduleload syncprov
moduleload memberof
moduleload refint
";
close(CONF);
}
if (system("slaptest -u -f $slapd_conf >&2") != 0) {
open(CONF, ">$modconf");
# enable slapd modules (Fedora x86_64 layout)
print CONF "
modulepath /usr/lib64/openldap
moduleload syncprov
moduleload memberof
moduleload refint
moduleload deref
";
close(CONF);
}