diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-01-04 13:32:28 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-01-04 21:28:49 +0100 |
commit | fba2fdf2651bd4ffaabb41d5e0506cbf3bcb0699 (patch) | |
tree | dcf3f9bdbc31607b6b4500863b532abdc2cc6710 | |
parent | 8925b03b5997d9e4fff604a2417eb1f4d8958e86 (diff) | |
download | samba-fba2fdf2651bd4ffaabb41d5e0506cbf3bcb0699.tar.gz samba-fba2fdf2651bd4ffaabb41d5e0506cbf3bcb0699.tar.bz2 samba-fba2fdf2651bd4ffaabb41d5e0506cbf3bcb0699.zip |
s3:rpc_client: use dcerpc_epm_Map() and don't ignore 'result' anymore.
metze
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index b59e9db9fd..d7320c1df0 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; |