1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-09 09:57:48 +03:00

smbd: if close fails just log it, don't crash

Originally I added the assert here as we can't return the error being in a
talloc destructor. But OEMs prefer error log messages over crashes.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jul  8 09:04:28 UTC 2022 on sn-devel-184
This commit is contained in:
Ralph Boehme 2022-07-07 14:40:28 +02:00 committed by Volker Lendecke
parent 4f5faa806e
commit b8f3d8d052

View File

@ -424,12 +424,20 @@ static int smb_fname_fsp_destructor(struct smb_filename *smb_fname)
fsp_set_base_fsp(fsp, NULL);
status = fd_close(tmp_base_fsp);
SMB_ASSERT(NT_STATUS_IS_OK(status));
if (NT_STATUS_IS_OK(status)) {
DBG_ERR("Closing fd for fsp [%s] failed: %s. "
"Please check your filesystem!!!\n",
fsp_str_dbg(fsp), nt_errstr(status));
}
file_free(NULL, tmp_base_fsp);
}
status = fd_close(fsp);
SMB_ASSERT(NT_STATUS_IS_OK(status));
if (NT_STATUS_IS_OK(status)) {
DBG_ERR("Closing fd for fsp [%s] failed: %s. "
"Please check your filesystem!!!\n",
fsp_str_dbg(fsp), nt_errstr(status));
}
file_free(NULL, fsp);
smb_fname->fsp = NULL;