From: Volker Lendecke Date: Fri, 2 Aug 2019 13:21:49 +0000 (+0200) Subject: smbd: Remove a late ref to "file_existed" in open_file_ntcreate() X-Git-Tag: tdb-1.4.2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bd7b119e6882aee04badc92f2ddbcbc1964c115;p=thirdparty%2Fsamba.git smbd: Remove a late ref to "file_existed" in open_file_ntcreate() 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 23f80925840..77dd33b8378 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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); } /*