1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

s3: smbd: Every place we check fsp->deferred_close, also check for fsp->closing.

Eventually this will allow us to remove fsp->deferred_close
from the fsp struct (and also source3/lib/tevent_wait.[ch]).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2020-03-11 15:16:35 -07:00
parent b7d09b30ad
commit 4287ea138e
2 changed files with 24 additions and 0 deletions

View File

@ -280,6 +280,16 @@ NTSTATUS vfs_offload_token_check_handles(uint32_t fsctl,
return NT_STATUS_ACCESS_DENIED;
}
if (src_fsp->closing) {
DBG_INFO("copy chunk src handle with closing in progress.\n");
return NT_STATUS_ACCESS_DENIED;
}
if (dst_fsp->closing) {
DBG_INFO("copy chunk dst handle with closing in progress.\n");
return NT_STATUS_ACCESS_DENIED;
}
if (src_fsp->is_directory) {
DBG_INFO("copy chunk no read on src directory handle (%s).\n",
smb_fname_str_dbg(src_fsp->fsp_name));

View File

@ -598,6 +598,9 @@ files_struct *file_fsp(struct smb_request *req, uint16_t fid)
if (req->chain_fsp->deferred_close) {
return NULL;
}
if (req->chain_fsp->closing) {
return NULL;
}
return req->chain_fsp;
}
@ -622,6 +625,10 @@ files_struct *file_fsp(struct smb_request *req, uint16_t fid)
return NULL;
}
if (fsp->closing) {
return NULL;
}
req->chain_fsp = fsp;
return fsp;
}
@ -669,6 +676,10 @@ struct files_struct *file_fsp_get(struct smbd_smb2_request *smb2req,
return NULL;
}
if (fsp->closing) {
return NULL;
}
return fsp;
}
@ -682,6 +693,9 @@ struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req,
if (smb2req->compat_chain_fsp->deferred_close) {
return NULL;
}
if (smb2req->compat_chain_fsp->closing) {
return NULL;
}
return smb2req->compat_chain_fsp;
}