1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

smbd: Simplify open_file_ntcreate()

For streams our caller create_file_unixpath() has already taken care
of properly initializing fsp->base_fsp, so we can rely on
fsp_is_alternate_stream() here instead of looking at the file name.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2022-02-11 18:07:42 +01:00 committed by Jeremy Allison
parent 219dc590f8
commit 259a716c5a

View File

@ -4034,8 +4034,9 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
*/
/* Delete streams if create_disposition requires it */
if (!new_file_created && clear_ads(create_disposition) &&
!is_ntfs_stream_smb_fname(smb_fname)) {
if (!new_file_created &&
clear_ads(create_disposition) &&
!fsp_is_alternate_stream(fsp)) {
status = delete_all_streams(conn, smb_fname);
if (!NT_STATUS_IS_OK(status)) {
del_share_mode(lck, fsp);