1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3:libsmb/cli*: make use of cli_state_capabilities()

metze
This commit is contained in:
Stefan Metzmacher 2011-08-01 16:42:23 +02:00
parent ffd99c5de5
commit 6e8a6e033f
6 changed files with 18 additions and 18 deletions

View File

@ -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(

View File

@ -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)) {

View File

@ -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;

View File

@ -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);
}

View File

@ -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);

View File

@ -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;