DLIST_ADD_END(referring_cli, cli, struct cli_state *);
}
- if (referring_cli && referring_cli->posix_capabilities) {
+ if (referring_cli && referring_cli->requested_posix_capabilities) {
uint16 major, minor;
uint32 caplow, caphigh;
NTSTATUS status;
dir++;
}
- if (cli->posix_capabilities & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
+ if (cli->requested_posix_capabilities & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
path_sep = '/';
}
return talloc_asprintf(ctx, "%c%s%c%s%c%s",
****************************************************************************/
struct cli_unix_extensions_version_state {
+ struct cli_state *cli;
uint16_t setup[1];
uint8_t param[2];
uint16_t major, minor;
if (req == NULL) {
return NULL;
}
+ state->cli = cli;
SSVAL(state->setup, 0, TRANSACT2_QFSINFO);
SSVAL(state->param, 0, SMB_QUERY_CIFS_UNIX_INFO);
*pminor = state->minor;
*pcaplow = state->caplow;
*pcaphigh = state->caphigh;
+ state->cli->server_posix_capabilities = *pcaplow;
return NT_STATUS_OK;
}
status = cli_unix_extensions_version_recv(req, pmajor, pminor, pcaplow,
pcaphigh);
- if (NT_STATUS_IS_OK(status)) {
- cli->posix_capabilities = *pcaplow;
- }
fail:
TALLOC_FREE(frame);
if (!NT_STATUS_IS_OK(status)) {
****************************************************************************/
struct cli_set_unix_extensions_capabilities_state {
+ struct cli_state *cli;
uint16_t setup[1];
uint8_t param[4];
uint8_t data[12];
return NULL;
}
+ state->cli = cli;
SSVAL(state->setup+0, 0, TRANSACT2_SETFSINFO);
SSVAL(state->param, 0, 0);
static void cli_set_unix_extensions_capabilities_done(
struct tevent_req *subreq)
{
+ struct tevent_req *req = tevent_req_callback_data(
+ subreq, struct tevent_req);
+ struct cli_set_unix_extensions_capabilities_state *state = tevent_req_data(
+ req, struct cli_set_unix_extensions_capabilities_state);
+
NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, 0, NULL,
NULL, 0, NULL, NULL, 0, NULL);
+ if (NT_STATUS_IS_OK(status)) {
+ state->cli->requested_posix_capabilities = IVAL(state->data, 4);
+ }
tevent_req_simple_finish_ntstatus(subreq, status);
}
TALLOC_FREE(ev);
if (!NT_STATUS_IS_OK(status)) {
cli_set_error(cli, status);
+ } else {
+ cli->requested_posix_capabilities = caplow;
}
return status;
}
static size_t cli_read_max_bufsize(struct cli_state *cli)
{
if (!client_is_signing_on(cli) && !cli_encryption_on(cli)
- && (cli->posix_capabilities & CIFS_UNIX_LARGE_READ_CAP)) {
+ && (cli->server_posix_capabilities & CIFS_UNIX_LARGE_READ_CAP)) {
return CLI_SAMBA_MAX_POSIX_LARGE_READX_SIZE;
}
if (cli->capabilities & CAP_LARGE_READX) {
if (write_mode == 0 &&
!client_is_signing_on(cli) &&
!cli_encryption_on(cli) &&
- (cli->posix_capabilities & CIFS_UNIX_LARGE_WRITE_CAP) &&
+ (cli->server_posix_capabilities & CIFS_UNIX_LARGE_WRITE_CAP) &&
(cli->capabilities & CAP_LARGE_FILES)) {
/* Only do massive writes if we can do them direct
* with no signing or encrypting - not on a pipe. */