From b97cce5ef1d684f8f7beae7bcbc5b54ee2727a96 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Wed, 5 Aug 2026 14:04:41 +0100 Subject: [PATCH] review fixes --- src/SharpCompress/Common/DirectoryManagement.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/SharpCompress/Common/DirectoryManagement.cs b/src/SharpCompress/Common/DirectoryManagement.cs index 0bf1a013..d9a53f95 100644 --- a/src/SharpCompress/Common/DirectoryManagement.cs +++ b/src/SharpCompress/Common/DirectoryManagement.cs @@ -10,7 +10,7 @@ internal static class DirectoryManagement internal const string WriteFileOutsideDestinationMessage = "Entry is trying to write a file outside of the destination directory."; internal const string LinkTargetOutsideDestinationMessage = - "Entry is trying to create a symbolic link outside of the destination directory."; + "Entry is trying to create a symbolic link whose target is outside of the destination directory."; internal const string ReparsePointInDestinationMessage = "Entry is trying to extract through a symbolic link or reparse point."; @@ -133,6 +133,11 @@ internal static class DirectoryManagement internal static void EnsurePathIsNotReparsePoint(string path) { + var destinationDirectory = Path.GetDirectoryName(path); + if (destinationDirectory is not null) + { + PathExistsAndIsNotReparsePoint(destinationDirectory); + } PathExistsAndIsNotReparsePoint(path); }