diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-01-10 21:53:42 +1100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-01-18 16:23:24 +0100 |
commit | 40715e1251dc27a677c1b0b894406b6d86e391f0 (patch) | |
tree | e43d45a797e37c760f5c7319a4dab4b15937a738 /source3/rpc_client | |
parent | 9729bdf89f20998823a1dda9e215647a49ca76a6 (diff) | |
download | samba-40715e1251dc27a677c1b0b894406b6d86e391f0.tar.gz samba-40715e1251dc27a677c1b0b894406b6d86e391f0.tar.bz2 samba-40715e1251dc27a677c1b0b894406b6d86e391f0.zip |
s3-librpc: pass struct ndr_interface_table down to cli_pipe_open_generic/spnego()
This allows the target service (as determined from the IDL) to be
passed to GSSAPI (rather than the current, incorrect, "cifs").
Andrew Bartlett
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 15 | ||||
-rw-r--r-- | source3/rpc_client/cli_pipe.h | 4 | ||||
-rw-r--r-- | source3/rpc_client/cli_pipe_schannel.c | 2 |
3 files changed, 10 insertions, 11 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 2ddf7bceb1..7b3cc252f0 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -2812,7 +2812,7 @@ NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli, ****************************************************************************/ NTSTATUS cli_rpc_pipe_open_generic_auth(struct cli_state *cli, - const struct ndr_syntax_id *interface, + const struct ndr_interface_table *table, enum dcerpc_transport_t transport, enum dcerpc_AuthType auth_type, enum dcerpc_AuthLevel auth_level, @@ -2824,10 +2824,10 @@ NTSTATUS cli_rpc_pipe_open_generic_auth(struct cli_state *cli, { struct rpc_pipe_client *result; struct pipe_auth_data *auth = NULL; - const char *target_service = "cifs"; /* TODO: Determine target service from the bindings or interface table */ + const char *target_service = table->authservices->names[0]; NTSTATUS status; - status = cli_rpc_pipe_open(cli, transport, interface, &result); + status = cli_rpc_pipe_open(cli, transport, &table->syntax_id, &result); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -2851,8 +2851,7 @@ NTSTATUS cli_rpc_pipe_open_generic_auth(struct cli_state *cli, } DEBUG(10,("cli_rpc_pipe_open_generic_auth: opened pipe %s to " - "machine %s and bound as user %s\\%s.\n", - get_pipe_name_from_syntax(talloc_tos(), interface), + "machine %s and bound as user %s\\%s.\n", table->name, result->desthost, domain, username)); *presult = result; @@ -2927,7 +2926,7 @@ NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli, } NTSTATUS cli_rpc_pipe_open_spnego(struct cli_state *cli, - const struct ndr_syntax_id *interface, + const struct ndr_interface_table *table, enum dcerpc_transport_t transport, const char *oid, enum dcerpc_AuthLevel auth_level, @@ -2941,9 +2940,9 @@ NTSTATUS cli_rpc_pipe_open_spnego(struct cli_state *cli, struct pipe_auth_data *auth; struct spnego_context *spnego_ctx; NTSTATUS status; - const char *target_service = "cifs"; /* TODO: Determine target service from the bindings or interface table */ + const char *target_service = table->authservices->names[0]; - status = cli_rpc_pipe_open(cli, transport, interface, &result); + status = cli_rpc_pipe_open(cli, transport, &table->syntax_id, &result); if (!NT_STATUS_IS_OK(status)) { return status; } diff --git a/source3/rpc_client/cli_pipe.h b/source3/rpc_client/cli_pipe.h index 25c9fca825..3984cf0858 100644 --- a/source3/rpc_client/cli_pipe.h +++ b/source3/rpc_client/cli_pipe.h @@ -85,7 +85,7 @@ NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli, struct rpc_pipe_client **presult); NTSTATUS cli_rpc_pipe_open_generic_auth(struct cli_state *cli, - const struct ndr_syntax_id *interface, + const struct ndr_interface_table *table, enum dcerpc_transport_t transport, enum dcerpc_AuthType auth_type, enum dcerpc_AuthLevel auth_level, @@ -96,7 +96,7 @@ NTSTATUS cli_rpc_pipe_open_generic_auth(struct cli_state *cli, struct rpc_pipe_client **presult); NTSTATUS cli_rpc_pipe_open_spnego(struct cli_state *cli, - const struct ndr_syntax_id *interface, + const struct ndr_interface_table *table, enum dcerpc_transport_t transport, const char *oid, enum dcerpc_AuthLevel auth_level, diff --git a/source3/rpc_client/cli_pipe_schannel.c b/source3/rpc_client/cli_pipe_schannel.c index 4a11f08a12..0ee2a8551f 100644 --- a/source3/rpc_client/cli_pipe_schannel.c +++ b/source3/rpc_client/cli_pipe_schannel.c @@ -100,7 +100,7 @@ static NTSTATUS get_schannel_session_key_auth_ntlmssp(struct cli_state *cli, NTSTATUS status; status = cli_rpc_pipe_open_spnego( - cli, &ndr_table_netlogon.syntax_id, NCACN_NP, + cli, &ndr_table_netlogon, NCACN_NP, GENSEC_OID_NTLMSSP, DCERPC_AUTH_LEVEL_PRIVACY, cli_state_remote_name(cli), |