From c62af4f6526d5b4a47b70ecfc4c1c03b1b64cf18 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 10 Jan 2012 21:03:02 +1100 Subject: s3-librpc Make cli_rpc_pipe_open_spnego_ntlmssp() generic This also avoids passing NULL as the server to gensec_set_target_hostname() in spnego_generic_init_client(). Andrew Bartlett Signed-off-by: Stefan Metzmacher --- source3/rpcclient/rpcclient.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'source3/rpcclient') diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index 27deff56ff..39b54bf052 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -31,6 +31,7 @@ #include "../libcli/security/security.h" #include "passdb.h" #include "libsmb/libsmb.h" +#include "auth/gensec/gensec.h" enum pipe_auth_type_spnego { PIPE_AUTH_TYPE_SPNEGO_NONE = 0, @@ -690,30 +691,29 @@ static NTSTATUS do_cmd(struct cli_state *cli, &cmd_entry->rpc_pipe); break; case DCERPC_AUTH_TYPE_SPNEGO: + { + /* won't happen, but if it does it will fail in cli_rpc_pipe_open_spnego() eventually */ + const char *oid = "INVALID"; switch (pipe_default_auth_spnego_type) { case PIPE_AUTH_TYPE_SPNEGO_NTLMSSP: - ntresult = cli_rpc_pipe_open_spnego_ntlmssp( - cli, cmd_entry->interface, - default_transport, - pipe_default_auth_level, - get_cmdline_auth_info_domain(auth_info), - get_cmdline_auth_info_username(auth_info), - get_cmdline_auth_info_password(auth_info), - &cmd_entry->rpc_pipe); + oid = GENSEC_OID_NTLMSSP; break; case PIPE_AUTH_TYPE_SPNEGO_KRB5: - ntresult = cli_rpc_pipe_open_spnego_krb5( - cli, cmd_entry->interface, - default_transport, - pipe_default_auth_level, - cli_state_remote_name(cli), - NULL, NULL, - &cmd_entry->rpc_pipe); + oid = GENSEC_OID_KERBEROS5; break; - default: - ntresult = NT_STATUS_INTERNAL_ERROR; } + ntresult = cli_rpc_pipe_open_spnego( + cli, cmd_entry->interface, + default_transport, + oid, + pipe_default_auth_level, + cli_state_remote_name(cli), + get_cmdline_auth_info_domain(auth_info), + get_cmdline_auth_info_username(auth_info), + get_cmdline_auth_info_password(auth_info), + &cmd_entry->rpc_pipe); break; + } case DCERPC_AUTH_TYPE_NTLMSSP: case DCERPC_AUTH_TYPE_KRB5: ntresult = cli_rpc_pipe_open_generic_auth( -- cgit