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

s3:smbd: let close_directory() hold the lock during delete_all_streams/rmdir_internals

Now that we're using g_lock, it doesn't mean we're holding a tdb
chainlock.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Stefan Metzmacher 2022-09-12 19:15:58 +02:00 committed by Jeremy Allison
parent 387f126d07
commit 095da847e7

View File

@ -1436,13 +1436,6 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
del_token->groups,
del_nt_token);
if (!del_share_mode(lck, fsp)) {
DEBUG(0, ("close_directory: Could not delete share entry for "
"%s\n", fsp_str_dbg(fsp)));
}
TALLOC_FREE(lck);
if ((fsp->conn->fs_capabilities & FILE_NAMED_STREAMS)
&& !is_ntfs_stream_smb_fname(fsp->fsp_name)) {
@ -1473,15 +1466,15 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
if (NT_STATUS_IS_OK(status)) {
notify_status = NT_STATUS_DELETE_PENDING;
}
} else {
if (!del_share_mode(lck, fsp)) {
DEBUG(0, ("close_directory: Could not delete share entry for "
"%s\n", fsp_str_dbg(fsp)));
}
TALLOC_FREE(lck);
}
if (!del_share_mode(lck, fsp)) {
DEBUG(0, ("close_directory: Could not delete share entry for "
"%s\n", fsp_str_dbg(fsp)));
}
TALLOC_FREE(lck);
remove_pending_change_notify_requests_by_fid(fsp, notify_status);
status1 = fd_close(fsp);