s3-rpcclient: Allow choosing spnego mech: (ntlm/krb5)
authorSimo Sorce <idra@samba.org>
Tue, 20 Jul 2010 21:26:32 +0000 (17:26 -0400)
committerSimo Sorce <idra@samba.org>
Wed, 28 Jul 2010 16:20:01 +0000 (12:20 -0400)
source3/rpcclient/rpcclient.c

index 7f16bdb1107661f5a3a698ae2e746903dfea0df5..8b422a28a1bc10aab728be2d818ab7f4a975565a 100644 (file)
@@ -998,11 +998,18 @@ out_free:
                pipe_default_auth_spnego_type = PIPE_AUTH_TYPE_SPNEGO_NTLMSSP;
        }
        if (binding->flags & DCERPC_AUTH_NTLM) {
-               pipe_default_auth_type = DCERPC_AUTH_TYPE_NTLMSSP;
+               if (pipe_default_auth_type == DCERPC_AUTH_TYPE_SPNEGO) {
+                       pipe_default_auth_spnego_type = PIPE_AUTH_TYPE_SPNEGO_NTLMSSP;
+               } else {
+                       pipe_default_auth_type = DCERPC_AUTH_TYPE_NTLMSSP;
+               }
        }
        if (binding->flags & DCERPC_AUTH_KRB5) {
-               pipe_default_auth_type = DCERPC_AUTH_TYPE_SPNEGO;
-               pipe_default_auth_spnego_type = PIPE_AUTH_TYPE_SPNEGO_KRB5;
+               if (pipe_default_auth_type == DCERPC_AUTH_TYPE_SPNEGO) {
+                       pipe_default_auth_spnego_type = PIPE_AUTH_TYPE_SPNEGO_KRB5;
+               } else {
+                       pipe_default_auth_type = DCERPC_AUTH_TYPE_KRB5;
+               }
        }
 
        if (get_cmdline_auth_info_use_kerberos(rpcclient_auth_info)) {