s3:smbd: use xattr_DosInfo4 in set_ea_dos_attribute()
authorRalph Boehme <slow@samba.org>
Tue, 25 Jun 2019 12:26:10 +0000 (14:26 +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/dosmode.c

index 8e8d791cfe9be292ca6056fa11e23c3a42def268..d722c022fe93f033d58d4b783a5c85177bed2d95 100644 (file)
@@ -488,13 +488,19 @@ NTSTATUS set_ea_dos_attribute(connection_struct *conn,
        ZERO_STRUCT(dosattrib);
        ZERO_STRUCT(blob);
 
-       dosattrib.version = 3;
-       dosattrib.info.info3.valid_flags = XATTR_DOSINFO_ATTRIB|
+       dosattrib.version = 4;
+       dosattrib.info.info4.valid_flags = XATTR_DOSINFO_ATTRIB |
                                        XATTR_DOSINFO_CREATE_TIME;
-       dosattrib.info.info3.attrib = dosmode;
-       dosattrib.info.info3.create_time = unix_timespec_to_nt_time(
+       dosattrib.info.info4.attrib = dosmode;
+       dosattrib.info.info4.create_time = unix_timespec_to_nt_time(
                                smb_fname->st.st_ex_btime);
 
+       if (!(smb_fname->st.st_ex_iflags & ST_EX_IFLAG_CALCULATED_ITIME)) {
+               dosattrib.info.info4.valid_flags |= XATTR_DOSINFO_ITIME;
+               dosattrib.info.info4.itime = unix_timespec_to_nt_time(
+                       smb_fname->st.st_ex_itime);
+       }
+
        DEBUG(10,("set_ea_dos_attributes: set attribute 0x%x, btime = %s on file %s\n",
                (unsigned int)dosmode,
                time_to_asc(convert_timespec_to_time_t(smb_fname->st.st_ex_btime)),