From 7cbfd0e1ecec1919ce0d352ce984f32b970f03da Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Wed, 16 Jan 2013 15:02:26 +0400 Subject: [PATCH] Fix bug #9571 - Unlink after open causes smbd to panic. s3:smbd: fix wrong lock order in posix unlink Signed-off-by: Pavel Shilovsky Reviewed-by: Jeremy Allison --- source3/smbd/trans2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 9b15698..27ff550 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -7662,8 +7662,8 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn, continue; } /* Fail with sharing violation. */ - close_file(req, fsp, NORMAL_CLOSE); TALLOC_FREE(lck); + close_file(req, fsp, NORMAL_CLOSE); return NT_STATUS_SHARING_VIOLATION; } } @@ -7677,12 +7677,12 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn, fsp, smb_fname); + TALLOC_FREE(lck); + if (!NT_STATUS_IS_OK(status)) { close_file(req, fsp, NORMAL_CLOSE); - TALLOC_FREE(lck); return status; } - TALLOC_FREE(lck); return close_file(req, fsp, NORMAL_CLOSE); } -- 1.7.10.4