From ce30a7ae7be70eb4cfac5454d453c32c71e4a5ed Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 15 Dec 2011 16:30:08 +0100 Subject: [PATCH] s3: Make open_file_ntcreate a bit easier to read Move the calculation of "new_file_created" closer to its use --- source3/smbd/open.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 4ea51dd4e9a..17d9f6f8fb6 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)) || -- 2.34.1