summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/close.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 093bb9f7ed..2bd588b176 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -246,6 +246,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
const struct security_token *del_nt_token = NULL;
bool got_tokens = false;
bool normal_close;
+ int ret_flock;
/* Ensure any pending write time updates are done. */
if (fsp->update_write_time_event) {
@@ -469,6 +470,14 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
pop_sec_ctx();
}
+ /* remove filesystem sharemodes */
+ ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, 0, 0);
+ if (ret_flock == -1) {
+ DEBUG(2, ("close_remove_share_mode: removing kernel flock for "
+ "%s failed: %s\n", fsp_str_dbg(fsp),
+ strerror(errno)));
+ }
+
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)));