summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolodymyr Khomenko <Volodymyr_Khomenko@dell.com>2011-10-12 09:57:57 -0700
committerKarolin Seeger <kseeger@samba.org>2011-10-15 20:48:48 +0200
commit7877565b4d62dbd89ccdc6948a519954e8e4e52d (patch)
tree304783f3a6ba9ad565eee1b6813b12cff8ee1bb6
parent52015088500dd9d586df2dc5c0108d7a1d9436de (diff)
downloadsamba-7877565b4d62dbd89ccdc6948a519954e8e4e52d.tar.gz
samba-7877565b4d62dbd89ccdc6948a519954e8e4e52d.tar.xz
samba-7877565b4d62dbd89ccdc6948a519954e8e4e52d.zip
Fix bug #8515 - Empty CIFS share can be blocked for other clients by deleting it via empty path (DELETE_PENDING until the last client)
Disallow "." in can_set_delete_on_close(). Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Oct 12 21:07:27 CEST 2011 on sn-devel-104 (cherry picked from commit bd260f03ab492d03c2890db47dc6fb4f1b824a1a) (cherry picked from commit 0953c4b9ebc06518920b9d49de16dfaeb7d69a35)
-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);
}