View Issue Details

IDProjectCategoryView StatusLast Update
0003311Far ManagerFile Systempublic2016-09-26 18:28
ReporterpepakAssigned ToDrKnS 
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version3.0 
Target VersionFixed in Version3.0 
Summary0003311: Incorrect QueryDosDevice call in MatchNtPathRoot (pathmix.cpp)
DescriptionMatchNtPathRoot calls QueryDosDevice to convert a DOS drive letter to NT device name. Unfortunately, when called from internalNtQueryGetFinalPathNameByHandle (farwinapi.cpp), the device name takes the form of "C:\" in direct violation of QueryDosDevice requirements:

   The device name cannot have a trailing backslash; for example, use "C:", not "C:\".
   [ https://msdn.microsoft.com/en-us/library/windows/desktop/aa365461(v=vs.85).aspx ]

This causes ConvertNameToReal (cvtname.cpp) to fail to convert most junctions*) to their proper real names, which in turn leads to ScanTree::GetNextName (scantree.cpp) to silently skip these junctions in any operation which uses the FSCANTREE_SCANSYMLINK flag. Which can easily lead to the loss of data when performing e.g. a copy with "Copy contents of symbolic links" activated.

*) Some get converted through a workaround by replacing certain \Device\something names directly.
Steps To Reproduce1) Create a HDD-like ramdisk with ImDisk ( http://www.ltr-data.se/opencode.html/ ) as X:
2) Create a folder X:\Test and file (any content X:\Test\Test.txt).
3) Create a folder C:\Test.
4) Create junction to X:\Test in C:\Test under the name of Junction.
5) Attempt to copy C:\Test to C:\Test2 with "Copy contents of symbolic links" activated.
6) Look into C:\Test2\Junction: There will be no Test.txt.
Additional InformationRelated to http://bugs.farmanager.com/view.php?id=3255 and required for its fix.
TagsNo tags attached.
Build4796

Activities

pepak

2016-09-24 16:58

reporter  

bug0003311.zip (6,569 bytes)

pepak

2016-09-24 16:59

reporter   bugnote:0014794

The attached file bug0003311.zip contains a proposed fix.

DrKnS

2016-09-25 20:09

administrator   bugnote:0014803

4796

pepak

2016-09-26 17:59

reporter   bugnote:0014810

Works for my test cases.

Issue History

Date Modified Username Field Change
2016-09-24 16:58 pepak New Issue
2016-09-24 16:58 pepak File Added: bug0003311.zip
2016-09-24 16:59 pepak Note Added: 0014794
2016-09-25 19:59 DrKnS Assigned To => DrKnS
2016-09-25 19:59 DrKnS Status new => assigned
2016-09-25 20:09 DrKnS Note Added: 0014803
2016-09-25 20:09 DrKnS Status assigned => feedback
2016-09-26 17:59 pepak Note Added: 0014810
2016-09-26 17:59 pepak Status feedback => assigned
2016-09-26 18:28 DrKnS Build => 4796
2016-09-26 18:28 DrKnS Status assigned => closed
2016-09-26 18:28 DrKnS Resolution open => fixed
2016-09-26 18:28 DrKnS Fixed in Version => 3.0