diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2013-01-16 15:02:26 +0400 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-01-28 13:49:34 +0100 |
commit | 578909ae19d7ec9dacb960626bd1985a2915365b (patch) | |
tree | aba0f08a07d19d439eabc170e1722f7b0a410695 | |
parent | 34854ae58fb0fdeec7f27d1d6264b2035778ea6b (diff) | |
download | samba-578909ae19d7ec9dacb960626bd1985a2915365b.tar.gz samba-578909ae19d7ec9dacb960626bd1985a2915365b.tar.bz2 samba-578909ae19d7ec9dacb960626bd1985a2915365b.zip |
Fix bug #9571 - Unlink after open causes smbd to panic.
s3:smbd: fix wrong lock order in posix unlink
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | source3/smbd/trans2.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |