summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/client.h13
-rw-r--r--source3/libsmb/cliconnect.c13
-rw-r--r--source3/libsmb/clientgen.c26
3 files changed, 35 insertions, 17 deletions
diff --git a/source3/include/client.h b/source3/include/client.h
index 21ad457cb5..43b1541925 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -75,7 +75,6 @@ struct cli_state {
int initialised;
int win95;
bool is_guestlogin;
- uint32 capabilities;
/* What the server offered. */
uint32_t server_posix_capabilities;
/* What the client requested. */
@@ -127,6 +126,18 @@ struct cli_state {
uint8_t *inbuf);
enum protocol_types protocol;
+
+ struct {
+ struct {
+ uint32_t capabilities;
+ } client;
+
+ struct {
+ uint32_t capabilities;
+ } server;
+
+ uint32_t capabilities;
+ } smb1;
} conn;
struct {
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index e2e7ffd449..6e34c3d622 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2607,8 +2607,10 @@ static void cli_negprot_done(struct tevent_req *subreq)
NTSTATUS status;
uint16_t protnum;
uint8_t *inbuf;
+ uint32_t client_capabilities = cli->conn.smb1.client.capabilities;
uint32_t both_capabilities;
uint32_t server_capabilities = 0;
+ uint32_t capabilities;
enum protocol_types protocol;
status = cli_smb_recv(subreq, state, &inbuf, 1, &wct, &vwv,
@@ -2751,13 +2753,16 @@ static void cli_negprot_done(struct tevent_req *subreq)
* - 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;
+ both_capabilities = client_capabilities & server_capabilities;
+ capabilities = client_capabilities & SMB_CAP_CLIENT_MASK;
+ capabilities |= both_capabilities & SMB_CAP_BOTH_MASK;
+ capabilities |= server_capabilities & SMB_CAP_SERVER_MASK;
cli->conn.protocol = protocol;
+ cli->conn.smb1.server.capabilities = server_capabilities;
+ cli->conn.smb1.capabilities = capabilities;
+
tevent_req_done(req);
}
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index aaf18eb0ae..78211583d6 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -278,30 +278,32 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
goto error;
}
- cli->capabilities = 0;
- cli->capabilities |= CAP_LARGE_FILES;
- cli->capabilities |= CAP_NT_SMBS | CAP_RPC_REMOTE_APIS;
- cli->capabilities |= CAP_LOCK_AND_READ | CAP_NT_FIND;
- cli->capabilities |= CAP_DFS | CAP_W2K_SMBS;
- cli->capabilities |= CAP_LARGE_READX|CAP_LARGE_WRITEX;
- cli->capabilities |= CAP_LWIO;
+ cli->conn.smb1.client.capabilities = 0;
+ cli->conn.smb1.client.capabilities |= CAP_LARGE_FILES;
+ cli->conn.smb1.client.capabilities |= CAP_NT_SMBS | CAP_RPC_REMOTE_APIS;
+ cli->conn.smb1.client.capabilities |= CAP_LOCK_AND_READ | CAP_NT_FIND;
+ cli->conn.smb1.client.capabilities |= CAP_DFS | CAP_W2K_SMBS;
+ cli->conn.smb1.client.capabilities |= CAP_LARGE_READX|CAP_LARGE_WRITEX;
+ cli->conn.smb1.client.capabilities |= CAP_LWIO;
if (!force_dos_errors) {
- cli->capabilities |= CAP_STATUS32;
+ cli->conn.smb1.client.capabilities |= CAP_STATUS32;
}
if (!force_ascii) {
- cli->capabilities |= CAP_UNICODE;
+ cli->conn.smb1.client.capabilities |= CAP_UNICODE;
}
if (use_spnego) {
- cli->capabilities |= CAP_EXTENDED_SECURITY;
+ cli->conn.smb1.client.capabilities |= CAP_EXTENDED_SECURITY;
}
if (use_level_II_oplocks) {
- cli->capabilities |= CAP_LEVEL_II_OPLOCKS;
+ cli->conn.smb1.client.capabilities |= CAP_LEVEL_II_OPLOCKS;
}
+ cli->conn.smb1.capabilities = cli->conn.smb1.client.capabilities;
+
cli->conn.outgoing = tevent_queue_create(cli, "cli_outgoing");
if (cli->conn.outgoing == NULL) {
goto error;
@@ -540,7 +542,7 @@ enum protocol_types cli_state_protocol(struct cli_state *cli)
uint32_t cli_state_capabilities(struct cli_state *cli)
{
- return cli->capabilities;
+ return cli->conn.smb1.capabilities;
}
uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs)