diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-09-13 15:00:59 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-09-15 12:12:23 +0200 |
commit | 595f0020d4bc6c43adf4e73021e5fffab3354bfd (patch) | |
tree | 4037a0f236d63fd649ba9650ebc144c75bb842c9 | |
parent | 74a581afe55d54090d46aa60b6377b930f11a76f (diff) | |
download | samba-595f0020d4bc6c43adf4e73021e5fffab3354bfd.tar.gz samba-595f0020d4bc6c43adf4e73021e5fffab3354bfd.tar.bz2 samba-595f0020d4bc6c43adf4e73021e5fffab3354bfd.zip |
s3:libsmb: move cli->capabilities to cli->conn.smb1.capabilities
And keep cli->conn.smb1.client.capabilities and
cli->conn.smb1.server_capabilities.
metze
-rw-r--r-- | source3/include/client.h | 13 | ||||
-rw-r--r-- | source3/libsmb/cliconnect.c | 13 | ||||
-rw-r--r-- | source3/libsmb/clientgen.c | 26 |
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) |