s3: smbd: Add a dirfsp parameter to smbd_calculate_maximum_allowed_access().
authorJeremy Allison <jra@samba.org>
Fri, 1 May 2020 17:18:08 +0000 (10:18 -0700)
committerRalph Boehme <slow@samba.org>
Mon, 4 May 2020 15:33:08 +0000 (15:33 +0000)
Not yet used. Currently always conn->cwd_fsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph B√∂hme <slow@samba.org>
Autobuild-Date(master): Mon May  4 15:33:09 UTC 2020 on sn-devel-184

source3/smbd/open.c

index e24a8614c83bfda189b848d4703f4524802da5df..5f612533267fad5f74c1e0f2a29491ad78668ade 100644 (file)
@@ -3031,6 +3031,7 @@ static void schedule_async_open(struct smb_request *req)
 
 static NTSTATUS smbd_calculate_maximum_allowed_access(
        connection_struct *conn,
+       struct files_struct *dirfsp,
        const struct smb_filename *smb_fname,
        bool use_privs,
        uint32_t *p_access_mask)
@@ -3039,6 +3040,8 @@ static NTSTATUS smbd_calculate_maximum_allowed_access(
        uint32_t access_granted;
        NTSTATUS status;
 
+       SMB_ASSERT(dirfsp == conn->cwd_fsp);
+
        if (!use_privs && (get_current_uid(conn) == (uid_t)0)) {
                *p_access_mask |= FILE_GENERIC_ALL;
                return NT_STATUS_OK;
@@ -3131,6 +3134,7 @@ NTSTATUS smbd_calculate_access_mask(connection_struct *conn,
        if (access_mask & MAXIMUM_ALLOWED_ACCESS) {
 
                status = smbd_calculate_maximum_allowed_access(conn,
+                                       dirfsp,
                                        smb_fname,
                                        use_privs,
                                        &access_mask);