mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
Remove yet more global_loadparm instances.
This commit is contained in:
parent
a1280252ce
commit
5de88728ac
@ -273,6 +273,7 @@ _PUBLIC_ WERROR reg_generate_diff(struct registry_context *ctx1,
|
||||
* Load diff file
|
||||
*/
|
||||
_PUBLIC_ WERROR reg_diff_load(const char *filename,
|
||||
struct smb_iconv_convenience *iconv_convenience,
|
||||
const struct reg_diff_callbacks *callbacks,
|
||||
void *callback_data)
|
||||
{
|
||||
@ -308,7 +309,7 @@ _PUBLIC_ WERROR reg_diff_load(const char *filename,
|
||||
return reg_preg_diff_load(fd, callbacks, callback_data);
|
||||
} else {
|
||||
/* Must be a normal .REG file */
|
||||
return reg_dotreg_diff_load(fd, lp_iconv_convenience(global_loadparm), callbacks, callback_data);
|
||||
return reg_dotreg_diff_load(fd, iconv_convenience, callbacks, callback_data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -442,5 +443,6 @@ _PUBLIC_ WERROR reg_diff_apply(struct registry_context *ctx, const char *filenam
|
||||
callbacks.del_all_values = reg_diff_apply_del_all_values;
|
||||
callbacks.done = NULL;
|
||||
|
||||
return reg_diff_load(filename, &callbacks, ctx);
|
||||
return reg_diff_load(filename, lp_iconv_convenience(global_loadparm),
|
||||
&callbacks, ctx);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -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 */
|
||||
|
@ -146,7 +146,7 @@ static void smbsrv_accept(struct stream_connection *conn)
|
||||
packet_set_fde(smb_conn->packet, conn->event.fde);
|
||||
packet_set_serialise(smb_conn->packet);
|
||||
|
||||
smb_conn->lp_ctx = global_loadparm;
|
||||
smb_conn->lp_ctx = conn->lp_ctx;
|
||||
smb_conn->connection = conn;
|
||||
conn->private = smb_conn;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user