1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

s3: smbd: smbd_calculate_maximum_allowed_access_fsp(), add parent dirfsp parameter and pass to can_delete_file_in_directory().

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>
This commit is contained in:
Jeremy Allison 2021-06-08 11:40:11 -07:00 committed by Ralph Boehme
parent eaff826aed
commit 6503bb48ca

View 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);