]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libsmb: Ensure SMB1 cli_qpathinfo2() doesn't return an inode number.
authorJeremy Allison <jra@samba.org>
Thu, 17 Oct 2019 18:39:02 +0000 (11:39 -0700)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 18 Oct 2019 16:07:35 +0000 (16:07 +0000)
The info level it uses doesn't return that, previously we
were using the field that is returned as the EA size as
the inode number (which is usually zero, so the code in
libsmbclient would then synthesize an inode number from
a hash of the pathname, which is all it can do for SMB1).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14161

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libsmb/clirap.c

index d12d2b07604ed9a1340b8f78a651a5441d55181f..c0b9dcdff3957f10d1223de8f0bd27d3d9bc3d60 100644 (file)
@@ -878,7 +878,15 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req,
                 *size = IVAL2_TO_SMB_BIG_UINT(state->data,48);
        }
        if (ino) {
-               *ino = IVAL(state->data, 64);
+               /*
+                * SMB1 qpathinfo2 uses SMB_QUERY_FILE_ALL_INFO
+                * which doesn't return an inode number (fileid).
+                * We can't change this to one of the FILE_ID
+                * info levels as only Win2003 and above support
+                * these [MS-SMB: 2.2.2.3.1] and the SMB1 code
+                * needs to support older servers.
+                */
+               *ino = 0;
        }
        return NT_STATUS_OK;
 }