diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-08-01 16:42:23 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-08-02 04:54:28 +0200 |
commit | 6e8a6e033f4040630995f0c2f1889fbc251cb7dc (patch) | |
tree | 37bc178da1ac67a69b2729faf3dc1570de73e883 | |
parent | ffd99c5de56b7e9f97a56b91983c966e88749090 (diff) | |
download | samba-6e8a6e033f4040630995f0c2f1889fbc251cb7dc.tar.gz samba-6e8a6e033f4040630995f0c2f1889fbc251cb7dc.tar.bz2 samba-6e8a6e033f4040630995f0c2f1889fbc251cb7dc.zip |
s3:libsmb/cli*: make use of cli_state_capabilities()
metze
-rw-r--r-- | source3/libsmb/cliconnect.c | 8 | ||||
-rw-r--r-- | source3/libsmb/clidfs.c | 6 | ||||
-rw-r--r-- | source3/libsmb/clientgen.c | 8 | ||||
-rw-r--r-- | source3/libsmb/clifile.c | 4 | ||||
-rw-r--r-- | source3/libsmb/clilist.c | 2 | ||||
-rw-r--r-- | source3/libsmb/clireadwrite.c | 8 |
6 files changed, 18 insertions, 18 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 4f703b3579..1547a241be 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -379,7 +379,7 @@ static uint32 cli_session_setup_capabilities(struct cli_state *cli) if (cli->use_level_II_oplocks) capabilities |= CAP_LEVEL_II_OPLOCKS; - capabilities |= (cli->capabilities & (CAP_UNICODE|CAP_LARGE_FILES|CAP_LARGE_READX|CAP_LARGE_WRITEX|CAP_DFS)); + capabilities |= (cli_state_capabilities(cli) & (CAP_UNICODE|CAP_LARGE_FILES|CAP_LARGE_READX|CAP_LARGE_WRITEX|CAP_DFS)); return capabilities; } @@ -2050,7 +2050,7 @@ NTSTATUS cli_session_setup(struct cli_state *cli, /* if the server supports extended security then use SPNEGO */ - if (cli->capabilities & CAP_EXTENDED_SECURITY) { + if (cli_state_capabilities(cli) & CAP_EXTENDED_SECURITY) { ADS_STATUS status = cli_session_setup_spnego(cli, user, pass, workgroup, NULL); if (!ADS_ERR_OK(status)) { @@ -2648,12 +2648,12 @@ static void cli_negprot_done(struct tevent_req *subreq) cli->servertime = ts.tv_sec; cli->secblob = data_blob(bytes, num_bytes); cli->capabilities = IVAL(vwv + 9, 1); - if (cli->capabilities & CAP_RAW_MODE) { + if (cli_state_capabilities(cli) & CAP_RAW_MODE) { cli->readbraw_supported = True; cli->writebraw_supported = True; } /* work out if they sent us a workgroup */ - if (!(cli->capabilities & CAP_EXTENDED_SECURITY) && + if (!(cli_state_capabilities(cli) & CAP_EXTENDED_SECURITY) && smb_buflen(inbuf) > 8) { ssize_t ret; status = smb_bytes_talloc_string( diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index d729649286..514ff80695 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -201,7 +201,7 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx, here before trying to connect to the original share. cli_check_msdfs_proxy() will fail if it is a normal share. */ - if ((c->capabilities & CAP_DFS) && + if ((cli_state_capabilities(c) & CAP_DFS) && cli_check_msdfs_proxy(ctx, c, sharename, &newserver, &newshare, force_encrypt, @@ -589,10 +589,10 @@ static bool cli_dfs_check_error(struct cli_state *cli, NTSTATUS expected, { /* only deal with DS when we negotiated NT_STATUS codes and UNICODE */ - if (!(cli->capabilities & CAP_UNICODE)) { + if (!(cli_state_capabilities(cli) & CAP_UNICODE)) { return false; } - if (!(cli->capabilities & CAP_STATUS32)) { + if (!(cli_state_capabilities(cli) & CAP_STATUS32)) { return false; } if (NT_STATUS_EQUAL(status, expected)) { diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 854d9a3c32..0135157500 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -56,7 +56,7 @@ unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout) bool cli_ucs2(struct cli_state *cli) { - return ((cli->capabilities & CAP_UNICODE) != 0); + return ((cli_state_capabilities(cli) & CAP_UNICODE) != 0); } /**************************************************************************** @@ -84,11 +84,11 @@ void cli_setup_packet_buf(struct cli_state *cli, char *buf) SCVAL(buf,smb_flg,0x8); } flags2 = FLAGS2_LONG_PATH_COMPONENTS; - if (cli->capabilities & CAP_UNICODE) + if (cli_state_capabilities(cli) & CAP_UNICODE) flags2 |= FLAGS2_UNICODE_STRINGS; - if ((cli->capabilities & CAP_DFS) && cli->dfsroot) + if ((cli_state_capabilities(cli) & CAP_DFS) && cli->dfsroot) flags2 |= FLAGS2_DFS_PATHNAMES; - if (cli->capabilities & CAP_STATUS32) + if (cli_state_capabilities(cli) & CAP_STATUS32) flags2 |= FLAGS2_32_BIT_ERROR_CODES; if (cli->use_spnego) flags2 |= FLAGS2_EXTENDED_SECURITY; diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 59cdb7b855..812fcde85e 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -2765,7 +2765,7 @@ NTSTATUS cli_lock64(struct cli_state *cli, uint16_t fnum, int ltype; NTSTATUS status; - if (! (cli->capabilities & CAP_LARGE_FILES)) { + if (! (cli_state_capabilities(cli) & CAP_LARGE_FILES)) { return cli_lock32(cli, fnum, offset, len, timeout, lock_type); } @@ -2878,7 +2878,7 @@ NTSTATUS cli_unlock64(struct cli_state *cli, struct tevent_req *req; NTSTATUS status = NT_STATUS_OK; - if (! (cli->capabilities & CAP_LARGE_FILES)) { + if (! (cli_state_capabilities(cli) & CAP_LARGE_FILES)) { return cli_unlock(cli, fnum, offset, len); } diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index 55a6636a73..e9a3355b69 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -946,7 +946,7 @@ NTSTATUS cli_list(struct cli_state *cli, const char *mask, uint16 attribute, goto fail; } - info_level = (cli->capabilities & CAP_NT_SMBS) + info_level = (cli_state_capabilities(cli) & CAP_NT_SMBS) ? SMB_FIND_FILE_BOTH_DIRECTORY_INFO : SMB_FIND_INFO_STANDARD; req = cli_list_send(frame, ev, cli, mask, attribute, info_level); diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c index 413668d108..2fe41b4763 100644 --- a/source3/libsmb/clireadwrite.c +++ b/source3/libsmb/clireadwrite.c @@ -37,7 +37,7 @@ static size_t cli_read_max_bufsize(struct cli_state *cli) && (cli->server_posix_capabilities & CIFS_UNIX_LARGE_READ_CAP)) { return CLI_SAMBA_MAX_POSIX_LARGE_READX_SIZE; } - if (cli->capabilities & CAP_LARGE_READX) { + if (cli_state_capabilities(cli) & CAP_LARGE_READX) { return cli->is_samba ? CLI_SAMBA_MAX_LARGE_READX_SIZE : CLI_WINDOWS_MAX_LARGE_READX_SIZE; @@ -62,7 +62,7 @@ static size_t cli_write_max_bufsize(struct cli_state *cli, !client_is_signing_on(cli) && !cli_encryption_on(cli) && (cli->server_posix_capabilities & CIFS_UNIX_LARGE_WRITE_CAP) && - (cli->capabilities & CAP_LARGE_FILES)) { + (cli_state_capabilities(cli) & CAP_LARGE_FILES)) { /* Only do massive writes if we can do them direct * with no signing or encrypting - not on a pipe. */ return CLI_SAMBA_MAX_POSIX_LARGE_WRITEX_SIZE; @@ -72,7 +72,7 @@ static size_t cli_write_max_bufsize(struct cli_state *cli, return CLI_SAMBA_MAX_LARGE_WRITEX_SIZE; } - if (((cli->capabilities & CAP_LARGE_WRITEX) == 0) + if (((cli_state_capabilities(cli) & CAP_LARGE_WRITEX) == 0) || client_is_signing_on(cli) || strequal(cli->dev, "LPT1:")) { size_t data_offset = smb_size - 4; @@ -803,7 +803,7 @@ struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx, { struct tevent_req *req, *subreq; struct cli_write_andx_state *state; - bool bigoffset = ((cli->capabilities & CAP_LARGE_FILES) != 0); + bool bigoffset = ((cli_state_capabilities(cli) & CAP_LARGE_FILES) != 0); uint8_t wct = bigoffset ? 14 : 12; size_t max_write = cli_write_max_bufsize(cli, mode, wct); uint16_t *vwv; |