Remove FILEDosToUnixPathA conversion (#78995)
authorJan Vorlicek <janvorli@microsoft.com>
Fri, 2 Dec 2022 09:01:30 +0000 (10:01 +0100)
committerGitHub <noreply@github.com>
Fri, 2 Dec 2022 09:01:30 +0000 (10:01 +0100)
commit5df8e75ffeb67e49e097b38013de5b676ca24ba9
tree03792d02ae6d4d5b886723a3498d671ed442b020
parent09613f3ed6cb5ce62e955d2a1979115879d707bb
Remove FILEDosToUnixPathA conversion (#78995)

* Remove FILEDosToUnixPathA conversion

All file paths passed to the coreclr PAL are processed by this function
to convert backslash characters to forward ones. This is causing problems
when users have directories with names containing backslashes. Such
problems were recently reported by people.

This change removes the `FILEDosToUnixPathA` and fixes one PAL test and
one coreclr test that was passing backslash separated paths.

* Remove checks for `\` on Unix and some conversions

* Update runtime to use platform specific directory separator

* Revert changes at few places and remove some code for Unix

* Fix Bundle_Extraction_To_Relative_Path_Succeeds host test

Exclude the `foo\\bar` case for non-Windows.
47 files changed:
src/coreclr/debug/daccess/request.cpp
src/coreclr/ildasm/dis.cpp
src/coreclr/ildasm/dman.cpp
src/coreclr/inc/longfilepathwrappers.h
src/coreclr/inc/nsutilpriv.h
src/coreclr/inc/winwrap.h
src/coreclr/jit/error.cpp
src/coreclr/jit/importer.cpp
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.NativeAot.Unix.cs
src/coreclr/pal/inc/mbusafecrt.h
src/coreclr/pal/inc/rt/safecrt.h
src/coreclr/pal/src/CMakeLists.txt
src/coreclr/pal/src/cruntime/file.cpp
src/coreclr/pal/src/file/directory.cpp
src/coreclr/pal/src/file/file.cpp
src/coreclr/pal/src/file/find.cpp
src/coreclr/pal/src/file/path.cpp
src/coreclr/pal/src/include/pal/file.h
src/coreclr/pal/src/include/pal/file.hpp
src/coreclr/pal/src/include/pal/stackstring.hpp
src/coreclr/pal/src/loader/module.cpp
src/coreclr/pal/src/safecrt/tmakepath_s.inl
src/coreclr/pal/src/safecrt/tsplitpath_s.inl
src/coreclr/pal/src/safecrt/wsplitpath_s.cpp [deleted file]
src/coreclr/pal/src/thread/process.cpp
src/coreclr/pal/tests/palsuite/common/palsuite.cpp
src/coreclr/pal/tests/palsuite/file_io/GetFullPathNameA/test3/test3.cpp
src/coreclr/pal/tests/palsuite/file_io/GetFullPathNameW/test2/test2.cpp
src/coreclr/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp
src/coreclr/tools/metainfo/mdobj.cpp
src/coreclr/tools/superpmi/mcs/verbmerge.cpp
src/coreclr/tools/superpmi/superpmi-shared/standardpch.h
src/coreclr/tools/superpmi/superpmi/jitdebugger.cpp
src/coreclr/utilcode/longfilepathwrappers.cpp
src/coreclr/utilcode/splitpath.cpp
src/coreclr/vm/clrex.cpp
src/coreclr/vm/codeman.cpp
src/coreclr/vm/eeconfig.cpp
src/coreclr/vm/gdbjit.cpp
src/coreclr/vm/multicorejit.cpp
src/coreclr/vm/peassembly.cpp
src/coreclr/vm/peimage.cpp
src/coreclr/vm/peimage.inl
src/coreclr/vm/stubgen.cpp
src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleExtractToSpecificPath.cs
src/libraries/System.Runtime/tests/System/Type/TypeTests.cs
src/tests/Loader/CollectibleAssemblies/ResolvedFromDifferentContext/ResolvedFromDifferentContext.cs