]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: use fsp->name_hash in check_parent_access_fsp()
authorRalph Boehme <slow@samba.org>
Sat, 24 May 2025 09:47:37 +0000 (11:47 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 28 May 2025 16:03:59 +0000 (16:03 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15861

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed May 28 16:03:59 UTC 2025 on atb-devel-224

source3/smbd/open.c

index c49b8ab8c9259047e3fc865b64f886ecb030c59a..988317b804c369836928aa18704f38f8e35f3857 100644 (file)
@@ -346,7 +346,6 @@ NTSTATUS check_parent_access_fsp(struct files_struct *fsp,
        NTSTATUS status;
        struct security_descriptor *parent_sd = NULL;
        uint32_t access_granted = 0;
-       uint32_t name_hash;
        bool delete_on_close_set;
        TALLOC_CTX *frame = talloc_stackframe();
 
@@ -406,15 +405,7 @@ NTSTATUS check_parent_access_fsp(struct files_struct *fsp,
                goto out;
        }
 
-       /* Check if the directory has delete-on-close set */
-       status = file_name_hash(fsp->conn,
-                               fsp->fsp_name->base_name,
-                               &name_hash);
-       if (!NT_STATUS_IS_OK(status)) {
-               goto out;
-       }
-
-       get_file_infos(fsp->file_id, name_hash, &delete_on_close_set);
+       get_file_infos(fsp->file_id, fsp->name_hash, &delete_on_close_set);
        if (delete_on_close_set) {
                status = NT_STATUS_DELETE_PENDING;
                goto out;