summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/open.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 575503fa62..8be5e85270 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3422,6 +3422,41 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
fsp->base_fsp = base_fsp;
+ if ((ea_list != NULL) &&
+ ((info == FILE_WAS_CREATED) || (info == FILE_WAS_OVERWRITTEN))) {
+ status = set_ea(conn, fsp, fsp->fsp_name, ea_list);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto fail;
+ }
+ }
+
+ if (!fsp->is_directory && S_ISDIR(fsp->fsp_name->st.st_ex_mode)) {
+ status = NT_STATUS_ACCESS_DENIED;
+ goto fail;
+ }
+
+ /* 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)) {
+ 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;
+ goto fail;
+ }
+ } else {
+ fsp->initial_allocation_size = smb_roundup(
+ fsp->conn, (uint64_t)fsp->fsp_name->st.st_ex_size);
+ }
+ }
+
/*
* According to the MS documentation, the only time the security
* descriptor is applied to the opened file is iff we *created* the
@@ -3461,41 +3496,6 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
}
}
- if ((ea_list != NULL) &&
- ((info == FILE_WAS_CREATED) || (info == FILE_WAS_OVERWRITTEN))) {
- status = set_ea(conn, fsp, fsp->fsp_name, ea_list);
- if (!NT_STATUS_IS_OK(status)) {
- goto fail;
- }
- }
-
- if (!fsp->is_directory && S_ISDIR(fsp->fsp_name->st.st_ex_mode)) {
- status = NT_STATUS_ACCESS_DENIED;
- goto fail;
- }
-
- /* 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)) {
- 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;
- goto fail;
- }
- } else {
- fsp->initial_allocation_size = smb_roundup(
- fsp->conn, (uint64_t)fsp->fsp_name->st.st_ex_size);
- }
- }
-
DEBUG(10, ("create_file_unixpath: info=%d\n", info));
*result = fsp;