]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: return inode number, not FileIndex for UNIX query info level
authorRalph Boehme <slow@samba.org>
Tue, 25 Jun 2019 10:07:59 +0000 (12:07 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 1 Jul 2019 21:43:24 +0000 (21:43 +0000)
get_FileIndex() returns a stable and unique numerical identifier when "store dos
attributes" is enabled. It is NOT the same as a file's inode number which used
as the key for locking.tdb.

For POSIX clients we should return the inode numbers in the POSIX query info
level and the FileIndex in the corresponding SMB protocol fields (eg SMB2 QFID
create context).

This fix lets test "smbtorture_s3.plain.CLEANUP3" test work with get_FileIndex()
returning something different then the file's inode number.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/trans2.c

index 77297c158b7d33c152f0c9a8b3a84fdd1d522aa6..02a6d4b24071d7455c7c4ad8dcd254a7ea4b8f14 100644 (file)
@@ -4601,7 +4601,6 @@ static char *store_file_unix_basic(connection_struct *conn,
                                files_struct *fsp,
                                const SMB_STRUCT_STAT *psbuf)
 {
-       uint64_t file_index = get_FileIndex(conn, psbuf);
        dev_t devno;
 
        DEBUG(10,("store_file_unix_basic: SMB_QUERY_FILE_UNIX_BASIC\n"));
@@ -4643,7 +4642,7 @@ static char *store_file_unix_basic(connection_struct *conn,
        SIVAL(pdata,4,0);
        pdata += 8;
 
-       SINO_T_VAL(pdata,0,(SMB_INO_T)file_index);   /* inode number */
+       SINO_T_VAL(pdata, 0, psbuf->st_ex_ino);   /* inode number */
        pdata += 8;
 
        SIVAL(pdata,0, unix_perms_to_wire(psbuf->st_ex_mode));     /* Standard UNIX file permissions */