summaryrefslogtreecommitdiff
path: root/source3/rpcclient/rpcclient.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-01-10 21:03:02 +1100
committerStefan Metzmacher <metze@samba.org>2012-01-18 16:23:23 +0100
commitc62af4f6526d5b4a47b70ecfc4c1c03b1b64cf18 (patch)
treed3253d05829569948981434cba9a93a213360e6f /source3/rpcclient/rpcclient.c
parentf14bcdf8ec894d77f80e532859c2c7170406eaad (diff)
downloadsamba-c62af4f6526d5b4a47b70ecfc4c1c03b1b64cf18.tar.gz
samba-c62af4f6526d5b4a47b70ecfc4c1c03b1b64cf18.tar.bz2
samba-c62af4f6526d5b4a47b70ecfc4c1c03b1b64cf18.zip
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 <metze@samba.org>
Diffstat (limited to 'source3/rpcclient/rpcclient.c')
-rw-r--r--source3/rpcclient/rpcclient.c34
1 files changed, 17 insertions, 17 deletions
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(