]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: smbd_calculate_maximum_allowed_access_fsp(), add parent dirfsp parameter...
authorJeremy Allison <jra@samba.org>
Tue, 8 Jun 2021 18:40:11 +0000 (11:40 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:31 +0000 (13:14 +0000)
Pass the same fsp->conn->cwd_fsp parameter to can_delete_file_in_directory()
dirfsp for now.

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

index aea2eaf27b8db54e410169a9b934f3cfd2b196af..a2c25605cc82e770c5e39e493dad36b711f97ef8 100644 (file)
@@ -3157,6 +3157,7 @@ static void schedule_async_open(struct smb_request *req)
 ****************************************************************************/
 
 static NTSTATUS smbd_calculate_maximum_allowed_access_fsp(
+                       struct files_struct *dirfsp,
                        struct files_struct *fsp,
                        bool use_privs,
                        uint32_t *p_access_mask)
@@ -3233,7 +3234,7 @@ static NTSTATUS smbd_calculate_maximum_allowed_access_fsp(
 
        if (!(access_granted & DELETE_ACCESS)) {
                if (can_delete_file_in_directory(fsp->conn,
-                               fsp->conn->cwd_fsp,
+                               dirfsp,
                                fsp->fsp_name)) {
                        *p_access_mask |= DELETE_ACCESS;
                }
@@ -3266,7 +3267,9 @@ NTSTATUS smbd_calculate_access_mask_fsp(struct files_struct *fsp,
        /* Calculate MAXIMUM_ALLOWED_ACCESS if requested. */
        if (access_mask & MAXIMUM_ALLOWED_ACCESS) {
 
-               status = smbd_calculate_maximum_allowed_access_fsp(fsp,
+               status = smbd_calculate_maximum_allowed_access_fsp(
+                                                  fsp->conn->cwd_fsp,
+                                                  fsp,
                                                   use_privs,
                                                   &access_mask);