summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2019-09-23 15:16:58 -0700
committerRalph Boehme <slow@samba.org>2019-10-02 08:01:39 +0000
commit49a754b82d33fb523cda4151a865584ae52a2e2f (patch)
treec02dd97822205af019621203cdeb74a126570c57
parente1dfaa2b038d91e43d8d34bf1526b7728dba58a5 (diff)
downloadsamba-49a754b82d33fb523cda4151a865584ae52a2e2f.tar.gz
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 <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--selftest/knownfail.d/samba3.smb2.fileid1
-rw-r--r--source3/smbd/open.c1
2 files changed, 1 insertions, 1 deletions
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,