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)
committerJeremy Allison <jra@samba.org>
Fri, 5 Feb 2016 03:37:43 +0000 (04:37 +0100)
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

source3/smbd/open.c

index ed0594b1756affdbaefc48bc98a0c6b9bde8b839..fa817e445639a52882c7f2e50d02c087b6237998 100644 (file)
@@ -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,