summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 80756d6641..32a08b5967 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2221,6 +2221,15 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
}
}
+ /* Determine sparse flag. */
+ if (posix_open) {
+ /* POSIX opens are sparse by default. */
+ fsp->is_sparse = true;
+ } else {
+ fsp->is_sparse = (file_existed &&
+ (existing_dos_attributes & FILE_ATTRIBUTE_SPARSE));
+ }
+
/*
* Take care of inherited ACLs on created files - if default ACL not
* selected.