From: Andrew Bartlett Date: Thu, 22 Mar 2018 21:58:11 +0000 (+1300) Subject: provision: Set @INDEXLIST first when building dummy sam.ldb X-Git-Tag: ldb-1.4.0~697 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba61c684686933b1a69a1bb357428db9911b2048;p=thirdparty%2Fsamba.git provision: Set @INDEXLIST first when building dummy sam.ldb The new LMDB backed will not allow normal records to be added before the @INDEXLIST as this is what forces the GUID index mode. Signed-off-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- diff --git a/python/samba/provision/sambadns.py b/python/samba/provision/sambadns.py index ce1b7692ff9..7a85546c53e 100644 --- a/python/samba/provision/sambadns.py +++ b/python/samba/provision/sambadns.py @@ -811,6 +811,11 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid): # Fill the basedn and @OPTION records in domain partition dom_url = "%s://%s" % (backend_store, domainpart_file) dom_ldb = samba.Ldb(dom_url) + + # We need the dummy main-domain DB to have the correct @INDEXLIST + index_res = samdb.search(base="@INDEXLIST", scope=ldb.SCOPE_BASE) + dom_ldb.add(index_res[0]) + domainguid_line = "objectGUID: %s\n-" % domainguid descr = b64encode(get_domain_descriptor(domainsid)) setup_add_ldif(dom_ldb, setup_path("provision_basedn.ldif"), { @@ -821,9 +826,6 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid): setup_add_ldif(dom_ldb, setup_path("provision_basedn_options.ldif"), None) - # We need the dummy main-domain DB to have the correct @INDEXLIST - index_res = samdb.search(base="@INDEXLIST", scope=ldb.SCOPE_BASE) - dom_ldb.add(index_res[0]) except: logger.error( "Failed to setup database for BIND, AD based DNS cannot be used")