libsmb: Don't try to find posix stat info in SMBC_getatr()
authorVolker Lendecke <vl@samba.org>
Thu, 19 Mar 2020 10:01:41 +0000 (11:01 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 20 Mar 2020 05:06:07 +0000 (05:06 +0000)
This wrongly used "frame" instead of "fname", which can never have
worked. A first attempt to fix in 51551e0d53fa6 caused a few followup
patches in an attempt to clean up the test failures 51551e0d53fa6
introduced. They were reverted after a few discussions. So rather than
changing behaviour, just remove the code that introduced the valgrind
error again.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 20 05:06:07 UTC 2020 on sn-devel-184

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

index 21a11c1a0242cc54762c85f0e76f944140fd6772..feedddd08776e12c7cb5b25767e5ab99fed08df8 100644 (file)
@@ -76,7 +76,6 @@ 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 1577010e49018ee290f55eb0cacd92e14472f55b..f0a16c61a83a987c7b7bcaa9a419f874e50d4448 100644 (file)
@@ -504,26 +504,6 @@ SMBC_getatr(SMBCCTX * context,
                return False;
        }
 
-       if (srv->try_posixinfo) {
-               SMB_STRUCT_STAT sbuf;
-
-               status = cli_posix_stat(targetcli, frame, &sbuf);
-               if (NT_STATUS_IS_OK(status)) {
-                       setup_stat_from_stat_ex(&sbuf, path, sb);
-
-                       TALLOC_FREE(frame);
-                       return true;
-               }
-               if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED) ||
-                   NT_STATUS_EQUAL(status, NT_STATUS_INVALID_LEVEL)) {
-                       /*
-                        * Turn this off if the server doesn't
-                        * support it.
-                        */
-                       srv->try_posixinfo = false;
-               }
-       }
-
        if (!srv->no_pathinfo2) {
                status = cli_qpathinfo2(targetcli,
                                        targetpath,
index d4f71d8c8b70fe88655e33d37ca7845934175d28..0067df48cac7bffd866e94d14787eafd47ef68b5 100644 (file)
@@ -657,15 +657,6 @@ 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;