]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: update smb_fname->st btime with the rounded value with NTTIME granularity
authorRalph Boehme <slow@samba.org>
Sun, 21 Aug 2022 11:39:02 +0000 (13:39 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 29 Aug 2022 17:22:32 +0000 (17:22 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14215

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/dosmode.c

index 6fd11b492e8969a6fc689479b3f49669c06a1466..a16d6ec7c90b51fd3c5a01036cf7b7b6162d4c13 100644 (file)
@@ -413,6 +413,7 @@ NTSTATUS set_ea_dos_attribute(connection_struct *conn,
        struct xattr_DOSATTRIB dosattrib;
        enum ndr_err_code ndr_err;
        DATA_BLOB blob;
+       struct timespec btime;
        int ret;
 
        if (!lp_store_dos_attributes(SNUM(conn))) {
@@ -515,11 +516,11 @@ NTSTATUS set_ea_dos_attribute(connection_struct *conn,
         * We correctly stored the create time.
         * We *always* set XATTR_DOSINFO_CREATE_TIME,
         * so now it can no longer be considered
-        * calculated.
+        * calculated. Make sure to use the value rounded
+        * to NTTIME granularity we've stored in the xattr.
         */
-       update_stat_ex_create_time(
-               &smb_fname->fsp->fsp_name->st,
-               smb_fname->st.st_ex_btime);
+       btime = nt_time_to_full_timespec(dosattrib.info.info5.create_time);
+       update_stat_ex_create_time(&smb_fname->st, btime);
 
        DEBUG(10,("set_ea_dos_attribute: set EA 0x%x on file %s\n",
                (unsigned int)dosmode,