Make the repl_meta_data module the default for domain controllers.
authorAndrew Bartlett <abartlet@samba.org>
Thu, 24 Jan 2008 05:17:45 +0000 (16:17 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 24 Jan 2008 05:17:45 +0000 (16:17 +1100)
Andrew Bartlett
(This used to be commit ae2ea1bd0cd2b326b09b372428969f2cf52ce519)

source4/scripting/libjs/provision.js
source4/setup/provision
source4/setup/provision_partitions.ldif
source4/torture/libnet/libnet_BecomeDC.c

index b782d948be2e4607968f99bbb2f9f24c90a5eede..4cb717bde876bb99c9a7d79d7c66b1e8f9747133 100644 (file)
@@ -610,10 +610,21 @@ function provision(subobj, message, blank, paths, session_info, credentials, lda
        var lp = loadparm_init();
        var sys = sys_init();
        var info = new Object();
        var lp = loadparm_init();
        var sys = sys_init();
        var info = new Object();
+       random_init(local);
 
        var ok = provision_fix_subobj(subobj, paths);
        assert(ok);
 
 
        var ok = provision_fix_subobj(subobj, paths);
        assert(ok);
 
+       if (strlower(subobj.SERVERROLE) == strlower("domain controller")) {
+               if (subobj.BACKEND_MOD == undefined) {
+                       subobj.BACKEND_MOD = "repl_meta_data";
+               }
+       } else {
+               if (subobj.BACKEND_MOD == undefined) {
+                       subobj.BACKEND_MOD = "objectguid";
+               }
+       }
+
        if (subobj.DOMAINGUID != undefined) {
                subobj.DOMAINGUID_MOD = sprintf("replace: objectGUID\nobjectGUID: %s\n-", subobj.DOMAINGUID);
        } else {
        if (subobj.DOMAINGUID != undefined) {
                subobj.DOMAINGUID_MOD = sprintf("replace: objectGUID\nobjectGUID: %s\n-", subobj.DOMAINGUID);
        } else {
@@ -693,7 +704,19 @@ function provision(subobj, message, blank, paths, session_info, credentials, lda
 
        samdb.set_domain_sid(subobj.DOMAINSID);
 
 
        samdb.set_domain_sid(subobj.DOMAINSID);
 
-       samdb.set_ntds_invocationId(subobj.INVOCATIONID);
+       if (strlower(subobj.SERVERROLE) == strlower("domain controller")) {
+               if (subobj.INVOCATIONID == undefined) {
+                       subobj.INVOCATIONID = randguid();
+               }
+               samdb.set_ntds_invocationId(subobj.INVOCATIONID);
+               if (subobj.BACKEND_MOD == undefined) {
+                       subobj.BACKEND_MOD = "repl_meta_data";
+               }
+       } else {
+               if (subobj.BACKEND_MOD == undefined) {
+                       subobj.BACKEND_MOD = "objectguid";
+               }
+       }
 
        var load_schema_ok = load_schema(subobj, message, samdb);
        assert(load_schema_ok.is_ok);
 
        var load_schema_ok = load_schema(subobj, message, samdb);
        assert(load_schema_ok.is_ok);
@@ -960,7 +983,6 @@ function provision_guess()
        subobj.VERSION      = version();
        subobj.HOSTIP       = hostip();
        subobj.DOMAINSID    = randsid();
        subobj.VERSION      = version();
        subobj.HOSTIP       = hostip();
        subobj.DOMAINSID    = randsid();
-       subobj.INVOCATIONID = randguid();
        subobj.POLICYGUID   = randguid();
        subobj.KRBTGTPASS   = randpass(12);
        subobj.MACHINEPASS  = randpass(12);
        subobj.POLICYGUID   = randguid();
        subobj.KRBTGTPASS   = randpass(12);
        subobj.MACHINEPASS  = randpass(12);
@@ -1012,9 +1034,6 @@ function provision_guess()
        subobj.DOMAINDN_MOD = "pdc_fsmo,password_hash,instancetype";
        subobj.CONFIGDN_MOD = "naming_fsmo,instancetype";
        subobj.SCHEMADN_MOD = "schema_fsmo,instancetype";
        subobj.DOMAINDN_MOD = "pdc_fsmo,password_hash,instancetype";
        subobj.CONFIGDN_MOD = "naming_fsmo,instancetype";
        subobj.SCHEMADN_MOD = "schema_fsmo,instancetype";
-       subobj.DOMAINDN_MOD2 = ",repl_meta_data";
-       subobj.CONFIGDN_MOD2 = ",repl_meta_data";
-       subobj.SCHEMADN_MOD2 = ",repl_meta_data";
 
        subobj.ACI              = "# no aci for local ldb";
 
 
        subobj.ACI              = "# no aci for local ldb";
 
index 8b24c510401c24c81c0bc3211eeb490e7be195b2..9e135cddbb49207356041849b1fa89b681ae7009 100755 (executable)
@@ -143,12 +143,10 @@ if (ldapbackend) {
                subobj.LDAPMODULE = "normalise,entryuuid";
                subobj.TDB_MODULES_LIST = "";
        }
                subobj.LDAPMODULE = "normalise,entryuuid";
                subobj.TDB_MODULES_LIST = "";
        }
+       subobj.BACKEND_MOD = subobj.LDAPMODULE + ",paged_searches";
        subobj.DOMAINDN_LDB = subobj.LDAPBACKEND;
        subobj.DOMAINDN_LDB = subobj.LDAPBACKEND;
-       subobj.DOMAINDN_MOD2 = "," + subobj.LDAPMODULE + ",paged_searches";
        subobj.CONFIGDN_LDB = subobj.LDAPBACKEND;
        subobj.CONFIGDN_LDB = subobj.LDAPBACKEND;
-       subobj.CONFIGDN_MOD2 = "," + subobj.LDAPMODULE + ",paged_searches";
        subobj.SCHEMADN_LDB = subobj.LDAPBACKEND;
        subobj.SCHEMADN_LDB = subobj.LDAPBACKEND;
-       subobj.SCHEMADN_MOD2 = "," + subobj.LDAPMODULE + ",paged_searches";
        message("LDAP module: %s on backend: %s\n", subobj.LDAPMODULE, subobj.LDAPBACKEND);
 }
 
        message("LDAP module: %s on backend: %s\n", subobj.LDAPMODULE, subobj.LDAPBACKEND);
 }
 
@@ -175,7 +173,9 @@ if (partitions_only) {
                 message("--host-guid='%s' \\\n", subobj.HOSTGUID);
        }
        message("--policy-guid='%s' --host-name='%s' --host-ip='%s' \\\n", subobj.POLICYGUID, subobj.HOSTNAME, subobj.HOSTIP);
                 message("--host-guid='%s' \\\n", subobj.HOSTGUID);
        }
        message("--policy-guid='%s' --host-name='%s' --host-ip='%s' \\\n", subobj.POLICYGUID, subobj.HOSTNAME, subobj.HOSTIP);
-       message("--invocationid='%s' \\\n", subobj.INVOCATIONID);
+       if (subobj.INVOCATIONID != undefined) {
+               message("--invocationid='%s' \\\n", subobj.INVOCATIONID);
+       }
        message("--adminpass='%s' --krbtgtpass='%s' \\\n", subobj.ADMINPASS, subobj.KRBTGTPASS);
        message("--machinepass='%s' --dnspass='%s' \\\n", subobj.MACHINEPASS, subobj.DNSPASS);
        message("--root='%s' --nobody='%s' --nogroup='%s' \\\n", subobj.ROOT, subobj.NOBODY, subobj.NOGROUP);
        message("--adminpass='%s' --krbtgtpass='%s' \\\n", subobj.ADMINPASS, subobj.KRBTGTPASS);
        message("--machinepass='%s' --dnspass='%s' \\\n", subobj.MACHINEPASS, subobj.DNSPASS);
        message("--root='%s' --nobody='%s' --nogroup='%s' \\\n", subobj.ROOT, subobj.NOBODY, subobj.NOGROUP);
index fb8bc7f595c985877037cbeadd410e6559683401..93fea6bc2d05cfec74cde3d75e239dc7b2e78071 100644 (file)
@@ -5,9 +5,9 @@ partition: ${DOMAINDN}:${DOMAINDN_LDB}
 replicateEntries: @ATTRIBUTES
 replicateEntries: @INDEXLIST
 replicateEntries: @OPTIONS
 replicateEntries: @ATTRIBUTES
 replicateEntries: @INDEXLIST
 replicateEntries: @OPTIONS
-modules:${SCHEMADN}:${SCHEMADN_MOD}${SCHEMADN_MOD2}
-modules:${CONFIGDN}:${CONFIGDN_MOD}${CONFIGDN_MOD2}
-modules:${DOMAINDN}:${DOMAINDN_MOD}${DOMAINDN_MOD2}
+modules:${SCHEMADN}:${SCHEMADN_MOD},${BACKEND_MOD}
+modules:${CONFIGDN}:${CONFIGDN_MOD},${BACKEND_MOD}
+modules:${DOMAINDN}:${DOMAINDN_MOD},${BACKEND_MOD}
 
 dn: @MODULES
 @LIST: ${MODULES_LIST}${TDB_MODULES_LIST},${MODULES_LIST2}
 
 dn: @MODULES
 @LIST: ${MODULES_LIST}${TDB_MODULES_LIST},${MODULES_LIST2}
index 932498a5178ec25978840fe10ce995bf590c9e2f..d9645356e81e0603061ba4d5aa924d3a7c3d5f98 100644 (file)
@@ -201,10 +201,6 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
                "subobj.DOMAIN       = \"%s\";\n"
                "subobj.DEFAULTSITE  = \"%s\";\n"
                "\n"
                "subobj.DOMAIN       = \"%s\";\n"
                "subobj.DEFAULTSITE  = \"%s\";\n"
                "\n"
-               "subobj.DOMAINDN_MOD2 = \",repl_meta_data\";\n"
-               "subobj.CONFIGDN_MOD2 = \",repl_meta_data\";\n"
-               "subobj.SCHEMADN_MOD2 = \",repl_meta_data\";\n"
-               "\n"
                "subobj.KRBTGTPASS   = \"_NOT_USED_\";\n"
                "subobj.MACHINEPASS  = \"%s\";\n"
                "subobj.ADMINPASS    = \"_NOT_USED_\";\n"
                "subobj.KRBTGTPASS   = \"_NOT_USED_\";\n"
                "subobj.MACHINEPASS  = \"%s\";\n"
                "subobj.ADMINPASS    = \"_NOT_USED_\";\n"