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

s3/libsmb: reuse smbXcli_conn_have_posix()

We already store the negotiated POSIX state in smbXcli_connection
and there we only store it if the server actually supports the
version we requested.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Ralph Boehme 2023-10-13 10:26:46 +02:00 committed by Volker Lendecke
parent 45643c703b
commit 788dafccd1
3 changed files with 1 additions and 8 deletions

View File

@ -3164,7 +3164,7 @@ static int cmd_posix(void)
char *caps;
NTSTATUS status;
if (!(SERVER_HAS_UNIX_CIFS(cli) || cli->smb2.server_smb311_posix)) {
if (!smbXcli_conn_have_posix(cli->conn)) {
d_printf("Server doesn't support UNIX CIFS extensions.\n");
return 1;
}

View File

@ -91,7 +91,6 @@ struct cli_state {
struct smbXcli_session *session;
struct smbXcli_tcon *tcon;
struct idr_context *open_handles;
bool server_smb311_posix;
bool client_smb311_posix;
} smb2;
};

View File

@ -245,12 +245,6 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
smb2cli_conn_set_max_credits(c->conn, DEFAULT_SMB2_MAX_CREDITS);
}
if ((protocol >= PROTOCOL_SMB3_11) && (out_contexts != NULL)) {
c->smb2.server_smb311_posix = smb2_negotiate_context_find(
out_contexts,
SMB2_POSIX_EXTENSIONS_AVAILABLE);
}
status = cli_session_setup_creds(c, creds);
if (!NT_STATUS_IS_OK(status)) {
/* If a password was not supplied then