s3: Add cli_state->pw_nt_hash
authorVolker Lendecke <vl@samba.org>
Mon, 11 Jun 2012 12:02:03 +0000 (14:02 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 12 Jun 2012 08:48:15 +0000 (10:48 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/include/client.h
source3/libsmb/cliconnect.c
source3/libsmb/clientgen.c

index 3ebac4c52c968619160490af9f4ef6fc2f058563..5694ed0888eb9e0b395a18f1d1fd0025625b56ef 100644 (file)
@@ -87,6 +87,7 @@ struct cli_state {
        bool use_kerberos;
        bool fallback_after_kerberos;
        bool use_ccache;
+       bool pw_nt_hash;
        bool got_kerberos_mechanism; /* Server supports krb5 in SPNEGO. */
 
        bool use_oplocks; /* should we use oplocks? */
index f46ce06e4c3ebc96493da6884a01bf2452f63d8f..acc3a21c744b7c70c307c718c0ce3be412937b13 100644 (file)
@@ -1648,7 +1648,11 @@ static struct tevent_req *cli_session_setup_ntlmssp_send(
        if (!NT_STATUS_IS_OK(status)) {
                goto fail;
        }
-       status = ntlmssp_set_password(state->ntlmssp_state, pass);
+       if (cli->pw_nt_hash) {
+               status = ntlmssp_set_password_hash(state->ntlmssp_state, pass);
+       } else {
+               status = ntlmssp_set_password(state->ntlmssp_state, pass);
+       }
        if (!NT_STATUS_IS_OK(status)) {
                goto fail;
        }
index c8bd7e5f5286dd7303988cc7b53bbd8888ee19c5..4398d801821280251ca79e63728fdb99423897b3 100644 (file)
@@ -209,6 +209,10 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
                cli->use_ccache = true;
        }
 
+       if (flags & CLI_FULL_CONNECTION_USE_NT_HASH) {
+               cli->pw_nt_hash = true;
+       }
+
        if (flags & CLI_FULL_CONNECTION_OPLOCKS) {
                cli->use_oplocks = true;
        }