]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Move setting of dirtype if FILE_ATTRIBUTE_NORMAL to do_unlink().
authorJeremy Allison <jra@samba.org>
Fri, 10 Dec 2021 00:08:07 +0000 (16:08 -0800)
committerRalph Boehme <slow@samba.org>
Sat, 11 Dec 2021 07:17:28 +0000 (07:17 +0000)
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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/reply.c

index b3b0ade839ad42df69dbf6e40b9b5d05db579e84..1285ea536b5ecc91ee4f07010a1117452d781bc2 100644 (file)
@@ -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)) {