summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-08-09 11:15:48 -0700
committerStefan Metzmacher <metze@samba.org>2013-08-15 09:07:05 +0200
commit14421323d1dd3744cb8553f0e6a5a7436554bf2d (patch)
tree2fcc3c62abd24413375970c0d857ab9dba3dc0a2
parent42f510c155b98f3df5106aebd1de54d1749b9b1c (diff)
downloadsamba-14421323d1dd3744cb8553f0e6a5a7436554bf2d.tar.gz
samba-14421323d1dd3744cb8553f0e6a5a7436554bf2d.tar.bz2
samba-14421323d1dd3744cb8553f0e6a5a7436554bf2d.zip
s3:libsmb: Ensure we ask for DEFAULT_SMB2_MAX_CREDITS on successful negprot.
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/libsmb/cliconnect.c10
-rw-r--r--source3/libsmb/clidfs.c5
2 files changed, 15 insertions, 0 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 14cdf968b8..f963edf678 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -3130,6 +3130,8 @@ static void cli_start_connection_done(struct tevent_req *subreq)
{
struct tevent_req *req = tevent_req_callback_data(
subreq, struct tevent_req);
+ struct cli_start_connection_state *state = tevent_req_data(
+ req, struct cli_start_connection_state);
NTSTATUS status;
status = smbXcli_negprot_recv(subreq);
@@ -3137,6 +3139,13 @@ static void cli_start_connection_done(struct tevent_req *subreq)
if (tevent_req_nterror(req, status)) {
return;
}
+
+ if (smbXcli_conn_protocol(state->cli->conn) >= PROTOCOL_SMB2_02) {
+ /* Ensure we ask for some initial credits. */
+ smb2cli_conn_set_max_credits(state->cli->conn,
+ DEFAULT_SMB2_MAX_CREDITS);
+ }
+
tevent_req_done(req);
}
@@ -3151,6 +3160,7 @@ static NTSTATUS cli_start_connection_recv(struct tevent_req *req,
return status;
}
*output_cli = state->cli;
+
return NT_STATUS_OK;
}
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 95f8817a94..1ed6ac5fc1 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -160,6 +160,11 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
return status;
}
+ if (smbXcli_conn_protocol(c->conn) >= PROTOCOL_SMB2_02) {
+ /* Ensure we ask for some initial credits. */
+ smb2cli_conn_set_max_credits(c->conn, DEFAULT_SMB2_MAX_CREDITS);
+ }
+
username = get_cmdline_auth_info_username(auth_info);
password = get_cmdline_auth_info_password(auth_info);