s4-provision: Ensure the dummy main-domain DB used for DLZ has an @INDEXLIST
authorAndrew Bartlett <abartlet@samba.org>
Wed, 30 Aug 2017 03:30:04 +0000 (15:30 +1200)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Sep 2017 16:43:16 +0000 (18:43 +0200)
The other databases are created from copies of the main provision, but this one
is not, so did not previously get a valid @INDEXLIST.

This is important as otherwise we will not correctly notice support for
the GUID index or new DSDB features in @SAMBA_DSDB as this is gated
on seeing @SAMBA_FEATURES_SUPPORTED in @INDEXLIST.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/provision/sambadns.py

index d4cb93a89ea85de9ab98f25b80646d08bd974fda..fce72adc5337e1d7d412b3d99ac07f3bdbcf7b5b 100644 (file)
@@ -809,6 +809,10 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid):
             "DESCRIPTOR" : descr})
         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")