From 8d0996fc4921261b3eb46b0351793f53e8e918f4 Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Fri, 30 Sep 2022 18:45:21 -0500 Subject: [PATCH] Make Symlink Target Canonical (#2563) --- src/AppInstallerCommonCore/Filesystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AppInstallerCommonCore/Filesystem.cpp b/src/AppInstallerCommonCore/Filesystem.cpp index 25d9bc2629..78ef9917c0 100644 --- a/src/AppInstallerCommonCore/Filesystem.cpp +++ b/src/AppInstallerCommonCore/Filesystem.cpp @@ -170,8 +170,8 @@ namespace AppInstaller::Filesystem bool VerifySymlink(const std::filesystem::path& symlink, const std::filesystem::path& target) { - const std::filesystem::path& symlinkTargetPath = std::filesystem::read_symlink(symlink); - return symlinkTargetPath == target; + const std::filesystem::path& symlinkTargetPath = std::filesystem::weakly_canonical(symlink); + return symlinkTargetPath == std::filesystem::weakly_canonical(target); } void AppendExtension(std::filesystem::path& target, const std::string& value)