summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/open.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 6261a449d8..f077210a96 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2489,6 +2489,17 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
return fsp_open;
}
+ if (new_file_created) {
+ /*
+ * As we atomically create using O_CREAT|O_EXCL,
+ * then if new_file_created is true, then
+ * file_existed *MUST* have been false (even
+ * if the file was previously detected as being
+ * there).
+ */
+ file_existed = false;
+ }
+
if (file_existed && !check_same_dev_ino(&saved_stat, &smb_fname->st)) {
/*
* The file did exist, but some other (local or NFS)