summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-08 17:29:58 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-15 10:12:17 +0200
commit7f40b606c497c56d05c376c6af82f1c3e4504529 (patch)
tree4aec8f6166d871507925e5945bcdd54f4a260dea /source3/libsmb
parent74a6fb349f935c0eecb3dae151218c2ab25b40e1 (diff)
downloadsamba-7f40b606c497c56d05c376c6af82f1c3e4504529.tar.gz
samba-7f40b606c497c56d05c376c6af82f1c3e4504529.tar.bz2
samba-7f40b606c497c56d05c376c6af82f1c3e4504529.zip
s3:libsmb: use local variables in cli_state_create()
We don't need to keep use_spnego, use_level_II_oplocks, force_dos_errors and force_ascii within struct cli_state. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Sep 15 10:12:17 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c5
-rw-r--r--source3/libsmb/clientgen.c26
2 files changed, 14 insertions, 17 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 24af427d1f..b896f28b0e 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2557,9 +2557,6 @@ struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
}
state->cli = cli;
- if (cli_state_protocol(cli) < PROTOCOL_NT1)
- cli->use_spnego = False;
-
/* setup the protocol strings */
for (numprots=0; numprots < ARRAY_SIZE(prots); numprots++) {
uint8_t c = 2;
@@ -2708,7 +2705,6 @@ static void cli_negprot_done(struct tevent_req *subreq)
return;
}
- cli->use_spnego = False;
cli->sec_mode = SVAL(vwv + 1, 0);
cli->max_xmit = SVAL(vwv + 2, 0);
cli->max_mux = SVAL(vwv + 3, 0);
@@ -2723,7 +2719,6 @@ static void cli_negprot_done(struct tevent_req *subreq)
cli->secblob = data_blob(bytes, num_bytes);
} else {
/* the old core protocol */
- cli->use_spnego = False;
cli->sec_mode = 0;
cli->serverzone = get_time_zone(time(NULL));
cli->max_xmit = 1024;
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 3198c7a733..05f95489ad 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -173,6 +173,10 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
bool mandatory_signing;
socklen_t ss_length;
int ret;
+ bool use_spnego = lp_client_use_spnego();
+ bool force_dos_errors = false;
+ bool force_ascii = false;
+ bool use_level_II_oplocks = false;
/* Check the effective uid - make sure we are not setuid */
if (is_setuid_root()) {
@@ -195,27 +199,25 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
cli->max_xmit = CLI_BUFFER_SIZE+4;
cli->case_sensitive = false;
- cli->use_spnego = lp_client_use_spnego();
-
/* Set the CLI_FORCE_DOSERR environment variable to test
client routines using DOS errors instead of STATUS32
ones. This intended only as a temporary hack. */
if (getenv("CLI_FORCE_DOSERR")) {
- cli->force_dos_errors = true;
+ force_dos_errors = true;
}
if (flags & CLI_FULL_CONNECTION_FORCE_DOS_ERRORS) {
- cli->force_dos_errors = true;
+ force_dos_errors = true;
}
if (getenv("CLI_FORCE_ASCII")) {
- cli->force_ascii = true;
+ force_ascii = true;
}
if (flags & CLI_FULL_CONNECTION_FORCE_ASCII) {
- cli->force_ascii = true;
+ force_ascii = true;
}
if (flags & CLI_FULL_CONNECTION_DONT_SPNEGO) {
- cli->use_spnego = false;
+ use_spnego = false;
} else if (flags & CLI_FULL_CONNECTION_USE_KERBEROS) {
cli->use_kerberos = true;
}
@@ -232,7 +234,7 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
cli->use_oplocks = true;
}
if (flags & CLI_FULL_CONNECTION_LEVEL_II_OPLOCKS) {
- cli->use_level_II_oplocks = true;
+ use_level_II_oplocks = true;
}
if (signing_state == Undefined) {
@@ -285,19 +287,19 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
cli->capabilities |= CAP_LARGE_READX|CAP_LARGE_WRITEX;
cli->capabilities |= CAP_LWIO;
- if (!cli->force_dos_errors) {
+ if (!force_dos_errors) {
cli->capabilities |= CAP_STATUS32;
}
- if (!cli->force_ascii) {
+ if (!force_ascii) {
cli->capabilities |= CAP_UNICODE;
}
- if (cli->use_spnego) {
+ if (use_spnego) {
cli->capabilities |= CAP_EXTENDED_SECURITY;
}
- if (cli->use_level_II_oplocks) {
+ if (use_level_II_oplocks) {
cli->capabilities |= CAP_LEVEL_II_OPLOCKS;
}