From: Ralph Boehme Date: Mon, 23 Sep 2019 22:16:58 +0000 (-0700) Subject: s3:smbd: when storing DOS attribute call dos_mode() beforehand X-Git-Tag: talloc-2.3.1~533 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49a754b82d33fb523cda4151a865584ae52a2e2f;p=thirdparty%2Fsamba.git s3:smbd: when storing DOS attribute call dos_mode() beforehand This is required to ensure File-ID info is populated with the correct on-disk value, before calling file_set_dosmode() which will update the on-disk value. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/selftest/knownfail.d/samba3.smb2.fileid b/selftest/knownfail.d/samba3.smb2.fileid index bdf86ac61b1..89455dacdf0 100644 --- a/selftest/knownfail.d/samba3.smb2.fileid +++ b/selftest/knownfail.d/samba3.smb2.fileid @@ -1,2 +1 @@ ^samba3.smb2.fileid.fileid\(nt4_dc\) -^samba3.smb2.fileid.fileid-dir\(nt4_dc\) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 20b5a3e294c..061f16a0ebe 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -3953,6 +3953,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, /* Overwritten files should be initially set as archive */ if ((info == FILE_WAS_OVERWRITTEN && lp_map_archive(SNUM(conn))) || lp_store_dos_attributes(SNUM(conn))) { + (void)dos_mode(conn, smb_fname); if (!posix_open) { if (file_set_dosmode(conn, smb_fname, new_dos_attributes | FILE_ATTRIBUTE_ARCHIVE,