]> 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)
committerJule Anger <janger@samba.org>
Thu, 5 Jun 2025 10:57:15 +0000 (10:57 +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

(backported from commit 9b9fc589e55d467c97fd4580c2d6d9aa8cb73b13)
[slow@samba.org: removed write_time arg to get_file_infos() in master]

source3/smbd/open.c

index e23f5d29e6e548bd3e80678ecc37ead734c3aa73..1c920816a26351926370d3d840f219332c323082 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, NULL);
+       get_file_infos(fsp->file_id, fsp->name_hash, &delete_on_close_set, NULL);
        if (delete_on_close_set) {
                status = NT_STATUS_DELETE_PENDING;
                goto out;