]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: mark itime non-calculated if we created a file or dir
authorRalph Boehme <slow@samba.org>
Wed, 26 Jun 2019 11:40:05 +0000 (13:40 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 1 Jul 2019 21:43:24 +0000 (21:43 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 411c917e55f7bbb1eb85a72b7eabcd9f6b350002..b86559ec4178fe33b78c051302cbcf22ba4d04a2 100644 (file)
@@ -3811,6 +3811,10 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                fsp->initial_delete_on_close = True;
        }
 
+       if (info == FILE_WAS_CREATED) {
+               smb_fname->st.st_ex_iflags &= ~ST_EX_IFLAG_CALCULATED_ITIME;
+       }
+
        if (info != FILE_WAS_OPENED) {
                /* Overwritten files should be initially set as archive */
                if ((info == FILE_WAS_OVERWRITTEN && lp_map_archive(SNUM(conn))) ||
@@ -3958,6 +3962,8 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
                return NT_STATUS_NOT_A_DIRECTORY;
        }
 
+       smb_dname->st.st_ex_iflags &= ~ST_EX_IFLAG_CALCULATED_ITIME;
+
        if (lp_store_dos_attributes(SNUM(conn))) {
                if (!posix_open) {
                        file_set_dosmode(conn, smb_dname,