From 82db30cdbd9d2ce3a49dbcb9bbafc81b4fdb331f Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Mon, 18 Nov 2024 10:50:13 +0100 Subject: [PATCH] smbd: avoid a panic in close_directory() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit BUG: https://bugzilla.samba.org/show_bug.cgi?id=15754 Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Mon Nov 18 12:43:28 UTC 2024 on atb-devel-224 (backported from commit f86d1a35917cdcc07b2fa741c6a369aaad24abaf) [slow@samba.org: context changes from Directory Leases] Autobuild-User(v4-20-test): Jule Anger Autobuild-Date(v4-20-test): Wed Nov 20 11:17:07 UTC 2024 on atb-devel-224 --- source3/smbd/close.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source3/smbd/close.c b/source3/smbd/close.c index bbca474a28a..cda139ebd18 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -1506,7 +1506,8 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, if (!NT_STATUS_IS_OK(status)) { DBG_ERR("share_mode_entry_prepare_lock_del() failed for %s - %s\n", fsp_str_dbg(fsp), nt_errstr(status)); - return status; + log_stack_trace(); + goto close_fd; } /* @@ -1595,6 +1596,7 @@ done: remove_pending_change_notify_requests_by_fid(fsp, notify_status); +close_fd: status1 = fd_close(fsp); if (!NT_STATUS_IS_OK(status1)) { -- 2.47.2