summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-08 15:41:29 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-15 08:33:11 +0200
commitd87ef021abaff8b1d13ec1038264251d66d9a9a6 (patch)
treea03f698e6d73d090980baac1a0f07033e7f21c83 /source3
parent7982819f617497e6b8cbc45251e9fa4bac96c46b (diff)
downloadsamba-d87ef021abaff8b1d13ec1038264251d66d9a9a6.tar.gz
samba-d87ef021abaff8b1d13ec1038264251d66d9a9a6.tar.bz2
samba-d87ef021abaff8b1d13ec1038264251d66d9a9a6.zip
s3:libsmb: make sure we always set cli->capabilities at the end of cli_negprot_done()
If the server doesn't support PROTOCOL_NT1 we should reset the negotiated capabilities to 0. metze
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/cliconnect.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index d4391553e9..1f222f88fd 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2602,6 +2602,7 @@ static void cli_negprot_done(struct tevent_req *subreq)
NTSTATUS status;
uint16_t protnum;
uint8_t *inbuf;
+ uint32_t server_capabilities = 0;
status = cli_smb_recv(subreq, state, &inbuf, 1, &wct, &vwv,
&num_bytes, &bytes);
@@ -2652,13 +2653,13 @@ static void cli_negprot_done(struct tevent_req *subreq)
ts = interpret_long_date(((char *)(vwv+11))+1);
cli->servertime = ts.tv_sec;
cli->secblob = data_blob(bytes, num_bytes);
- cli->capabilities = IVAL(vwv + 9, 1);
- if (cli_state_capabilities(cli) & CAP_RAW_MODE) {
+ server_capabilities = IVAL(vwv + 9, 1);
+ if (server_capabilities & CAP_RAW_MODE) {
cli->readbraw_supported = True;
cli->writebraw_supported = True;
}
/* work out if they sent us a workgroup */
- if (!(cli_state_capabilities(cli) & CAP_EXTENDED_SECURITY) &&
+ if (!(server_capabilities & CAP_EXTENDED_SECURITY) &&
smb_buflen(inbuf) > 8) {
ssize_t ret;
status = smb_bytes_talloc_string(
@@ -2738,6 +2739,8 @@ static void cli_negprot_done(struct tevent_req *subreq)
cli->max_xmit = MIN(cli->max_xmit, CLI_BUFFER_SIZE);
+ cli->capabilities = server_capabilities;
+
/* a way to force ascii SMB */
if (cli->force_ascii) {
cli->capabilities &= ~CAP_UNICODE;