summaryrefslogtreecommitdiffstats
path: root/source3/locking/locking.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/locking/locking.c')
-rw-r--r--source3/locking/locking.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index ba363501d8c..ddd469de289 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -1459,6 +1459,14 @@ NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode)
/* Don't allow delete on close for non-empty directories. */
if (fsp->is_directory) {
SMB_ASSERT(!is_ntfs_stream_smb_fname(fsp->fsp_name));
+
+ /* Or the root of a share. */
+ if (ISDOT(fsp->fsp_name->base_name)) {
+ DEBUG(10,("can_set_delete_on_close: can't set delete on "
+ "close for the root of a share.\n"));
+ return NT_STATUS_ACCESS_DENIED;
+ }
+
return can_delete_directory(fsp->conn,
fsp->fsp_name->base_name);
}