From: Jeremy Allison Date: Mon, 1 Aug 2022 18:40:14 +0000 (-0700) Subject: s3: smbd: Inside filename_convert_dirfsp_nosymlink(), don't require UCF_PREP_CREATEFI... X-Git-Tag: samba-4.17.0rc1~149 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9006f33b4fbe97ef09ae4e6c4d25eadf9b2b46d;p=thirdparty%2Fsamba.git s3: smbd: Inside filename_convert_dirfsp_nosymlink(), don't require UCF_PREP_CREATEFILE when parsing a stream name that doesn't already exist. We don't require it for a new file. Without this change, we have to add UCF_PREP_CREATEFILE to the destination flags when we are doing renames to a destination stream name, but not when doing renames to a destination file name, which makes for inconsistent API use. filename_convert_dirfsp() is now a drop in replacement for filename_convert(), even for the ugly SMB1 POSIX cases. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 8ccd350410b..3e90b8dd71b 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -3025,8 +3025,7 @@ static NTSTATUS filename_convert_dirfsp_nosymlink( goto done; } - if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND) && - (ucf_flags & UCF_PREP_CREATEFILE)) { + if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { /* * Creating a new stream *