From 49b3a4829325967df9d1e616ad32e5379ce6cf5d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 21 Feb 2008 09:53:11 +1100 Subject: Until the new ldb changes land, make ldb_wait set the error string. This makes it easier to track down which module only returned and error code, but not the error string. Andrew Bartlett (This used to be commit c4d502f68fbd5d5bc2ac5bb6369950379c9176fc) --- source4/lib/ldb/common/ldb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index 87f791cb38..5601a33191 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -463,11 +463,17 @@ static int ldb_autotransaction_request(struct ldb_context *ldb, struct ldb_reque int ldb_wait(struct ldb_handle *handle, enum ldb_wait_type type) { + int ret; if (!handle) { return LDB_SUCCESS; } - return handle->module->ops->wait(handle, type); + ret = handle->module->ops->wait(handle, type); + if (!ldb_errstring(handle->module->ldb)) { + /* Set a default error string, to place the blame somewhere */ + ldb_asprintf_errstring(handle->module->ldb, "error waiting on module %s: %s (%d)", handle->module->ops->name, ldb_strerror(ret), ret); + } + return ret; } /* set the specified timeout or, if timeout is 0 set the default timeout */ -- cgit From 0b1a24681e6b41129e05a9612610fade27aecd4d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 21 Feb 2008 10:43:13 +1100 Subject: 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 used to be commit b1d2584277304be3f2a640465cbf6b2a3ec571cc) --- source4/selftest/target/Samba4.pm | 3 ++- source4/setup/provision | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/source4/selftest/target/Samba4.pm b/source4/selftest/target/Samba4.pm index 563aca876e..11d4c85aee 100644 --- a/source4/selftest/target/Samba4.pm +++ b/source4/selftest/target/Samba4.pm @@ -729,9 +729,10 @@ nogroup:x:65534:nobody if ($self->{ldap} eq "openldap") { ($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") { ($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'"); } diff --git a/source4/setup/provision b/source4/setup/provision index 9e135cddbb..328754fd9c 100755 --- a/source4/setup/provision +++ b/source4/setup/provision @@ -35,7 +35,7 @@ options = GetOptions(ARGV, 'partitions-only', 'ldap-base', 'ldap-backend=s', - 'ldap-module=s', + 'ldap-backend-type=s', 'aci=s'); if (options == undefined) { @@ -88,7 +88,7 @@ provision [options] --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-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 You must provide at least a realm and domain @@ -124,7 +124,7 @@ for (r in options) { var blank = (options["blank"] != 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 paths = provision_default_paths(subobj); if (options["aci"] != undefined) { @@ -139,9 +139,13 @@ if (ldapbackend) { if (options["ldap-backend"] == "ldapi") { subobj.LDAPBACKEND = subobj.LDAPI_URI; } - if (!ldapmodule) { + if (ldapbackendtype == undefined) { + + } else if (ldapbackendtype == "openldap") { subobj.LDAPMODULE = "normalise,entryuuid"; subobj.TDB_MODULES_LIST = ""; + } else if (ldapbackendtype == "fedora-ds") { + subobj.LDAPMODULE = "nsuniqueid"; } subobj.BACKEND_MOD = subobj.LDAPMODULE + ",paged_searches"; subobj.DOMAINDN_LDB = subobj.LDAPBACKEND; @@ -183,8 +187,8 @@ if (partitions_only) { if (ldapbackend) { message("--ldap-backend='%s' \\\n", subobj.LDAPBACKEND); } - if (ldapmodule) { - message("--ldap-module='%s' \\\n", + subobj.LDAPMODULE); + if (ldapbackendtype != undefined) { + message("--ldap-backend-type='%s' \\\n", + ldapbackendtype); } message("--aci='" + subobj.ACI + "' \\\n") } -- cgit