diff options
author | Jeremy Allison <jra@samba.org> | 2003-02-11 02:24:51 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-02-11 02:24:51 +0000 |
commit | 41894489e82a474f4f8f66aa2c7a117ed05b33e1 (patch) | |
tree | 92a10ea67048f5b4e032b9e3aa918eaa42f9e0c5 /source/smbd/close.c | |
parent | 041a1dd543ae5c197e17aae0b35a41060efc35f0 (diff) | |
download | samba-41894489e82a474f4f8f66aa2c7a117ed05b33e1.tar.gz samba-41894489e82a474f4f8f66aa2c7a117ed05b33e1.tar.xz samba-41894489e82a474f4f8f66aa2c7a117ed05b33e1.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.
Diffstat (limited to 'source/smbd/close.c')
-rw-r--r-- | source/smbd/close.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/smbd/close.c b/source/smbd/close.c index b0620febef9..4798d62db85 100644 --- a/source/smbd/close.c +++ b/source/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", |