From fba2fdf2651bd4ffaabb41d5e0506cbf3bcb0699 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 4 Jan 2011 13:32:28 +0100 Subject: [PATCH] s3:rpc_client: use dcerpc_epm_Map() and don't ignore 'result' anymore. metze --- source3/rpc_client/cli_pipe.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index b59e9db9fd43..d7320c1df02d 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -2464,6 +2464,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host, { NTSTATUS status; struct rpc_pipe_client *epm_pipe = NULL; + struct dcerpc_binding_handle *epm_handle = NULL; struct pipe_auth_data *auth = NULL; struct dcerpc_binding *map_binding = NULL; struct dcerpc_binding *res_binding = NULL; @@ -2474,6 +2475,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host, uint32_t max_towers = 1; struct epm_twr_p_t towers; TALLOC_CTX *tmp_ctx = talloc_stackframe(); + uint32_t result = 0; if (pport == NULL) { status = NT_STATUS_INVALID_PARAMETER; @@ -2488,6 +2490,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host, if (!NT_STATUS_IS_OK(status)) { goto done; } + epm_handle = epm_pipe->binding_handle; status = rpccli_anon_bind_data(tmp_ctx, &auth); if (!NT_STATUS_IS_OK(status)) { @@ -2541,7 +2544,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host, /* ask the endpoint mapper for the port */ - status = rpccli_epm_Map(epm_pipe, + status = dcerpc_epm_Map(epm_handle, tmp_ctx, CONST_DISCARD(struct GUID *, &(abstract_syntax->uuid)), @@ -2549,12 +2552,18 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host, entry_handle, max_towers, &num_towers, - &towers); + &towers, + &result); if (!NT_STATUS_IS_OK(status)) { goto done; } + if (result != EPMAPPER_STATUS_OK) { + status = NT_STATUS_UNSUCCESSFUL; + goto done; + } + if (num_towers != 1) { status = NT_STATUS_UNSUCCESSFUL; goto done; -- 2.34.1