summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-08 16:14:51 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-15 08:33:13 +0200
commit1d8bdab1c4465bcf265813827029aaca20b5bd9c (patch)
tree9a0c5637a4a33823357675c947e75632b3338ec7 /source3
parenta8836cae917ddd03f9e8d0934bb0cf329643e60a (diff)
downloadsamba-1d8bdab1c4465bcf265813827029aaca20b5bd9c.tar.gz
samba-1d8bdab1c4465bcf265813827029aaca20b5bd9c.tar.bz2
samba-1d8bdab1c4465bcf265813827029aaca20b5bd9c.zip
s3:libsmb: calculate the negotiated SMB1 capabilities in cli_negprot_done()
We calculate the negotiated capabilities based on the mask for: - client only flags - flags used in both directions - server only flags metze
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/cliconnect.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index f162e7e305..e15d099086 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2592,6 +2592,7 @@ static void cli_negprot_done(struct tevent_req *subreq)
NTSTATUS status;
uint16_t protnum;
uint8_t *inbuf;
+ uint32_t both_capabilities;
uint32_t server_capabilities = 0;
status = cli_smb_recv(subreq, state, &inbuf, 1, &wct, &vwv,
@@ -2729,12 +2730,17 @@ 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;
- }
+ /*
+ * Now calculate the negotiated capabilities
+ * based on the mask for:
+ * - client only flags
+ * - flags used in both directions
+ * - server only flags
+ */
+ both_capabilities = cli->capabilities & server_capabilities;
+ cli->capabilities = cli->capabilities & SMB_CAP_CLIENT_MASK;
+ cli->capabilities |= both_capabilities & SMB_CAP_BOTH_MASK;
+ cli->capabilities |= server_capabilities & SMB_CAP_SERVER_MASK;
tevent_req_done(req);
}