s3/libsmb: reuse smbXcli_conn_have_posix()
authorRalph Boehme <slow@samba.org>
Fri, 13 Oct 2023 08:26:46 +0000 (10:26 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 26 Oct 2023 15:29:29 +0000 (15:29 +0000)
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>
source3/client/client.c
source3/include/client.h
source3/libsmb/clidfs.c

index ad9d157db18d3d036ec7b10e4c5837e0ea10fa11..267e3ebeb993824afdd7ec5decd4b34647c47a4e 100644 (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;
        }
index 3644e40ca501d319259c44b1249bf8f2b3a4af69..9634166428cc18ad75ad7581bfb703a1dbd7c29b 100644 (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;
 };
index 7bc733492ceaf744b7389e401d3d298c31e94ffc..939b3b0da091054927ab82a9c1e35c5e9b062b74 100644 (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