From 3732798008f26052c030e8a8fc9c9404fd6f5669 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 12 Nov 2009 16:45:33 +0100 Subject: s3-rpcclient: use the parsed binding string flags for auth choice. This allows rpcclient to be called like this: rpcclient ncacn_ip_tcp:w2k8r2[sign,seal] -U administrator%secret -c "dscracknames gd" Guenther --- source3/rpcclient/rpcclient.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/rpcclient/rpcclient.c') diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index dbf7f1ff7e..5f59c26583 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -965,6 +965,24 @@ out_free: binding->transport = NCACN_NP; } + if (binding->flags & DCERPC_SIGN) { + pipe_default_auth_level = DCERPC_AUTH_LEVEL_INTEGRITY; + pipe_default_auth_type = PIPE_AUTH_TYPE_NTLMSSP; + } + if (binding->flags & DCERPC_SEAL) { + pipe_default_auth_level = DCERPC_AUTH_LEVEL_PRIVACY; + pipe_default_auth_type = PIPE_AUTH_TYPE_NTLMSSP; + } + if (binding->flags & DCERPC_AUTH_SPNEGO) { + pipe_default_auth_type = PIPE_AUTH_TYPE_SPNEGO_NTLMSSP; + } + if (binding->flags & DCERPC_AUTH_NTLM) { + pipe_default_auth_type = PIPE_AUTH_TYPE_NTLMSSP; + } + if (binding->flags & DCERPC_AUTH_KRB5) { + pipe_default_auth_type = PIPE_AUTH_TYPE_SPNEGO_KRB5; + } + if (get_cmdline_auth_info_use_kerberos(rpcclient_auth_info)) { flags |= CLI_FULL_CONNECTION_USE_KERBEROS | CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS; -- cgit