s3-rpcclient: use the parsed binding string flags for auth choice.
authorGünther Deschner <gd@samba.org>
Thu, 12 Nov 2009 15:45:33 +0000 (16:45 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 13 Nov 2009 00:13:06 +0000 (01:13 +0100)
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

index dbf7f1ff7eeafbda1586d86affcaa3dbbcfcf57b..5f59c26583abb6092af9832385586251660836d5 100644 (file)
@@ -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;