smbd: adjust allocation size check across handles in smbd_do_qfilepathinfo()
authorRalph Boehme <slow@samba.org>
Tue, 17 Nov 2020 06:59:13 +0000 (07:59 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
Check all open files if either we don't have an fsp or if the fsp is not a full
FSA fsp, ie not one which was created by SMB_VFS_CREATE_FILE() but by
openat_pathref_fsp().

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

index a188641e3477adf9a4e43ed3101b208d3c1c91f8..55eb015b5ce24217653da456258e8a7b700740df 100644 (file)
@@ -5304,7 +5304,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
 
        allocation_size = SMB_VFS_GET_ALLOC_SIZE(conn, fsp, psbuf);
 
-       if (!fsp) {
+       if (fsp == NULL || !fsp->fsp_flags.is_fsa) {
                /* Do we have this path open ? */
                files_struct *fsp1;
                struct file_id fileid = vfs_file_id_from_sbuf(conn, psbuf);