From: Jeremy Allison Date: Fri, 10 Dec 2021 00:08:07 +0000 (-0800) Subject: s3: smbd: Move setting of dirtype if FILE_ATTRIBUTE_NORMAL to do_unlink(). X-Git-Tag: tdb-1.4.6~346 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0333348239d422fe6a99aaaf4ac5cd9e32169e05;p=thirdparty%2Fsamba.git s3: smbd: Move setting of dirtype if FILE_ATTRIBUTE_NORMAL to do_unlink(). Now we don't use wildcards when calling in unlink_internals() the logic inside it serves no purpose and can be replaced with a direct call to do_unlink() (which we will rename to unlink_internals()). Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index b3b0ade839a..1285ea536b5 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3143,6 +3143,10 @@ static NTSTATUS do_unlink(connection_struct *conn, int ret; struct smb2_create_blobs *posx = NULL; + if (dirtype == 0) { + dirtype = FILE_ATTRIBUTE_NORMAL; + } + DEBUG(10,("do_unlink: %s, dirtype = %d\n", smb_fname_str_dbg(smb_fname), dirtype)); @@ -3336,9 +3340,6 @@ NTSTATUS unlink_internals(connection_struct *conn, status = NT_STATUS_NO_MEMORY; goto out; } - if (dirtype == 0) { - dirtype = FILE_ATTRIBUTE_NORMAL; - } status = check_name(conn, smb_fname); if (!NT_STATUS_IS_OK(status)) {