1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3:libsmb: get rid of cli_state_capabilities

Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Luk Claes 2012-05-19 18:23:40 +02:00 committed by Stefan Metzmacher
parent d8c0646a5d
commit 3c9c06ac05
15 changed files with 24 additions and 30 deletions

View File

@ -171,7 +171,7 @@ copy an IP address from one buffer to another
Return True if a server has CIFS UNIX capabilities.
********************************************************************/
#define SERVER_HAS_UNIX_CIFS(c) (cli_state_capabilities(c) & CAP_UNIX)
#define SERVER_HAS_UNIX_CIFS(c) (smb1cli_conn_capabilities(c->conn) & CAP_UNIX)
/****************************************************************************
Make a filename into unix format.

View File

@ -107,7 +107,7 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx,
additional_flags |= FLAG_CASELESS_PATHNAMES;
}
if ((cli_state_capabilities(cli) & CAP_DFS) && cli->dfsroot) {
if ((smb1cli_conn_capabilities(cli->conn) & CAP_DFS) && cli->dfsroot) {
additional_flags2 |= FLAGS2_DFS_PATHNAMES;
}
@ -170,7 +170,7 @@ struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx,
additional_flags |= FLAG_CASELESS_PATHNAMES;
}
if ((cli_state_capabilities(cli) & CAP_DFS) && cli->dfsroot) {
if ((smb1cli_conn_capabilities(cli->conn) & CAP_DFS) && cli->dfsroot) {
additional_flags2 |= FLAGS2_DFS_PATHNAMES;
}

View File

@ -346,7 +346,7 @@ static NTSTATUS cli_session_setup_lanman2(struct cli_state *cli, const char *use
static uint32_t cli_session_setup_capabilities(struct cli_state *cli,
uint32_t sesssetup_capabilities)
{
uint32_t client_capabilities = cli_state_capabilities(cli);
uint32_t client_capabilities = smb1cli_conn_capabilities(cli->conn);
/*
* We only send capabilities based on the mask for:
@ -2108,7 +2108,7 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
/* if the server supports extended security then use SPNEGO */
if (cli_state_capabilities(cli) & CAP_EXTENDED_SECURITY) {
if (smb1cli_conn_capabilities(cli->conn) & CAP_EXTENDED_SECURITY) {
const char *remote_realm = cli_state_remote_realm(cli);
ADS_STATUS status = cli_session_setup_spnego(cli, user, pass,
workgroup,

View File

@ -208,7 +208,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 ((cli_state_capabilities(c) & CAP_DFS) &&
if ((smb1cli_conn_capabilities(c->conn) & CAP_DFS) &&
cli_check_msdfs_proxy(ctx, c, sharename,
&newserver, &newshare,
force_encrypt,
@ -596,10 +596,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_state_capabilities(cli) & CAP_UNICODE)) {
if (!(smb1cli_conn_capabilities(cli->conn) & CAP_UNICODE)) {
return false;
}
if (!(cli_state_capabilities(cli) & CAP_STATUS32)) {
if (!(smb1cli_conn_capabilities(cli->conn) & CAP_STATUS32)) {
return false;
}
if (NT_STATUS_EQUAL(status, expected)) {

View File

@ -435,11 +435,6 @@ bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive)
return ret;
}
uint32_t cli_state_capabilities(struct cli_state *cli)
{
return smb1cli_conn_capabilities(cli->conn);
}
uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs)
{
uint32_t ret = smb1cli_conn_max_xmit(cli->conn);

View File

@ -2839,7 +2839,7 @@ NTSTATUS cli_lock64(struct cli_state *cli, uint16_t fnum,
int ltype;
NTSTATUS status;
if (! (cli_state_capabilities(cli) & CAP_LARGE_FILES)) {
if (! (smb1cli_conn_capabilities(cli->conn) & CAP_LARGE_FILES)) {
return cli_lock32(cli, fnum, offset, len, timeout, lock_type);
}
@ -2956,7 +2956,7 @@ NTSTATUS cli_unlock64(struct cli_state *cli,
struct tevent_req *req;
NTSTATUS status = NT_STATUS_OK;
if (! (cli_state_capabilities(cli) & CAP_LARGE_FILES)) {
if (! (smb1cli_conn_capabilities(cli->conn) & CAP_LARGE_FILES)) {
return cli_unlock(cli, fnum, offset, len);
}

View File

@ -950,7 +950,7 @@ NTSTATUS cli_list(struct cli_state *cli, const char *mask, uint16 attribute,
goto fail;
}
info_level = (cli_state_capabilities(cli) & CAP_NT_SMBS)
info_level = (smb1cli_conn_capabilities(cli->conn) & 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

@ -52,7 +52,7 @@ static size_t cli_read_max_bufsize(struct cli_state *cli)
}
return useable_space;
} else if (cli_state_capabilities(cli) & CAP_LARGE_READX) {
} else if (smb1cli_conn_capabilities(cli->conn) & CAP_LARGE_READX) {
/*
* Note: CAP_LARGE_READX also works with signing
*/
@ -86,7 +86,7 @@ static size_t cli_write_max_bufsize(struct cli_state *cli,
if (cli->server_posix_capabilities & CIFS_UNIX_LARGE_WRITE_CAP) {
useable_space = 0xFFFFFF - data_offset;
} else if (cli_state_capabilities(cli) & CAP_LARGE_WRITEX) {
} else if (smb1cli_conn_capabilities(cli->conn) & CAP_LARGE_WRITEX) {
useable_space = 0x1FFFF - data_offset;
} else {
return min_space;
@ -155,7 +155,7 @@ struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx,
SSVAL(state->vwv + 8, 0, 0);
SSVAL(state->vwv + 9, 0, 0);
if (cli_state_capabilities(cli) & CAP_LARGE_FILES) {
if (smb1cli_conn_capabilities(cli->conn) & CAP_LARGE_FILES) {
SIVAL(state->vwv + 10, 0,
(((uint64_t)offset)>>32) & 0xffffffff);
wct = 12;
@ -840,7 +840,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_state_capabilities(cli) & CAP_LARGE_FILES) != 0);
bool bigoffset = ((smb1cli_conn_capabilities(cli->conn) & CAP_LARGE_FILES) != 0);
uint8_t wct = bigoffset ? 14 : 12;
size_t max_write = cli_write_max_bufsize(cli, mode, wct);
uint16_t *vwv;

View File

@ -80,7 +80,7 @@ struct tevent_req *cli_trans_send(
additional_flags |= FLAG_CASELESS_PATHNAMES;
}
if ((cli_state_capabilities(cli) & CAP_DFS) && cli->dfsroot) {
if ((smb1cli_conn_capabilities(cli->conn) & CAP_DFS) && cli->dfsroot) {
additional_flags2 |= FLAGS2_DFS_PATHNAMES;
}
@ -174,7 +174,7 @@ NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
additional_flags |= FLAG_CASELESS_PATHNAMES;
}
if ((cli_state_capabilities(cli) & CAP_DFS) && cli->dfsroot) {
if ((smb1cli_conn_capabilities(cli->conn) & CAP_DFS) && cli->dfsroot) {
additional_flags2 |= FLAGS2_DFS_PATHNAMES;
}

View File

@ -26,7 +26,7 @@
#include "libsmb/libsmb.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
#include "../libcli/smb/smbXcli_base.h"
/*
* Routine to open() a file ...
@ -551,7 +551,7 @@ SMBC_getatr(SMBCCTX * context,
}
/* if this is NT then don't bother with the getatr */
if (cli_state_capabilities(targetcli) & CAP_NT_SMBS) {
if (smb1cli_conn_capabilities(targetcli->conn) & CAP_NT_SMBS) {
errno = EPERM;
TALLOC_FREE(frame);
return False;

View File

@ -489,7 +489,7 @@ SMBC_server_internal(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 ((cli_state_capabilities(c) & CAP_DFS) &&
if ((smb1cli_conn_capabilities(c->conn) & CAP_DFS) &&
cli_check_msdfs_proxy(ctx, c, share,
&newserver, &newshare,
/* FIXME: cli_check_msdfs_proxy() does

View File

@ -26,7 +26,7 @@
#include "libsmb/libsmb.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
#include "../libcli/smb/smbXcli_base.h"
/*
* Generate an inode number from file name for those things that need it
@ -465,7 +465,7 @@ SMBC_fstatvfs_ctx(SMBCCTX *context,
}
/* See if DFS is supported */
if ((cli_state_capabilities(cli) & CAP_DFS) && cli->dfsroot) {
if ((smb1cli_conn_capabilities(cli->conn) & CAP_DFS) && cli->dfsroot) {
flags |= SMBC_VFS_FEATURE_DFS;
}

View File

@ -182,7 +182,6 @@ uint16_t cli_state_set_tid(struct cli_state *cli, uint16_t tid);
uint16_t cli_state_get_uid(struct cli_state *cli);
uint16_t cli_state_set_uid(struct cli_state *cli, uint16_t uid);
bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
uint32_t cli_state_capabilities(struct cli_state *cli);
uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs);
uint16_t cli_state_max_requests(struct cli_state *cli);
const uint8_t *cli_state_server_challenge(struct cli_state *cli);

View File

@ -4521,7 +4521,7 @@ static bool run_properties(int dummy)
smbXcli_conn_set_sockopt(cli->conn, sockops);
d_printf("Capabilities 0x%08x\n", cli_state_capabilities(cli));
d_printf("Capabilities 0x%08x\n", smb1cli_conn_capabilities(cli->conn));
if (!torture_close_connection(cli)) {
correct = False;

View File

@ -835,7 +835,7 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain,
}
if (smbXcli_conn_protocol((*cli)->conn) >= PROTOCOL_NT1 &&
cli_state_capabilities(*cli) & CAP_EXTENDED_SECURITY) {
smb1cli_conn_capabilities((*cli)->conn) & CAP_EXTENDED_SECURITY) {
try_spnego = true;
} else if (smbXcli_conn_protocol((*cli)->conn) >= PROTOCOL_SMB2_02) {
try_spnego = true;