s4:provisioning - Fixed minor bugs in provisioning tool and partition module.
authorEndi S. Dewata <edewata@redhat.com>
Wed, 4 Nov 2009 01:45:22 +0000 (19:45 -0600)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 4 Nov 2009 03:58:25 +0000 (14:58 +1100)
source4/dsdb/samdb/ldb_modules/partition_init.c
source4/scripting/python/samba/provisionbackend.py

index f98b1d8c3f273da45dcac8716efae8c7f05e7f06..db99b75817014829a0f828500a897f3dc6245061 100644 (file)
@@ -132,7 +132,7 @@ static int partition_reload_metadata(struct ldb_module *module, struct partition
        struct ldb_message *msg;
        struct ldb_result *res;
        struct ldb_context *ldb = ldb_module_get_ctx(module);
-       const char *attrs[] = { "partition", "replicateEntries", "modules", NULL };
+       const char *attrs[] = { "partition", "replicateEntries", "modules", "ldapBackend", NULL };
        /* perform search for @PARTITION, looking for module, replicateEntries and ldapBackend */
        ret = dsdb_module_search_dn(module, mem_ctx, &res, 
                                    ldb_dn_new(mem_ctx, ldb, DSDB_PARTITION_DN),
@@ -239,7 +239,7 @@ static int new_partition_from_dn(struct ldb_context *ldb, struct partition_priva
        ctrl->version = DSDB_CONTROL_CURRENT_PARTITION_VERSION;
        ctrl->dn = talloc_steal(ctrl, dn);
        
-       ret = ldb_connect_backend(ldb, backend_url, NULL, &backend_module);
+       ret = ldb_connect_backend(ldb, (*partition)->backend_url, NULL, &backend_module);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index 8f1b94f1bd56ceb5fa3bc270d9fce45d1576e9eb..f809202568b93c303559c539a301adc9e12eb92f 100644 (file)
@@ -31,6 +31,7 @@ import sys
 import uuid
 import time
 import shutil
+import subprocess
 
 from samba import read_and_sub_file
 from samba import Ldb
@@ -203,7 +204,7 @@ class ProvisionBackend(object):
 
         self.slapd_command_escaped = "\'" + "\' \'".join(self.slapd_command) + "\'"
         setup_file(setup_path("ldap_backend_startup.sh"), paths.ldapdir + "/ldap_backend_startup.sh", {
-                "SLAPD_COMMAND" : slapd_command})
+                "SLAPD_COMMAND" : self.slapd_command_escaped})
 
         # Now start the slapd, so we can provision onto it.  We keep the
         # subprocess context around, to kill this off at the successful