winbindd: initialize foreign domain as AD based on trust
authorUri Simchoni <uri@samba.org>
Tue, 9 Feb 2016 22:32:23 +0000 (00:32 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 23 Feb 2016 17:52:21 +0000 (18:52 +0100)
Based on trust parameters, initialize the active_directory
member of domain object to true.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/winbindd/winbindd_util.c

index fd133a8d66de0f47feb386a6c320ff9f013e4e8c..020f45b8419509927153d7170c966274676ea3e5 100644 (file)
@@ -250,6 +250,9 @@ add_trusted_domain_from_tdc(const struct winbindd_tdc_domain *tdc,
        if (sid != NULL) {
                sid_copy(&domain->sid, sid);
        }
+       domain->domain_flags = tdc->trust_flags;
+       domain->domain_type = tdc->trust_type;
+       domain->domain_trust_attribs = tdc->trust_attribs;
 
        /* Is this our primary domain ? */
        if (strequal(domain_name, get_global_sam_name()) &&
@@ -267,6 +270,10 @@ add_trusted_domain_from_tdc(const struct winbindd_tdc_domain *tdc,
                if (lp_security() == SEC_ADS) {
                        domain->active_directory = true;
                }
+       } else if (!domain->internal) {
+               if (domain->domain_type == LSA_TRUST_TYPE_UPLEVEL) {
+                       domain->active_directory = true;
+               }
        }
 
        /* Link to domain list */