From: Jeremy Allison Date: Thu, 17 Dec 2020 00:38:28 +0000 (-0800) Subject: smbd: Ensure close_directory() and close_normal_file() only deal with is_fsa files. X-Git-Tag: samba-4.14.0rc1~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de806498603b47274f1e4647eeb2a84db2b7319a;p=thirdparty%2Fsamba.git smbd: Ensure close_directory() and close_normal_file() only deal with is_fsa files. This must be the case, so assert it. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/close.c b/source3/smbd/close.c index f1aca052470..e53faf98007 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -706,6 +706,8 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp, connection_struct *conn = fsp->conn; bool is_durable = false; + SMB_ASSERT(fsp->fsp_flags.is_fsa); + assert_no_pending_aio(fsp, close_type); while (talloc_array_length(fsp->blocked_smb1_lock_reqs) != 0) { @@ -1149,6 +1151,8 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, const struct security_unix_token *del_token = NULL; NTSTATUS notify_status; + SMB_ASSERT(fsp->fsp_flags.is_fsa); + if (fsp->conn->sconn->using_smb2) { notify_status = NT_STATUS_NOTIFY_CLEANUP; } else {