summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-08-01 14:59:07 (GMT)
committerBrad King <brad.king@kitware.com>2022-08-01 14:59:20 (GMT)
commita4f1c0fac84aab713d89d842be244c7427e014bd (patch)
treecc6669051a3252fd99053fa1c9077f3142382cbe /Source
parentd5977ee359b9e5e733a748123e898b66c5f65cde (diff)
downloadCMake-a4f1c0fac84aab713d89d842be244c7427e014bd.zip
CMake-a4f1c0fac84aab713d89d842be244c7427e014bd.tar.gz
CMake-a4f1c0fac84aab713d89d842be244c7427e014bd.tar.bz2
Windows: Revert "Prefer junctions for directory symlinks"
Revert commit 5101d586c4 (Windows: Prefer junctions for directory symlinks, 2022-02-22, v3.24.0-rc1~575^2). Junctions do not support `../` and other non-canonical paths. Revert their use pending further investigation. Fixes: #23781 Issue: #23257
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSystemTools.cxx14
1 files changed, 2 insertions, 12 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 78d3ad9..f077801 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -3358,22 +3358,12 @@ cmsys::Status cmSystemTools::CreateSymlink(std::string const& origName,
uv_fs_t req;
int flags = 0;
#if defined(_WIN32)
- bool const isDir = cmsys::SystemTools::FileIsDirectory(origName);
- if (isDir) {
- flags |= UV_FS_SYMLINK_JUNCTION;
+ if (cmsys::SystemTools::FileIsDirectory(origName)) {
+ flags |= UV_FS_SYMLINK_DIR;
}
#endif
int err = uv_fs_symlink(nullptr, &req, origName.c_str(), newName.c_str(),
flags, nullptr);
-#if defined(_WIN32)
- if (err && uv_fs_get_system_error(&req) == ERROR_NOT_SUPPORTED && isDir) {
- // Try fallback to symlink for network (requires additional permissions).
- flags ^= UV_FS_SYMLINK_JUNCTION | UV_FS_SYMLINK_DIR;
- err = uv_fs_symlink(nullptr, &req, origName.c_str(), newName.c_str(),
- flags, nullptr);
- }
-#endif
-
cmsys::Status status;
if (err) {
#if defined(_WIN32)