]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: avoid a panic in close_directory()
authorRalph Boehme <slow@samba.org>
Mon, 18 Nov 2024 09:50:13 +0000 (10:50 +0100)
committerJule Anger <janger@samba.org>
Wed, 20 Nov 2024 09:55:08 +0000 (09:55 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15754

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
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-21-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-21-test): Wed Nov 20 09:55:08 UTC 2024 on atb-devel-224

source3/smbd/close.c

index 5cb2bb6f17c2dcba5147fdb42187f1edefaffce8..1b027a319a4b6722229b235fec4415fb36bffeff 100644 (file)
@@ -1495,7 +1495,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;
        }
 
        /*
@@ -1584,6 +1585,7 @@ done:
 
        remove_pending_change_notify_requests_by_fid(fsp, notify_status);
 
+close_fd:
        status1 = fd_close(fsp);
 
        if (!NT_STATUS_IS_OK(status1)) {