From 6277592e0564db12cd25369c7d8d782d95c3583d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Jun 2012 12:52:16 +0200 Subject: [PATCH] try to fix SMB_ASSERT(got_token)... TODO --- source3/smbd/close.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 4b7f6945107c..bdd177cca8f3 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -385,12 +385,6 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp, } } - if (!del_share_mode(lck, fsp)) { - DEBUG(0, ("close_remove_share_mode: Could not delete share " - "entry for file %s\n", - fsp_str_dbg(fsp))); - } - if (fsp->initial_delete_on_close && !is_delete_on_close_set(lck, fsp->name_hash)) { bool became_user = False; @@ -420,6 +414,9 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp, POSIX delete now. */ for (i=0; idata->num_share_modes; i++) { struct share_mode_entry *e = &lck->data->share_modes[i]; + + //TODO: continue if our own entry... + if (is_valid_share_mode_entry(e) && e->name_hash == fsp->name_hash) { if (fsp->posix_open && (e->flags & SHARE_MODE_FLAG_POSIX_OPEN)) { @@ -445,6 +442,12 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp, if (!(close_type == NORMAL_CLOSE || close_type == SHUTDOWN_CLOSE) || !delete_file) { + if (!del_share_mode(lck, fsp)) { + DEBUG(0, ("close_remove_share_mode: Could not delete share " + "entry for file %s\n", + fsp_str_dbg(fsp))); + } + TALLOC_FREE(lck); return NT_STATUS_OK; } @@ -564,6 +567,14 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp, pop_sec_ctx(); } + if (delete_file) { + if (!del_share_mode(lck, fsp)) { + DEBUG(0, ("close_remove_share_mode: Could not delete share " + "entry for file %s\n", + fsp_str_dbg(fsp))); + } + } + TALLOC_FREE(lck); if (delete_file) { -- 2.34.1