summaryrefslogtreecommitdiff
path: root/source3/smbd/close.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-02-11 02:24:45 +0000
committerJeremy Allison <jra@samba.org>2003-02-11 02:24:45 +0000
commitcc99ea0ef00a42b0bfc96b2d1e3faeae5871c582 (patch)
tree7ed4f85d190357fa9a7748c203d7283517c588f7 /source3/smbd/close.c
parentf687e95377e336691df3b4751d63d06633b97df8 (diff)
downloadsamba-cc99ea0ef00a42b0bfc96b2d1e3faeae5871c582.tar.gz
samba-cc99ea0ef00a42b0bfc96b2d1e3faeae5871c582.tar.bz2
samba-cc99ea0ef00a42b0bfc96b2d1e3faeae5871c582.zip
Fix delete on close semantics to match W2K. I (think:-) I understand it now :-).
Thanks to Nir Livni <nirl@cyber-ark.com> for giving me the test case to track it down. Jeremy. (This used to be commit c98ebb3031649203e607264ecb15722adf55af58)
Diffstat (limited to 'source3/smbd/close.c')
-rw-r--r--source3/smbd/close.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index b0620febef..4798d62db8 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -145,6 +145,22 @@ static int close_normal_file(files_struct *fsp, BOOL normal_close)
*/
lock_share_entry_fsp(fsp);
+
+ if (fsp->delete_on_close) {
+
+ /*
+ * Modify the share mode entry for all files open
+ * on this device and inode to tell other smbds we have
+ * changed the delete on close flag. The last closer will delete the file
+ * if flag is set.
+ */
+
+ NTSTATUS status =set_delete_on_close_over_all(fsp, fsp->delete_on_close);
+ if (NT_STATUS_V(status) != NT_STATUS_V(NT_STATUS_OK))
+ DEBUG(0,("close_normal_file: failed to change delete on close flag for file %s\n",
+ fsp->fsp_name ));
+ }
+
share_entry_count = del_share_mode(fsp, &share_entry);
DEBUG(10,("close_normal_file: share_entry_count = %d for file %s\n",