diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-01-30 09:11:48 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2014-02-13 11:54:17 +0100 |
commit | 785c0fe34af5705934564bbea08dd4ad15a1970a (patch) | |
tree | 2e8bf3aa70af8b4485399dadff4264b8f9563f70 /source4/winbind | |
parent | 196c6e086ac6960540e6f1a8ddabda24cef01f8b (diff) | |
download | samba-785c0fe34af5705934564bbea08dd4ad15a1970a.tar.gz |
s4:winbind: don't access dcerpc_binding internals in init_domain_binding()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source4/winbind')
-rw-r--r-- | source4/winbind/wb_init_domain.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source4/winbind/wb_init_domain.c b/source4/winbind/wb_init_domain.c index 72a39eb83e3..5353eccd9e3 100644 --- a/source4/winbind/wb_init_domain.c +++ b/source4/winbind/wb_init_domain.c @@ -78,6 +78,7 @@ static struct dcerpc_binding *init_domain_binding(struct init_domain_state *stat const struct ndr_interface_table *table) { struct dcerpc_binding *binding; + enum dcerpc_transport_t transport; char *s; NTSTATUS status; @@ -85,10 +86,14 @@ static struct dcerpc_binding *init_domain_binding(struct init_domain_state *stat if ((lpcfg_server_role(state->service->task->lp_ctx) != ROLE_DOMAIN_MEMBER) && dom_sid_equal(state->domain->info->sid, state->service->primary_sid) && state->service->sec_channel_type != SEC_CHAN_RODC) { - s = talloc_asprintf(state, "ncalrpc:%s", state->domain->dc_name); + s = talloc_asprintf(state, "ncalrpc:%s[target_hostname=%s]", + state->domain->dc_address, + state->domain->dc_name); if (s == NULL) return NULL; } else { - s = talloc_asprintf(state, "ncacn_np:%s", state->domain->dc_name); + s = talloc_asprintf(state, "ncacn_np:%s[target_hostname=%s]", + state->domain->dc_address, + state->domain->dc_name); if (s == NULL) return NULL; } @@ -98,11 +103,8 @@ static struct dcerpc_binding *init_domain_binding(struct init_domain_state *stat return NULL; } - /* Alter binding to contain hostname, but also address (so we don't look it up twice) */ - binding->target_hostname = state->domain->dc_name; - binding->host = state->domain->dc_address; - - if (binding->transport == NCALRPC) { + transport = dcerpc_binding_get_transport(binding); + if (transport == NCALRPC) { return binding; } |