From: Ralph Boehme Date: Sat, 24 May 2025 09:47:37 +0000 (+0200) Subject: smbd: use fsp->name_hash in check_parent_access_fsp() X-Git-Tag: tevent-0.17.0~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b9fc589e55d467c97fd4580c2d6d9aa8cb73b13;p=thirdparty%2Fsamba.git smbd: use fsp->name_hash in check_parent_access_fsp() BUG: https://bugzilla.samba.org/show_bug.cgi?id=15861 Signed-off-by: Ralph Boehme Reviewed-by: Bjoern Jacke Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Wed May 28 16:03:59 UTC 2025 on atb-devel-224 --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index c49b8ab8c92..988317b804c 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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;