From: Ralph Boehme Date: Sun, 21 Aug 2022 11:39:02 +0000 (+0200) Subject: smbd: update smb_fname->st btime with the rounded value with NTTIME granularity X-Git-Tag: talloc-2.4.0~1237 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9da1e7a4041a9f4258e23e70230bd75c60c55490;p=thirdparty%2Fsamba.git smbd: update smb_fname->st btime with the rounded value with NTTIME granularity BUG: https://bugzilla.samba.org/show_bug.cgi?id=14215 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 6fd11b492e8..a16d6ec7c90 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -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,