From 788dafccd15b72a076413423764a2a1703ef6249 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 13 Oct 2023 10:26:46 +0200 Subject: [PATCH] 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 Reviewed-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- source3/client/client.c | 2 +- source3/include/client.h | 1 - source3/libsmb/clidfs.c | 6 ------ 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/source3/client/client.c b/source3/client/client.c index ad9d157db18..267e3ebeb99 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -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; } diff --git a/source3/include/client.h b/source3/include/client.h index 3644e40ca50..9634166428c 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -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; }; diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index 7bc733492ce..939b3b0da09 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -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 -- 2.47.3