s3:smbd: when storing DOS attribute call dos_mode() beforehand
authorRalph Boehme <slow@samba.org>
Mon, 23 Sep 2019 22:16:58 +0000 (15:16 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 2 Oct 2019 08:01:39 +0000 (08:01 +0000)
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>
selftest/knownfail.d/samba3.smb2.fileid
source3/smbd/open.c

index bdf86ac61b167209c014bc863981999bd07f3f28..89455dacdf0c59ea60aa1becf0468766a133c0f4 100644 (file)
@@ -1,2 +1 @@
 ^samba3.smb2.fileid.fileid\(nt4_dc\)
-^samba3.smb2.fileid.fileid-dir\(nt4_dc\)
index 20b5a3e294c9af766864103c255ad8474e44ba1f..061f16a0ebefa3158b048b66d064099d9065f855 100644 (file)
@@ -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,