summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-21 18:09:47 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-21 18:09:47 +0100
commit299265d47b5b2faac39fbf908c738f336ea21e67 (patch)
treeb447ce13b60bb9ca7753de910aa34edb103c43fd /source4/libcli
parent10169a203019445e6d325a5c1559de3c73782237 (diff)
downloadsamba-299265d47b5b2faac39fbf908c738f336ea21e67.tar.gz
samba-299265d47b5b2faac39fbf908c738f336ea21e67.tar.bz2
samba-299265d47b5b2faac39fbf908c738f336ea21e67.zip
Remove yet more global_loadparm instances.
(This used to be commit 5de88728ac5c567d3711d1ac6862bbdaced84b75)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/raw/clisession.c3
-rw-r--r--source4/libcli/raw/libcliraw.h5
-rw-r--r--source4/libcli/smb_composite/sesssetup.c12
3 files changed, 14 insertions, 6 deletions
diff --git a/source4/libcli/raw/clisession.c b/source4/libcli/raw/clisession.c
index 55cb3ef305..74e8d85c8e 100644
--- a/source4/libcli/raw/clisession.c
+++ b/source4/libcli/raw/clisession.c
@@ -51,6 +51,9 @@ struct smbcli_session *smbcli_session_init(struct smbcli_transport *transport,
}
session->pid = (uint16_t)getpid();
session->vuid = UID_FIELD_INVALID;
+ session->options.lanman_auth = lp_client_lanman_auth(global_loadparm);
+ session->options.ntlmv2_auth = lp_client_ntlmv2_auth(global_loadparm);
+ session->options.plaintext_auth = lp_client_plaintext_auth(global_loadparm);
capabilities = transport->negotiate.capabilities;
diff --git a/source4/libcli/raw/libcliraw.h b/source4/libcli/raw/libcliraw.h
index 7111649fc1..0ea8f9dec2 100644
--- a/source4/libcli/raw/libcliraw.h
+++ b/source4/libcli/raw/libcliraw.h
@@ -186,6 +186,11 @@ struct smbcli_session {
/* the spnego context if we use extented security */
struct gensec_security *gensec;
+
+ struct smbcli_session_options {
+ uint_t lanman_auth;
+ uint_t ntlmv2_auth;
+ } options;
};
/*
diff --git a/source4/libcli/smb_composite/sesssetup.c b/source4/libcli/smb_composite/sesssetup.c
index f5a976958d..75a2a579a2 100644
--- a/source4/libcli/smb_composite/sesssetup.c
+++ b/source4/libcli/smb_composite/sesssetup.c
@@ -226,11 +226,11 @@ static NTSTATUS session_setup_nt1(struct composite_context *c,
DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, lp_iconv_convenience(global_loadparm), session->transport->socket->hostname, lp_workgroup(global_loadparm));
DATA_BLOB session_key;
int flags = CLI_CRED_NTLM_AUTH;
- if (lp_client_lanman_auth(global_loadparm)) {
+ if (session->options.lanman_auth) {
flags |= CLI_CRED_LANMAN_AUTH;
}
- if (lp_client_ntlmv2_auth(global_loadparm)) {
+ if (session->options.ntlmv2_auth) {
flags |= CLI_CRED_NTLMv2_AUTH;
}
@@ -263,7 +263,7 @@ static NTSTATUS session_setup_nt1(struct composite_context *c,
set_user_session_key(session, &session_key);
data_blob_free(&session_key);
- } else if (lp_client_plaintext_auth(global_loadparm)) {
+ } else if (session->options.plaintext_auth) {
state->setup.nt1.in.password1 = data_blob_talloc(state, password, strlen(password));
state->setup.nt1.in.password2 = data_blob(NULL, 0);
} else {
@@ -293,11 +293,11 @@ static NTSTATUS session_setup_old(struct composite_context *c,
DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, lp_iconv_convenience(global_loadparm), session->transport->socket->hostname, lp_workgroup(global_loadparm));
DATA_BLOB session_key;
int flags = 0;
- if (lp_client_lanman_auth(global_loadparm)) {
+ if (session->options.lanman_auth) {
flags |= CLI_CRED_LANMAN_AUTH;
}
- if (lp_client_ntlmv2_auth(global_loadparm)) {
+ if (session->options.ntlmv2_auth) {
flags |= CLI_CRED_NTLMv2_AUTH;
}
@@ -324,7 +324,7 @@ static NTSTATUS session_setup_old(struct composite_context *c,
set_user_session_key(session, &session_key);
data_blob_free(&session_key);
- } else if (lp_client_plaintext_auth(global_loadparm)) {
+ } else if (session->options.plaintext_auth) {
state->setup.old.in.password = data_blob_talloc(state, password, strlen(password));
} else {
/* could match windows client and return 'cannot logon from this workstation', but it just confuses everybody */