r4484: - use the nTMixedDomain attribute to check if our domain is mixed mode or not
authorStefan Metzmacher <metze@samba.org>
Sun, 2 Jan 2005 16:24:05 +0000 (16:24 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:08:11 +0000 (13:08 -0500)
metze
(This used to be commit 7fe9550375a7a922f9fc93944acaf7915ee107c1)

source4/provision.ldif
source4/rpc_server/dssetup/dcesrv_dssetup.c

index 6271a6fa2be011cc3226283b84bd277802dbfb57..8ebf6a9c408c50094a2228bfe8c7794c905eb641 100644 (file)
@@ -66,6 +66,7 @@ pwdProperties: 1
 pwdHistoryLength: 24
 objectSid: ${DOMAINSID}
 serverState: 1
+nTMixedDomain: 1
 uASCompat: 1
 modifiedCount: 1
 objectCategory: CN=Domain-DNS,CN=Schema,CN=Configuration,${BASEDN}
index 9277298f6652b2c09a12d09a478edcfa3a159f43..f57f461ca533ba9c4bc45e2f86687da94055fa0b 100644 (file)
@@ -39,7 +39,7 @@ static WERROR dssetup_DsRoleGetPrimaryDomainInformation(struct dcesrv_call_state
        case DS_ROLE_BASIC_INFORMATION:
        {
                void *sam_ctx;
-               const char * const attrs[] = { "dnsDomain", "objectGUID", "name", NULL };
+               const char * const attrs[] = { "dnsDomain", "nTMixedDomain", "objectGUID", "name", NULL };
                int ret;
                struct ldb_message **res;
                union dssetup_DsRoleInfo *info;
@@ -95,13 +95,17 @@ static WERROR dssetup_DsRoleGetPrimaryDomainInformation(struct dcesrv_call_state
                                return WERR_SERVER_UNAVAILABLE;
                        }
 
-                       flags           = 0;
-                       flags           |= DS_ROLE_PRIMARY_DS_RUNNING;
-                       flags           |= DS_ROLE_PRIMARY_DS_MIXED_MODE;
-                       flags           |= DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT;
+                       flags           = DS_ROLE_PRIMARY_DS_RUNNING;
+
+                       if (samdb_result_uint(res[0], "nTMixedDomain", 0) == 1) {
+                               flags           |= DS_ROLE_PRIMARY_DS_MIXED_MODE;
+                       }
+
                        domain          = samdb_result_string(res[0], "name", NULL);
                        dns_domain      = samdb_result_string(res[0], "dnsDomain", NULL);
                        forest          = samdb_result_string(res[0], "dnsDomain", NULL);
+
+                       flags           |= DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT;
                        domain_guid     = samdb_result_guid(res[0], "objectGUID");
                        break;
                }