summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-06-11 14:02:03 +0200
committerStefan Metzmacher <metze@samba.org>2012-06-12 10:48:15 +0200
commit93e950caf8db42750869a0ec8a8d2bcb62a1d98d (patch)
treee76a0cf80a07e9f76cd0be6babcb6ec70f25eee3 /source3
parent2be5ace544a5ec280abb72504f3d4acf5240c425 (diff)
downloadsamba-93e950caf8db42750869a0ec8a8d2bcb62a1d98d.tar.gz
samba-93e950caf8db42750869a0ec8a8d2bcb62a1d98d.tar.bz2
samba-93e950caf8db42750869a0ec8a8d2bcb62a1d98d.zip
s3: Add cli_state->pw_nt_hash
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/include/client.h1
-rw-r--r--source3/libsmb/cliconnect.c6
-rw-r--r--source3/libsmb/clientgen.c4
3 files changed, 10 insertions, 1 deletions
diff --git a/source3/include/client.h b/source3/include/client.h
index 3ebac4c52c..5694ed0888 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -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? */
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index f46ce06e4c..acc3a21c74 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -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;
}
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index c8bd7e5f52..4398d80182 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -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;
}