]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Add dirfsp parameter to can_delete_file_in_directory().
authorJeremy Allison <jra@samba.org>
Thu, 30 Apr 2020 22:28:32 +0000 (15:28 -0700)
committerRalph Boehme <slow@samba.org>
Mon, 4 May 2020 13:55:32 +0000 (13:55 +0000)
Not yet used. Currently always conn->cwd_fsp.

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

index 6c4f38b6a9cf612d8b0913b7ade8b042221fbff0..a05b031c62d188795ab8a7e86957d90007454dc0 100644 (file)
 ****************************************************************************/
 
 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;
 
+       SMB_ASSERT(dirfsp == conn->cwd_fsp);
+
        if (!CAN_WRITE(conn)) {
                return False;
        }
index 039e9f4786b2a1237b579d2f32aacec176202aed..1736ecf990f3f56939537d12345064e04a58411b 100644 (file)
@@ -82,6 +82,7 @@ static bool parent_override_delete(connection_struct *conn,
        if ((access_mask & DELETE_ACCESS) &&
                    (rejected_mask & DELETE_ACCESS) &&
                    can_delete_file_in_directory(conn,
+                               conn->cwd_fsp,
                                smb_fname))
        {
                return true;
@@ -3074,6 +3075,7 @@ static NTSTATUS smbd_calculate_maximum_allowed_access(
 
        if (!(access_granted & DELETE_ACCESS)) {
                if (can_delete_file_in_directory(conn,
+                               conn->cwd_fsp,
                                smb_fname))
                {
                        *p_access_mask |= DELETE_ACCESS;
index 5e81670b5fab99d3d6e1e32973ff9a748095ab9e..cdb7dcce41cda7fbb860afbb95852da54299c6cf 100644 (file)
@@ -331,6 +331,7 @@ void reply_openerror(struct smb_request *req, NTSTATUS status);
 /* The following definitions come from smbd/file_access.c  */
 
 bool can_delete_file_in_directory(connection_struct *conn,
+                       struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname);
 bool can_write_to_file(connection_struct *conn,
                       const struct smb_filename *smb_fname);