From: Jeremy Allison Date: Fri, 18 Mar 2022 18:41:48 +0000 (-0700) Subject: s3: smbd: In set_ea_dos_attribute(), if we've stored btime and set XATTR_DOSINFO_CREA... X-Git-Tag: tevent-0.12.0~276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fc0820afcd375594b1d99edcd651420bea6ac91;p=thirdparty%2Fsamba.git s3: smbd: In set_ea_dos_attribute(), if we've stored btime and set XATTR_DOSINFO_CREATE_TIME successfully, we need to clear ST_EX_IFLAG_CALCULATED_BTIME. This is no longer a calculated field, every call to fdos_mode() will set it as non-calculated. https://bugzilla.samba.org/show_bug.cgi?id=15022 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 968fd0fd07f..2f45d68ca52 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -529,6 +529,17 @@ NTSTATUS set_ea_dos_attribute(connection_struct *conn, return status; } } + + /* + * We correctly stored the create time. + * We *always* set XATTR_DOSINFO_CREATE_TIME, + * so now it can no longer be considered + * calculated. + */ + update_stat_ex_create_time( + &smb_fname->fsp->fsp_name->st, + smb_fname->st.st_ex_btime); + DEBUG(10,("set_ea_dos_attribute: set EA 0x%x on file %s\n", (unsigned int)dosmode, smb_fname_str_dbg(smb_fname)));