summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-12-15 16:30:08 +0100
committerVolker Lendecke <vl@samba.org>2011-12-16 07:34:48 +0100
commitce30a7ae7be70eb4cfac5454d453c32c71e4a5ed (patch)
treeffcc17290ad2c84ef8b22f148c85513145df65fe /source3
parent98f7ba52e341db4cd76e63662f90a68cc3624f39 (diff)
downloadsamba-ce30a7ae7be70eb4cfac5454d453c32c71e4a5ed.tar.gz
samba-ce30a7ae7be70eb4cfac5454d453c32c71e4a5ed.tar.bz2
samba-ce30a7ae7be70eb4cfac5454d453c32c71e4a5ed.zip
s3: Make open_file_ntcreate a bit easier to read
Move the calculation of "new_file_created" closer to its use
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/open.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 4ea51dd4e9..17d9f6f8fb 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2402,10 +2402,6 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
fsp->oplock_type = NO_OPLOCK;
}
- if (info == FILE_WAS_OVERWRITTEN || info == FILE_WAS_CREATED || info == FILE_WAS_SUPERSEDED) {
- new_file_created = True;
- }
-
set_share_mode(lck, fsp, get_current_uid(conn),
req ? req->mid : 0,
fsp->oplock_type);
@@ -2427,6 +2423,12 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
fsp->initial_delete_on_close = True;
}
+ if (info == FILE_WAS_OVERWRITTEN
+ || info == FILE_WAS_CREATED
+ || info == FILE_WAS_SUPERSEDED) {
+ new_file_created = True;
+ }
+
if (new_file_created) {
/* Files should be initially set as archive */
if (lp_map_archive(SNUM(conn)) ||