From: Jose A. Rivera Date: Thu, 4 Feb 2016 02:58:19 +0000 (-0600) Subject: s3:smbd:open: Skip redundant call to file_set_dosmode when creating a new file. X-Git-Tag: tevent-0.9.27~73 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aec07b8b60ff9589a3c84eef6adeca464e6c01f6;p=thirdparty%2Fsamba.git s3:smbd:open: Skip redundant call to file_set_dosmode when creating a new file. Signed-off-by: Jose A. Rivera Pair-programmed-with: Ira Cooper Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Feb 5 04:37:43 CET 2016 on sn-devel-144 --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index ed0594b1756..fa817e44563 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -3169,8 +3169,8 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, } if (info != FILE_WAS_OPENED) { - /* Files should be initially set as archive */ - if (lp_map_archive(SNUM(conn)) || + /* Overwritten files should be initially set as archive */ + if ((info == FILE_WAS_OVERWRITTEN && lp_map_archive(SNUM(conn))) || lp_store_dos_attributes(SNUM(conn))) { if (!posix_open) { if (file_set_dosmode(conn, smb_fname,