]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: In can_delete_file_in_directory(), get a real parent pathref.
authorJeremy Allison <jra@samba.org>
Tue, 8 Jun 2021 18:14:29 +0000 (11:14 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:31 +0000 (13:14 +0000)
Not yet used but we will use this to get the parent ACL via handle.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/file_access.c

index 9d06bf78528700cccdfeae31a673c97882637095..71469fea31ccc2abefb1907ed4c0b75ac2dab683 100644 (file)
@@ -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;
                }