Author: pschweitzer
Date: Thu Sep 21 10:33:23 2017
New Revision: 75919
URL: http://svn.reactos.org/svn/reactos?rev=75919&view=rev
Log:
[FASTFAT]
Don't allow temporary attribute to be set on a directory.
Even though our FastFAT totally ignores such attribute, this is illegal on Windows and makes SetFileAttribute fail, so do the same.
CORE-13495
Modified:
trunk/reactos/drivers/filesystems/fastfat/finfo.c
Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] Thu Sep 21 10:33:23 2017
@@ -181,6 +181,12 @@
if (vfatFCBIsDirectory(FCB))
{
+ if (BooleanFlagOn(BasicInfo->FileAttributes, FILE_ATTRIBUTE_TEMPORARY))
+ {
+ DPRINT("Setting temporary attribute on a directory!\n");
+ return STATUS_INVALID_PARAMETER;
+ }
+
Attributes |= FILE_ATTRIBUTE_DIRECTORY;
}
else
Author: pschweitzer
Date: Wed Sep 20 08:45:28 2017
New Revision: 75911
URL: http://svn.reactos.org/svn/reactos?rev=75911&view=rev
Log:
[VFATLIB]
Fix a really bad bug in VfatChkdsk(), the routine used to check a volume:
In case readwrite is enabled (ie, volume fixing is allowed), when the volume is opened, it is also locked.
If the volume has the clean shutdown bit and is to be checked only if that one is not set, then the volume lock is leaked.
This makes the volume then totally unusable later on (any later open will fail).
Because r75772 fixed volume locking on non-system partition, this totally broke (access denied) any secondary FAT volume in ROS.
Now, we just properly release the lock when required, also made a comment more explicit to avoid later bugs like that.
CORE-13805
Modified:
trunk/reactos/sdk/lib/fslib/vfatlib/vfatlib.c
Modified: trunk/reactos/sdk/lib/fslib/vfatlib/vfatlib.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/fslib/vfatlib/vfat…
==============================================================================
--- trunk/reactos/sdk/lib/fslib/vfatlib/vfatlib.c [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/fslib/vfatlib/vfatlib.c [iso-8859-1] Wed Sep 20 08:45:28 2017
@@ -402,11 +402,15 @@
verify = TRUE;
salvage_files = TRUE;
- /* Open filesystem */
+ /* Open filesystem and lock it */
fs_open(DriveRoot, FsCheckFlags & FSCHECK_READ_WRITE);
if (CheckOnlyIfDirty && !fs_isdirty())
{
+ /* Unlock volume if required */
+ if (FsCheckFlags & FSCHECK_READ_WRITE)
+ fs_lock(FALSE);
+
/* No need to check FS */
return (fs_close(FALSE) == 0 ? STATUS_SUCCESS : STATUS_DISK_CORRUPT_ERROR);
}