]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:libsmb: Add try_posixinfo to SMBSRV struct. Only enable for SMB1 with UNIX for...
authorAndreas Schneider <asn@samba.org>
Mon, 25 Nov 2019 10:06:57 +0000 (11:06 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 14 Jan 2020 08:30:24 +0000 (08:30 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14101

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit bf9a3a7aa1913238ae2c997ce00369d0dbae3a08)

source3/include/libsmb_internal.h
source3/libsmb/libsmb_server.c

index c1bcab18138289e6fad356f9cefb87c3f172675f..5627b0c867eb63688faac206e49397ad8b8f4c57 100644 (file)
@@ -76,6 +76,7 @@ typedef struct DOS_ATTR_DESC {
 struct _SMBCSRV {
        struct cli_state *cli;
        dev_t dev;
+       bool try_posixinfo;
        bool no_pathinfo;
        bool no_pathinfo2;
        bool no_pathinfo3;
index 0067df48cac7bffd866e94d14787eafd47ef68b5..d4f71d8c8b70fe88655e33d37ca7845934175d28 100644 (file)
@@ -657,6 +657,15 @@ SMBC_server_internal(TALLOC_CTX *ctx,
        ZERO_STRUCTP(srv);
        DLIST_ADD(srv->cli, c);
        srv->dev = (dev_t)(str_checksum(server) ^ str_checksum(share));
+       srv->try_posixinfo = false;
+       /*
+        * Until SMB2 POSIX is done, only
+        * try POSIX stat on SMB1 with POSIX capabilities.
+        */
+       if ((smbXcli_conn_protocol(c->conn) < PROTOCOL_SMB2_02) &&
+           (smb1cli_conn_capabilities(c->conn) & CAP_UNIX)) {
+               srv->try_posixinfo = true;
+       }
         srv->no_pathinfo = False;
         srv->no_pathinfo2 = False;
        srv->no_pathinfo3 = False;