s3:smbd:open: Skip redundant call to file_set_dosmode when creating a new file.
authorJose A. Rivera <jarrpa@samba.org>
Thu, 4 Feb 2016 02:58:19 +0000 (20:58 -0600)
committerKarolin Seeger <kseeger@samba.org>
Mon, 15 Feb 2016 10:24:23 +0000 (11:24 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11727

Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Pair-programmed-with: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Feb  5 04:37:43 CET 2016 on sn-devel-144

(cherry picked from commit aec07b8b60ff9589a3c84eef6adeca464e6c01f6)

source3/smbd/open.c

index 530c573b3da317d4027f7d5814e6b03924c6623a..eb6058f40b6a1418b48687fbc9c32541559dd98b 100644 (file)
@@ -3167,8 +3167,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,