]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Remove smbd_calculate_access_mask(). No longer used.
authorJeremy Allison <jra@samba.org>
Tue, 8 Jun 2021 00:27:29 +0000 (17:27 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:31 +0000 (13:14 +0000)
Comment out smbd_calculate_maximum_allowed_access() as it is
a static function and we just removed the only caller.

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

index 58aa07a08d916c27999c01fa8fdac6745ec87bbd..778162d21df9c49f2d721ee7ebce0d83738574fd 100644 (file)
@@ -211,13 +211,6 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
                               struct ea_list *name_list,
                               struct file_id *file_id);
 
-NTSTATUS smbd_calculate_access_mask(connection_struct *conn,
-                       struct files_struct *dirfsp,
-                       const struct smb_filename *smb_fname,
-                       bool use_privs,
-                       uint32_t access_mask,
-                       uint32_t *access_mask_out);
-
 NTSTATUS smbd_calculate_access_mask_fsp(struct files_struct *fsp,
                        bool use_privs,
                        uint32_t access_mask,
index e4a345a90ad67968eecf4b399fa9701053478f43..0a6b691195ec88fc7f6e7a6cdc24ebd0d68d793b 100644 (file)
@@ -3189,6 +3189,7 @@ static void schedule_async_open(struct smb_request *req)
        }
 }
 
+#if 0
 /****************************************************************************
  Work out what access_mask to use from what the client sent us.
 ****************************************************************************/
@@ -3271,6 +3272,7 @@ static NTSTATUS smbd_calculate_maximum_allowed_access(
 
        return NT_STATUS_OK;
 }
+#endif
 
 /****************************************************************************
  Work out what access_mask to use from what the client sent us.
@@ -3362,64 +3364,6 @@ static NTSTATUS smbd_calculate_maximum_allowed_access_fsp(
        return NT_STATUS_OK;
 }
 
-NTSTATUS smbd_calculate_access_mask(connection_struct *conn,
-                       struct files_struct *dirfsp,
-                       const struct smb_filename *smb_fname,
-                       bool use_privs,
-                       uint32_t access_mask,
-                       uint32_t *access_mask_out)
-{
-       NTSTATUS status;
-       uint32_t orig_access_mask = access_mask;
-       uint32_t rejected_share_access;
-
-       SMB_ASSERT(dirfsp == conn->cwd_fsp);
-
-       if (access_mask & SEC_MASK_INVALID) {
-               DBG_DEBUG("access_mask [%8x] contains invalid bits\n",
-                         access_mask);
-               return NT_STATUS_ACCESS_DENIED;
-       }
-
-       /*
-        * Convert GENERIC bits to specific bits.
-        */
-
-       se_map_generic(&access_mask, &file_generic_mapping);
-
-       /* Calculate MAXIMUM_ALLOWED_ACCESS if requested. */
-       if (access_mask & MAXIMUM_ALLOWED_ACCESS) {
-
-               status = smbd_calculate_maximum_allowed_access(conn,
-                                       dirfsp,
-                                       smb_fname,
-                                       use_privs,
-                                       &access_mask);
-
-               if (!NT_STATUS_IS_OK(status)) {
-                       return status;
-               }
-
-               access_mask &= conn->share_access;
-       }
-
-       rejected_share_access = access_mask & ~(conn->share_access);
-
-       if (rejected_share_access) {
-               DEBUG(10, ("smbd_calculate_access_mask: Access denied on "
-                       "file %s: rejected by share access mask[0x%08X] "
-                       "orig[0x%08X] mapped[0x%08X] reject[0x%08X]\n",
-                       smb_fname_str_dbg(smb_fname),
-                       conn->share_access,
-                       orig_access_mask, access_mask,
-                       rejected_share_access));
-               return NT_STATUS_ACCESS_DENIED;
-       }
-
-       *access_mask_out = access_mask;
-       return NT_STATUS_OK;
-}
-
 NTSTATUS smbd_calculate_access_mask_fsp(struct files_struct *fsp,
                        bool use_privs,
                        uint32_t access_mask,