From 5e268266f8f602225ddc1bfbdc84c61c2690270b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 8 Jun 2021 11:14:29 -0700 Subject: [PATCH] s3: smbd: In can_delete_file_in_directory(), get a real parent pathref. Not yet used but we will use this to get the parent ACL via handle. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/file_access.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c index 9d06bf78528..71469fea31c 100644 --- a/source3/smbd/file_access.c +++ b/source3/smbd/file_access.c @@ -36,7 +36,6 @@ bool can_delete_file_in_directory(connection_struct *conn, struct files_struct *dirfsp, const struct smb_filename *smb_fname) { - TALLOC_CTX *ctx = talloc_tos(); struct smb_filename *smb_fname_parent = NULL; bool ret; NTSTATUS status; @@ -58,12 +57,15 @@ bool can_delete_file_in_directory(connection_struct *conn, if (dirfsp != conn->cwd_fsp) { smb_fname_parent = dirfsp->fsp_name; } else { - /* Get the parent directory permission mask and owners. */ - status = SMB_VFS_PARENT_PATHNAME(conn, - ctx, - smb_fname, - &smb_fname_parent, - NULL); + struct smb_filename *atname = NULL; + /* + * Get a pathref on the parent. + */ + status = parent_pathref(talloc_tos(), + conn->cwd_fsp, + smb_fname, + &smb_fname_parent, + &atname); if (!NT_STATUS_IS_OK(status)) { return false; } -- 2.47.3