From 578909ae19d7ec9dacb960626bd1985a2915365b Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Wed, 16 Jan 2013 15:02:26 +0400 Subject: 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 Reviewed-by: Stefan Metzmacher --- source3/smbd/trans2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 9c77f4d3f9..92d047ae5d 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -7663,8 +7663,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; } } @@ -7678,12 +7678,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); } -- cgit