summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2015-11-25 15:23:26 +0100
committerKarolin Seeger <kseeger@samba.org>2016-01-26 21:28:19 +0100
commite33472d5f3bf7a3facd2541fd909c87bb43906eb (patch)
treee3e17c970a01ad5ac2d2193f1c7981c395d594fa
parent279246d4b18b0a3cd512153ac009667a6b49113a (diff)
downloadsamba-e33472d5f3bf7a3facd2541fd909c87bb43906eb.tar.gz
s3:smbd: Ignore initial allocation size for directory creation
We reject directory creation with an initial allocation size > 0 with NT_STATUS_ACCESS_DENIED. Windows servers ignore the initial allocation size on directories. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11684 Pair-Programmed-With: Volker Lendecke <vl@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 78ccbb07170c3e49a084d31434310f973e3d6158)
-rw-r--r--source3/smbd/open.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 2e0881871e8..5dbb0a570a0 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -4705,15 +4705,11 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
/* Save the requested allocation size. */
if ((info == FILE_WAS_CREATED) || (info == FILE_WAS_OVERWRITTEN)) {
- if (allocation_size
- && (allocation_size > fsp->fsp_name->st.st_ex_size)) {
+ if ((allocation_size > fsp->fsp_name->st.st_ex_size)
+ && !(fsp->is_directory))
+ {
fsp->initial_allocation_size = smb_roundup(
fsp->conn, allocation_size);
- if (fsp->is_directory) {
- /* Can't set allocation size on a directory. */
- status = NT_STATUS_ACCESS_DENIED;
- goto fail;
- }
if (vfs_allocate_file_space(
fsp, fsp->initial_allocation_size) == -1) {
status = NT_STATUS_DISK_FULL;