1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

smbd: handling of fsp->dirfsps in close_file()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2020-05-18 14:37:18 +02:00
parent 1736ef26c7
commit a947b67d78

View File

@ -1255,6 +1255,26 @@ NTSTATUS close_file(struct smb_request *req, files_struct *fsp,
NTSTATUS status;
struct files_struct *base_fsp = fsp->base_fsp;
if (fsp->fsp_flags.is_dirfsp) {
/*
* The typical way to get here is via file_close_[conn|user]()
* and this is taken care of below.
*/
return NT_STATUS_OK;
}
if (fsp->dirfsp != NULL &&
fsp->dirfsp != fsp->conn->cwd_fsp)
{
status = fd_close(fsp->dirfsp);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
file_free(NULL, fsp->dirfsp);
fsp->dirfsp = NULL;
}
if (fsp->fsp_flags.is_directory) {
status = close_directory(req, fsp, close_type);
} else if (fsp->fake_file_handle != NULL) {