winbindd: fix trust_is_inbound()
authorRalph Boehme <slow@samba.org>
Tue, 28 Nov 2017 16:44:41 +0000 (17:44 +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_INBOUND is set. Trust flags = 0x0
does not imply an inbound trust, nor does NETR_TRUST_FLAG_IN_FOREST.

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

index 51c8799de327e2d995ddc815eda322fe23feb9c3..051e9515f31676b1f158b0f9ed45c68cc00d3f76 100644 (file)
@@ -60,11 +60,10 @@ static const char *get_trust_type_string(struct winbindd_tdc_domain *domain)
 
 static bool trust_is_inbound(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_INBOUND) ==
-           NETR_TRUST_FLAG_INBOUND);           
+       if (domain->trust_flags & NETR_TRUST_FLAG_INBOUND) {
+               return true;
+       }
+       return false;
 }
 
 static bool trust_is_outbound(struct winbindd_tdc_domain *domain)