winbind: set_dc_type_and_flags() is not needed on a DC
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Feb 2018 10:24:38 +0000 (11:24 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 23 Feb 2018 11:47:25 +0000 (12:47 +0100)
On a DC we load the trusts in the parent in add_trusted_domains_dc()
from our local configuration. There's no need to find out the trust details
via network calls.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13278

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/winbindd/winbindd_cm.c

index 27f6f3614e24977fa0ca63f34311043bd08ebbc3..8d8396d1ab2a1d2bb3316d05213f287b2ef926fe 100644 (file)
@@ -2190,6 +2190,15 @@ static bool set_dc_type_and_flags_trustinfo( struct winbindd_domain *domain )
        TALLOC_CTX *mem_ctx = NULL;
        struct dcerpc_binding_handle *b;
 
+       if (IS_DC) {
+               /*
+                * On a DC we loaded all trusts
+                * from configuration and never learn
+                * new domains.
+                */
+               return true;
+       }
+
        DEBUG(5, ("set_dc_type_and_flags_trustinfo: domain %s\n", domain->name ));
 
        /* Our primary domain doesn't need to worry about trust flags.
@@ -2584,6 +2593,15 @@ done:
 
 static void set_dc_type_and_flags( struct winbindd_domain *domain )
 {
+       if (IS_DC) {
+               /*
+                * On a DC we loaded all trusts
+                * from configuration and never learn
+                * new domains.
+                */
+               return;
+       }
+
        /* we always have to contact our primary domain */
 
        if ( domain->primary || domain->internal) {