summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-08-01 17:01:42 +0200
committerStefan Metzmacher <metze@samba.org>2011-08-02 04:54:29 +0200
commit91b0aab3fc5076a6399e6970cb7b2f1a442d5566 (patch)
tree3852b5eca006abc1a87b0e6e070024634be117b2 /source3/libsmb
parent5e59a36beb7d200fc284d28812baa7e46adeced1 (diff)
downloadsamba-91b0aab3fc5076a6399e6970cb7b2f1a442d5566.tar.gz
samba-91b0aab3fc5076a6399e6970cb7b2f1a442d5566.tar.bz2
samba-91b0aab3fc5076a6399e6970cb7b2f1a442d5566.zip
s3:libsmb/cli*: make use of cli_state_protocol()
metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c20
-rw-r--r--source3/libsmb/clidfs.c4
-rw-r--r--source3/libsmb/clientgen.c2
-rw-r--r--source3/libsmb/clilist.c2
4 files changed, 14 insertions, 14 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 1547a241be..d91d241eaf 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1995,7 +1995,7 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
workgroup = user2;
}
- if (cli->protocol < PROTOCOL_LANMAN1) {
+ if (cli_state_protocol(cli) < PROTOCOL_LANMAN1) {
return NT_STATUS_OK;
}
@@ -2005,7 +2005,7 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
/* if its an older server then we have to use the older request format */
- if (cli->protocol < PROTOCOL_NT1) {
+ if (cli_state_protocol(cli) < PROTOCOL_NT1) {
if (!lp_client_lanman_auth() && passlen != 24 && (*pass)) {
DEBUG(1, ("Server requested LM password but 'client lanman auth = no'"
" or 'client ntlmv2 auth = yes'\n"));
@@ -2390,7 +2390,7 @@ static void cli_tcon_andx_done(struct tevent_req *subreq)
}
}
- if ((cli->protocol >= PROTOCOL_NT1) && (num_bytes == 3)) {
+ if ((cli_state_protocol(cli) >= PROTOCOL_NT1) && (num_bytes == 3)) {
/* almost certainly win95 - enable bug fixes */
cli->win95 = True;
}
@@ -2402,7 +2402,7 @@ static void cli_tcon_andx_done(struct tevent_req *subreq)
cli->dfsroot = false;
- if ((wct > 2) && (cli->protocol >= PROTOCOL_LANMAN2)) {
+ if ((wct > 2) && (cli_state_protocol(cli) >= PROTOCOL_LANMAN2)) {
cli->dfsroot = ((SVAL(vwv+2, 0) & SMB_SHARE_IN_DFS) != 0);
}
@@ -2559,13 +2559,13 @@ struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
}
state->cli = cli;
- if (cli->protocol < PROTOCOL_NT1)
+ 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;
- if (prots[numprots].prot > cli->protocol) {
+ if (prots[numprots].prot > cli_state_protocol(cli)) {
break;
}
bytes = (uint8_t *)talloc_append_blob(
@@ -2618,21 +2618,21 @@ static void cli_negprot_done(struct tevent_req *subreq)
protnum = SVAL(vwv, 0);
if ((protnum >= ARRAY_SIZE(prots))
- || (prots[protnum].prot > cli->protocol)) {
+ || (prots[protnum].prot > cli_state_protocol(cli))) {
tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
return;
}
cli->protocol = prots[protnum].prot;
- if ((cli->protocol < PROTOCOL_NT1) &&
+ if ((cli_state_protocol(cli) < PROTOCOL_NT1) &&
client_is_signing_mandatory(cli)) {
DEBUG(0,("cli_negprot: SMB signing is mandatory and the selected protocol level doesn't support it.\n"));
tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
return;
}
- if (cli->protocol >= PROTOCOL_NT1) {
+ if (cli_state_protocol(cli) >= PROTOCOL_NT1) {
struct timespec ts;
bool negotiated_smb_signing = false;
@@ -2695,7 +2695,7 @@ static void cli_negprot_done(struct tevent_req *subreq)
cli_set_signing_negotiated(cli);
}
- } else if (cli->protocol >= PROTOCOL_LANMAN1) {
+ } else if (cli_state_protocol(cli) >= PROTOCOL_LANMAN1) {
cli->use_spnego = False;
cli->sec_mode = SVAL(vwv + 1, 0);
cli->max_xmit = SVAL(vwv + 2, 0);
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 514ff80695..e54da6fe89 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -858,7 +858,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
dfs_auth_info,
false,
(rootcli->trans_enc_state != NULL),
- rootcli->protocol,
+ cli_state_protocol(rootcli),
0,
0x20,
&cli_ipc);
@@ -909,7 +909,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
dfs_auth_info,
false,
(rootcli->trans_enc_state != NULL),
- rootcli->protocol,
+ cli_state_protocol(rootcli),
0,
0x20,
targetcli);
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 2e45044e14..f9bb781980 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -73,7 +73,7 @@ void cli_setup_packet_buf(struct cli_state *cli, char *buf)
SSVAL(buf,smb_uid, cli_state_get_uid(cli));
SSVAL(buf,smb_mid,cli->smb1.mid);
- if (cli->protocol <= PROTOCOL_CORE) {
+ if (cli_state_protocol(cli) <= PROTOCOL_CORE) {
return;
}
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index e9a3355b69..ba3dd2b2b5 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -875,7 +875,7 @@ struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx,
return NULL;
}
- if (cli->protocol <= PROTOCOL_LANMAN1) {
+ if (cli_state_protocol(cli) <= PROTOCOL_LANMAN1) {
subreq = cli_list_old_send(state, ev, cli, mask, attribute);
state->recv_fn = cli_list_old_recv;
} else {