]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Remove a late ref to "file_existed" in open_file_ntcreate()
authorVolker Lendecke <vl@samba.org>
Fri, 2 Aug 2019 13:21:49 +0000 (15:21 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 19 Aug 2019 23:14:39 +0000 (23:14 +0000)
If you follow "existing_dos_attributes" through the routine, this can
only ever be !=0 if SMB_VFS_GET_DOS_ATTRIBUTES() was successful. This
can only have been successful if the file existed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 23f80925840d30d93877036071eb510450102336..77dd33b837871ab3847870071a41e14817112558 100644 (file)
@@ -3687,8 +3687,8 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                /* POSIX opens are sparse by default. */
                fsp->is_sparse = true;
        } else {
-               fsp->is_sparse = (file_existed &&
-                       (existing_dos_attributes & FILE_ATTRIBUTE_SPARSE));
+               fsp->is_sparse =
+                       (existing_dos_attributes & FILE_ATTRIBUTE_SPARSE);
        }
 
        /*