https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2b4d5c5cffe649845f552440a076b269a0aec339

commit 2b4d5c5cffe649845f552440a076b269a0aec339
Author: Pierre Schweitzer <[email protected]>
AuthorDate: Mon Jan 1 14:29:15 2018 +0100

    [FASTFAT] When overwriting a file with FILE_OVERWRITE*, don't erase 
previous file attributes, only update them.
    Keep erasing them in case the file gets overwritten with FILE_SUPERSEDE.
    
    CORE-14158
---
 drivers/filesystems/fastfat/create.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/filesystems/fastfat/create.c 
b/drivers/filesystems/fastfat/create.c
index 89ac5e07c4..49c54207cd 100644
--- a/drivers/filesystems/fastfat/create.c
+++ b/drivers/filesystems/fastfat/create.c
@@ -919,7 +919,14 @@ VfatCreateFile(
 
             if (!vfatFCBIsDirectory(pFcb))
             {
-                *pFcb->Attributes = Attributes & ~FILE_ATTRIBUTE_NORMAL;
+                if (RequestedDisposition == FILE_SUPERSEDE)
+                {
+                    *pFcb->Attributes = Attributes & ~FILE_ATTRIBUTE_NORMAL;
+                }
+                else
+                {
+                    *pFcb->Attributes |= Attributes & ~FILE_ATTRIBUTE_NORMAL;
+                }
                 *pFcb->Attributes |= FILE_ATTRIBUTE_ARCHIVE;
                 VfatUpdateEntry(pFcb, vfatVolumeIsFatX(DeviceExt));
             }

Reply via email to