summaryrefslogtreecommitdiffstats
path: root/source/smbd/close.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-10-27 23:30:25 +0000
committerJeremy Allison <jra@samba.org>2005-10-27 23:30:25 +0000
commitda0da1ae13e7679bd582795b8840b0b8ad8151f0 (patch)
treeb0d748bfb59f4a9736882af1d94efa3ab3472b29 /source/smbd/close.c
parent5aeb69924b303177bd4edc820f9ec8f71a2b8daa (diff)
downloadsamba-da0da1ae13e7679bd582795b8840b0b8ad8151f0.tar.gz
samba-da0da1ae13e7679bd582795b8840b0b8ad8151f0.tar.xz
samba-da0da1ae13e7679bd582795b8840b0b8ad8151f0.zip
r11344: I don't think share mode conflicts occur on deleting
a directory when you've got permissions. Need to write a smbtorture test for this. Jeremy.
Diffstat (limited to 'source/smbd/close.c')
-rw-r--r--source/smbd/close.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/source/smbd/close.c b/source/smbd/close.c
index 44ab168a3af..fcea62e1aa4 100644
--- a/source/smbd/close.c
+++ b/source/smbd/close.c
@@ -300,8 +300,6 @@ static int close_directory(files_struct *fsp, BOOL normal_close)
struct share_mode_lock *lck = 0;
BOOL delete_dir = False;
- remove_pending_change_notify_requests_by_fid(fsp);
-
/*
* NT can set delete_on_close of the last open
* reference to a directory also.
@@ -320,18 +318,7 @@ static int close_directory(files_struct *fsp, BOOL normal_close)
delete_dir = lck->delete_on_close;
- if (delete_dir) {
- int i;
- /* See if others still have the file open. If this is the
- * case, then don't delete */
- for (i=0; i<lck->num_share_modes; i++) {
- if (is_valid_share_mode_entry(&lck->share_modes[i])) {
- delete_dir = False;
- break;
- }
- }
- }
-
+ talloc_free(lck);
if (normal_close && delete_dir) {
BOOL ok = rmdir_internals(fsp->conn, fsp->fsp_name);
@@ -344,13 +331,15 @@ static int close_directory(files_struct *fsp, BOOL normal_close)
*/
if(ok) {
- remove_pending_change_notify_requests_by_filename(fsp);
+ remove_pending_change_notify_requests_by_fid(fsp, NT_STATUS_DELETE_PENDING);
+ remove_pending_change_notify_requests_by_filename(fsp, NT_STATUS_DELETE_PENDING);
+
}
process_pending_change_notify_queue((time_t)0);
+ } else {
+ remove_pending_change_notify_requests_by_fid(fsp, NT_STATUS_CANCELLED);
}
- talloc_free(lck);
-
/*
* Do the code common to files and directories.
*/