From be6cc4cc23f61d4c44796621daf726733f718a1a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 3 Mar 2022 20:13:25 +0100 Subject: [PATCH] smbd: Log close_file_free() failure in copy_internals() Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/smbd/nttrans.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index af7a49646e9..0fa18eb88e1 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1663,6 +1663,14 @@ NTSTATUS copy_internals(TALLOC_CTX *ctx, set_close_write_time(fsp2, smb_fname_src->st.st_ex_mtime); status = close_file_free(NULL, &fsp2, NORMAL_CLOSE); + if (!NT_STATUS_IS_OK(status)) { + DBG_WARNING("close_file_free() failed: %s\n", + nt_errstr(status)); + /* + * We can't do much but leak the fsp + */ + goto out; + } /* Grrr. We have to do this as open_file_ntcreate adds FILE_ATTRIBUTE_ARCHIVE when it creates the file. This isn't the correct thing to do in the copy