1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

Be consistant about --ldap-backend-type

Make the EJS provision and the selftest scripts both use the new
syntax for speicifying the ldap backend type.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2008-02-21 10:43:13 +11:00
parent 5cd3310b78
commit b1d2584277
2 changed files with 12 additions and 7 deletions

View File

@ -729,9 +729,10 @@ nogroup:x:65534:nobody
if ($self->{ldap} eq "openldap") { if ($self->{ldap} eq "openldap") {
($ret->{SLAPD_CONF}, $ret->{OPENLDAP_PIDFILE}) = $self->mk_openldap($ldapdir, $configuration) or die("Unable to create openldap directories"); ($ret->{SLAPD_CONF}, $ret->{OPENLDAP_PIDFILE}) = $self->mk_openldap($ldapdir, $configuration) or die("Unable to create openldap directories");
push (@provision_options, "--ldap-backend-type=openldap");
} elsif ($self->{ldap} eq "fedora-ds") { } elsif ($self->{ldap} eq "fedora-ds") {
($ret->{FEDORA_DS_DIR}, $ret->{FEDORA_DS_PIDFILE}) = $self->mk_fedora_ds($ldapdir, $configuration) or die("Unable to create fedora ds directories"); ($ret->{FEDORA_DS_DIR}, $ret->{FEDORA_DS_PIDFILE}) = $self->mk_fedora_ds($ldapdir, $configuration) or die("Unable to create fedora ds directories");
push (@provision_options, "--ldap-module=nsuniqueid"); push (@provision_options, "--ldap-backend-type=fedora-ds");
push (@provision_options, "'--aci=aci:: KHRhcmdldGF0dHIgPSAiKiIpICh2ZXJzaW9uIDMuMDthY2wgImZ1bGwgYWNjZXNzIHRvIGFsbCBieSBhbGwiO2FsbG93IChhbGwpKHVzZXJkbiA9ICJsZGFwOi8vL2FueW9uZSIpOykK'"); push (@provision_options, "'--aci=aci:: KHRhcmdldGF0dHIgPSAiKiIpICh2ZXJzaW9uIDMuMDthY2wgImZ1bGwgYWNjZXNzIHRvIGFsbCBieSBhbGwiO2FsbG93IChhbGwpKHVzZXJkbiA9ICJsZGFwOi8vL2FueW9uZSIpOykK'");
} }

View File

@ -35,7 +35,7 @@ options = GetOptions(ARGV,
'partitions-only', 'partitions-only',
'ldap-base', 'ldap-base',
'ldap-backend=s', 'ldap-backend=s',
'ldap-module=s', 'ldap-backend-type=s',
'aci=s'); 'aci=s');
if (options == undefined) { if (options == undefined) {
@ -88,7 +88,7 @@ provision [options]
--partitions-only Configure Samba's partitions, but do not modify them (ie, join a BDC) --partitions-only Configure Samba's partitions, but do not modify them (ie, join a BDC)
--ldap-base output only an LDIF file, suitable for creating an LDAP baseDN --ldap-base output only an LDIF file, suitable for creating an LDAP baseDN
--ldap-backend LDAPSERVER LDAP server to use for this provision --ldap-backend LDAPSERVER LDAP server to use for this provision
--ldap-module MODULE LDB mapping module to use for the LDAP backend --ldap-backend-type TYPE OpenLDAP or Fedora DS
--aci ACI An arbitary LDIF fragment, particularly useful to loading a backend ACI value into a target LDAP server --aci ACI An arbitary LDIF fragment, particularly useful to loading a backend ACI value into a target LDAP server
You must provide at least a realm and domain You must provide at least a realm and domain
@ -124,7 +124,7 @@ for (r in options) {
var blank = (options["blank"] != undefined); var blank = (options["blank"] != undefined);
var ldapbackend = (options["ldap-backend"] != undefined); var ldapbackend = (options["ldap-backend"] != undefined);
var ldapmodule = (options["ldap-module"] != undefined); var ldapbackendtype = options["ldap-backend-type"];
var partitions_only = (options["partitions-only"] != undefined); var partitions_only = (options["partitions-only"] != undefined);
var paths = provision_default_paths(subobj); var paths = provision_default_paths(subobj);
if (options["aci"] != undefined) { if (options["aci"] != undefined) {
@ -139,9 +139,13 @@ if (ldapbackend) {
if (options["ldap-backend"] == "ldapi") { if (options["ldap-backend"] == "ldapi") {
subobj.LDAPBACKEND = subobj.LDAPI_URI; subobj.LDAPBACKEND = subobj.LDAPI_URI;
} }
if (!ldapmodule) { if (ldapbackendtype == undefined) {
} else if (ldapbackendtype == "openldap") {
subobj.LDAPMODULE = "normalise,entryuuid"; subobj.LDAPMODULE = "normalise,entryuuid";
subobj.TDB_MODULES_LIST = ""; subobj.TDB_MODULES_LIST = "";
} else if (ldapbackendtype == "fedora-ds") {
subobj.LDAPMODULE = "nsuniqueid";
} }
subobj.BACKEND_MOD = subobj.LDAPMODULE + ",paged_searches"; subobj.BACKEND_MOD = subobj.LDAPMODULE + ",paged_searches";
subobj.DOMAINDN_LDB = subobj.LDAPBACKEND; subobj.DOMAINDN_LDB = subobj.LDAPBACKEND;
@ -183,8 +187,8 @@ if (partitions_only) {
if (ldapbackend) { if (ldapbackend) {
message("--ldap-backend='%s' \\\n", subobj.LDAPBACKEND); message("--ldap-backend='%s' \\\n", subobj.LDAPBACKEND);
} }
if (ldapmodule) { if (ldapbackendtype != undefined) {
message("--ldap-module='%s' \\\n", + subobj.LDAPMODULE); message("--ldap-backend-type='%s' \\\n", + ldapbackendtype);
} }
message("--aci='" + subobj.ACI + "' \\\n") message("--aci='" + subobj.ACI + "' \\\n")
} }