From: Ralph Boehme Date: Sun, 14 Jan 2018 08:58:13 +0000 (+0100) Subject: winbindd: set routing_domain when enumerating trusts X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=9b423fe804dc6a451629d30b73d72635d3598dd4 winbindd: set routing_domain when enumerating trusts Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 2a975220ad05..4d66571703f9 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -414,6 +414,7 @@ static void trustdom_list_done(struct tevent_req *req) ptrdiff_t extra_len; bool within_forest = false; NTSTATUS status; + bool ok; /* * Only when we enumerate our primary domain @@ -546,6 +547,12 @@ static void trustdom_list_done(struct tevent_req *req) return; } + ok = set_routing_domain(domain, find_default_route_domain()); + if (!ok) { + DBG_ERR("set_routing_domain failed\n"); + return; + } + p = q + strlen(q) + 1; } @@ -588,6 +595,7 @@ static void rescan_forest_root_trusts( void ) size_t num_trusts = 0; int i; NTSTATUS status; + bool ok; /* The only transitive trusts supported by Windows 2003 AD are (a) Parent-Child, (b) Tree-Root, and (c) Forest. The @@ -629,6 +637,11 @@ static void rescan_forest_root_trusts( void ) nt_errstr(status)); return; } + ok = set_routing_domain(d, find_default_route_domain()); + if (!ok) { + DBG_ERR("set_routing_domain failed\n"); + return; + } } if (d == NULL) { continue; @@ -664,6 +677,7 @@ static void rescan_forest_trusts( void ) size_t num_trusts = 0; int i; NTSTATUS status; + bool ok; /* The only transitive trusts supported by Windows 2003 AD are (a) Parent-Child, (b) Tree-Root, and (c) Forest. The @@ -711,6 +725,12 @@ static void rescan_forest_trusts( void ) nt_errstr(status)); return; } + ok = set_routing_domain( + d, find_default_route_domain()); + if (!ok) { + DBG_ERR("set_routing_domain failed\n"); + return; + } } if (d == NULL) { @@ -817,6 +837,7 @@ static void wb_imsg_new_trusted_domain(struct imessaging_context *msg, struct winbindd_domain *d = NULL; uint32_t trust_flags = 0; NTSTATUS status; + bool ok; DEBUG(5, ("wb_imsg_new_trusted_domain\n")); @@ -867,6 +888,11 @@ static void wb_imsg_new_trusted_domain(struct imessaging_context *msg, TALLOC_FREE(frame); return; } + ok = set_routing_domain(d, find_default_route_domain()); + if (!ok) { + TALLOC_FREE(frame); + return; + } TALLOC_FREE(frame); }