winbindd: fix trust_is_oubound()
authorRalph Boehme <slow@samba.org>
Tue, 28 Nov 2017 16:46:03 +0000 (17:46 +0100)
committerKarolin Seeger <kseeger@samba.org>
Sat, 13 Jan 2018 11:55:08 +0000 (12:55 +0100)
A trust is only inbound if NETR_TRUST_FLAG_OUTBOUND is set. Trust flags = 0x0
does not imply an outbound trust, nor does NETR_TRUST_FLAG_IN_FOREST.

Signed-off-by: Ralph Boehme <slow@samba.org>
source3/winbindd/winbindd_misc.c

index 051e9515f31676b1f158b0f9ed45c68cc00d3f76..d2741cb6b6fc64084db8d066ea5d75086c57f01d 100644 (file)
@@ -68,11 +68,10 @@ static bool trust_is_inbound(struct winbindd_tdc_domain *domain)
 
 static bool trust_is_outbound(struct winbindd_tdc_domain *domain)
 {
-       return (domain->trust_flags == 0x0) ||
-           ((domain->trust_flags & NETR_TRUST_FLAG_IN_FOREST) ==
-            NETR_TRUST_FLAG_IN_FOREST) ||                      
-           ((domain->trust_flags & NETR_TRUST_FLAG_OUTBOUND) ==
-           NETR_TRUST_FLAG_OUTBOUND);          
+       if (domain->trust_flags & NETR_TRUST_FLAG_OUTBOUND) {
+               return true;
+       }
+       return false;
 }
 
 static bool trust_is_transitive(struct winbindd_tdc_domain *domain)