From 16270cd8aea06263057824472a451eea6f3d4d3f Mon Sep 17 00:00:00 2001 From: Steve Berdy <86739818+steveberdy@users.noreply.github.com> Date: Thu, 8 Jul 2021 16:47:25 -0400 Subject: [PATCH 1/9] Update Path.Windows.cs --- .../src/System/IO/Path.Windows.cs | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs index 5f4b8e11a1920..95b625e88e2d2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs @@ -49,17 +49,8 @@ public static string GetFullPath(string path) // unpredictable results. if (path.Contains('\0')) throw new ArgumentException(SR.Argument_InvalidPathChars, nameof(path)); - - if (PathInternal.IsExtended(path.AsSpan())) - { - // \\?\ paths are considered normalized by definition. Windows doesn't normalize \\?\ - // paths and neither should we. Even if we wanted to GetFullPathName does not work - // properly with device paths. If one wants to pass a \\?\ path through normalization - // one can chop off the prefix, pass it to GetFullPath and add it again. - return path; - } - - return PathHelper.Normalize(path); + + return GetFullQualifiedPath(path); } public static string GetFullPath(string path, string basePath) @@ -77,7 +68,7 @@ public static string GetFullPath(string path, string basePath) throw new ArgumentException(SR.Argument_InvalidPathChars); if (IsPathFullyQualified(path)) - return GetFullPath(path); + return GetFullQualifiedPath(path); if (PathInternal.IsEffectivelyEmpty(path.AsSpan())) return basePath; @@ -129,7 +120,21 @@ public static string GetFullPath(string path, string basePath) return PathInternal.IsDevice(combinedPath.AsSpan()) ? PathInternal.RemoveRelativeSegments(combinedPath, PathInternal.GetRootLength(combinedPath.AsSpan())) - : GetFullPath(combinedPath); + : GetFullQualifiedPath(combinedPath); + } + + private static string GetFullQualifiedPath(string path) + { + if (PathInternal.IsExtended(path.AsSpan())) + { + // \\?\ paths are considered normalized by definition. Windows doesn't normalize \\?\ + // paths and neither should we. Even if we wanted to GetFullPathName does not work + // properly with device paths. If one wants to pass a \\?\ path through normalization + // one can chop off the prefix, pass it to GetFullPath and add it again. + return path; + } + + return PathHelper.Normalize(path); } public static string GetTempPath() From ce6bfd26b32b71c2460088a79c3b2cdc7360e14a Mon Sep 17 00:00:00 2001 From: Steve Berdy <86739818+steveberdy@users.noreply.github.com> Date: Fri, 9 Jul 2021 08:18:11 -0400 Subject: [PATCH 2/9] Change helper method to internal Switched method from a private protection level to an internal protection level. Also removed trailing whitespace. --- .../System.Private.CoreLib/src/System/IO/Path.Windows.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs index 95b625e88e2d2..6737ffbc357b2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs @@ -49,7 +49,7 @@ public static string GetFullPath(string path) // unpredictable results. if (path.Contains('\0')) throw new ArgumentException(SR.Argument_InvalidPathChars, nameof(path)); - + return GetFullQualifiedPath(path); } @@ -122,8 +122,8 @@ public static string GetFullPath(string path, string basePath) ? PathInternal.RemoveRelativeSegments(combinedPath, PathInternal.GetRootLength(combinedPath.AsSpan())) : GetFullQualifiedPath(combinedPath); } - - private static string GetFullQualifiedPath(string path) + + internal static string GetFullQualifiedPath(string path) { if (PathInternal.IsExtended(path.AsSpan())) { From b88008d56cac7b8dc22e812e761cd68ccb853fc6 Mon Sep 17 00:00:00 2001 From: Steve Berdy Date: Wed, 14 Jul 2021 12:48:36 -0400 Subject: [PATCH 3/9] Removed sourceFullPath from Unix FileSystem.MoveDirectory thrown exception --- .../src/System/IO/Directory.cs | 2 +- .../src/System/IO/FileSystem.Unix.cs | 4 ++-- .../src/System/IO/FileSystem.Windows.cs | 23 ++++++++++--------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Directory.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Directory.cs index f6bc4f42b064d..9768c16248dfd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Directory.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Directory.cs @@ -288,7 +288,7 @@ public static void Move(string sourceDirName, string destDirName) if (!FileSystem.DirectoryExists(fullsourceDirName) && !FileSystem.FileExists(fullsourceDirName)) throw new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, fullsourceDirName)); - if (!sameDirectoryDifferentCase // This check is to allowing renaming of directories + if (!sameDirectoryDifferentCase // This check is to allow renaming of directories && FileSystem.DirectoryExists(fulldestDirName)) throw new IOException(SR.Format(SR.IO_AlreadyExists_Name, fulldestDirName)); diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs index 0151499893aa8..43111fb81ae01 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs @@ -380,7 +380,7 @@ public static void MoveDirectory(string sourceFullPath, string destFullPath) // On Windows we end up with ERROR_INVALID_NAME, which is // "The filename, directory name, or volume label syntax is incorrect." // - // This surfaces as a IOException, if we let it go beyond here it would + // This surfaces as an IOException, if we let it go beyond here it would // give DirectoryNotFound. if (Path.EndsInDirectorySeparator(sourceFullPath)) @@ -405,7 +405,7 @@ public static void MoveDirectory(string sourceFullPath, string destFullPath) case Interop.Error.EACCES: // match Win32 exception throw new IOException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, sourceFullPath), errorInfo.RawErrno); default: - throw Interop.GetExceptionForIoErrno(errorInfo, sourceFullPath, isDirectory: true); + throw Interop.GetExceptionForIoErrno(errorInfo, isDirectory: true); } } } diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.cs index 5f88f53a7c539..43a5084e1765d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.cs @@ -123,17 +123,18 @@ public static void MoveDirectory(string sourceFullPath, string destFullPath) { int errorCode = Marshal.GetLastWin32Error(); - if (errorCode == Interop.Errors.ERROR_FILE_NOT_FOUND) - throw Win32Marshal.GetExceptionForWin32Error(Interop.Errors.ERROR_PATH_NOT_FOUND, sourceFullPath); - - if (errorCode == Interop.Errors.ERROR_ALREADY_EXISTS) - throw Win32Marshal.GetExceptionForWin32Error(Interop.Errors.ERROR_ALREADY_EXISTS, destFullPath); - - // This check was originally put in for Win9x (unfortunately without special casing it to be for Win9x only). We can't change the NT codepath now for backcomp reasons. - if (errorCode == Interop.Errors.ERROR_ACCESS_DENIED) // WinNT throws IOException. This check is for Win9x. We can't change it for backcomp. - throw new IOException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, sourceFullPath), Win32Marshal.MakeHRFromErrorCode(errorCode)); - - throw Win32Marshal.GetExceptionForWin32Error(errorCode); + switch (errorCode) + { + case Interop.Errors.ERROR_FILE_NOT_FOUND: + throw Win32Marshal.GetExceptionForWin32Error(Interop.Errors.ERROR_PATH_NOT_FOUND, sourceFullPath); + case Interop.Errors.ERROR_ALREADY_EXISTS: + throw Win32Marshal.GetExceptionForWin32Error(Interop.Errors.ERROR_ALREADY_EXISTS, destFullPath); + // This check was originally put in for Win9x (unfortunately without special casing it to be for Win9x only). We can't change the NT codepath now for backcomp reasons. + case Interop.Errors.ERROR_ACCESS_DENIED: // WinNT throws IOException. This check is for Win9x. We can't change it for backcomp. + throw new IOException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, sourceFullPath), Win32Marshal.MakeHRFromErrorCode(errorCode)); + default: + throw Win32Marshal.GetExceptionForWin32Error(errorCode); + } } } From 7890ab49908128578d392632fe5edadc61568dd9 Mon Sep 17 00:00:00 2001 From: Steve Berdy Date: Wed, 14 Jul 2021 12:55:46 -0400 Subject: [PATCH 4/9] Undo commit from main fork branch --- .../src/System/IO/Path.Windows.cs | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs index 6737ffbc357b2..5f4b8e11a1920 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs @@ -50,7 +50,16 @@ public static string GetFullPath(string path) if (path.Contains('\0')) throw new ArgumentException(SR.Argument_InvalidPathChars, nameof(path)); - return GetFullQualifiedPath(path); + if (PathInternal.IsExtended(path.AsSpan())) + { + // \\?\ paths are considered normalized by definition. Windows doesn't normalize \\?\ + // paths and neither should we. Even if we wanted to GetFullPathName does not work + // properly with device paths. If one wants to pass a \\?\ path through normalization + // one can chop off the prefix, pass it to GetFullPath and add it again. + return path; + } + + return PathHelper.Normalize(path); } public static string GetFullPath(string path, string basePath) @@ -68,7 +77,7 @@ public static string GetFullPath(string path, string basePath) throw new ArgumentException(SR.Argument_InvalidPathChars); if (IsPathFullyQualified(path)) - return GetFullQualifiedPath(path); + return GetFullPath(path); if (PathInternal.IsEffectivelyEmpty(path.AsSpan())) return basePath; @@ -120,21 +129,7 @@ public static string GetFullPath(string path, string basePath) return PathInternal.IsDevice(combinedPath.AsSpan()) ? PathInternal.RemoveRelativeSegments(combinedPath, PathInternal.GetRootLength(combinedPath.AsSpan())) - : GetFullQualifiedPath(combinedPath); - } - - internal static string GetFullQualifiedPath(string path) - { - if (PathInternal.IsExtended(path.AsSpan())) - { - // \\?\ paths are considered normalized by definition. Windows doesn't normalize \\?\ - // paths and neither should we. Even if we wanted to GetFullPathName does not work - // properly with device paths. If one wants to pass a \\?\ path through normalization - // one can chop off the prefix, pass it to GetFullPath and add it again. - return path; - } - - return PathHelper.Normalize(path); + : GetFullPath(combinedPath); } public static string GetTempPath() From 208b9f4d69ca573837613d2ddacb7330a932a04d Mon Sep 17 00:00:00 2001 From: Steve Berdy Date: Thu, 15 Jul 2021 08:17:11 -0400 Subject: [PATCH 5/9] Revert FileSystem.Windows.cs changes --- .../src/System/IO/FileSystem.Windows.cs | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.cs index 43a5084e1765d..5f88f53a7c539 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.cs @@ -123,18 +123,17 @@ public static void MoveDirectory(string sourceFullPath, string destFullPath) { int errorCode = Marshal.GetLastWin32Error(); - switch (errorCode) - { - case Interop.Errors.ERROR_FILE_NOT_FOUND: - throw Win32Marshal.GetExceptionForWin32Error(Interop.Errors.ERROR_PATH_NOT_FOUND, sourceFullPath); - case Interop.Errors.ERROR_ALREADY_EXISTS: - throw Win32Marshal.GetExceptionForWin32Error(Interop.Errors.ERROR_ALREADY_EXISTS, destFullPath); - // This check was originally put in for Win9x (unfortunately without special casing it to be for Win9x only). We can't change the NT codepath now for backcomp reasons. - case Interop.Errors.ERROR_ACCESS_DENIED: // WinNT throws IOException. This check is for Win9x. We can't change it for backcomp. - throw new IOException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, sourceFullPath), Win32Marshal.MakeHRFromErrorCode(errorCode)); - default: - throw Win32Marshal.GetExceptionForWin32Error(errorCode); - } + if (errorCode == Interop.Errors.ERROR_FILE_NOT_FOUND) + throw Win32Marshal.GetExceptionForWin32Error(Interop.Errors.ERROR_PATH_NOT_FOUND, sourceFullPath); + + if (errorCode == Interop.Errors.ERROR_ALREADY_EXISTS) + throw Win32Marshal.GetExceptionForWin32Error(Interop.Errors.ERROR_ALREADY_EXISTS, destFullPath); + + // This check was originally put in for Win9x (unfortunately without special casing it to be for Win9x only). We can't change the NT codepath now for backcomp reasons. + if (errorCode == Interop.Errors.ERROR_ACCESS_DENIED) // WinNT throws IOException. This check is for Win9x. We can't change it for backcomp. + throw new IOException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, sourceFullPath), Win32Marshal.MakeHRFromErrorCode(errorCode)); + + throw Win32Marshal.GetExceptionForWin32Error(errorCode); } } From d2fd7ec71d289afda2a8f294b418ec7631e8eb9e Mon Sep 17 00:00:00 2001 From: Steve Berdy <86739818+steveberdy@users.noreply.github.com> Date: Thu, 15 Jul 2021 14:07:09 -0400 Subject: [PATCH 6/9] Update ZipFile.Extract.cs --- .../src/System/IO/Compression/ZipFile.Extract.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.cs index 50e1717fc08a8..89ead8b0171c0 100644 --- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.cs +++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.cs @@ -28,8 +28,7 @@ public static partial class ZipFile /// and file names must be less than 260 characters. /// The path specified by sourceArchive or destinationDirectoryName is invalid, /// (for example, it is on an unmapped drive). - /// The directory specified by destinationDirectoryName already exists. - /// -or- An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or + /// An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or /// more invalid characters as defined by InvalidPathChars. -or- Extracting an archive entry would result in a file destination that is outside the destination directory (for example, because of parent directory accessors). -or- An archive entry has the same name as an already extracted entry from the same archive. /// The caller does not have the required permission. /// sourceArchive or destinationDirectoryName is in an invalid format. @@ -61,8 +60,7 @@ public static void ExtractToDirectory(string sourceArchiveFileName, string desti /// and file names must be less than 260 characters. /// The path specified by sourceArchive or destinationDirectoryName is invalid, /// (for example, it is on an unmapped drive). - /// The directory specified by destinationDirectoryName already exists. - /// -or- An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or + /// An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or /// more invalid characters as defined by InvalidPathChars. -or- Extracting an archive entry would result in a file destination that is outside the destination directory (for example, because of parent directory accessors). -or- An archive entry has the same name as an already extracted entry from the same archive. /// The caller does not have the required permission. /// sourceArchive or destinationDirectoryName is in an invalid format. @@ -95,8 +93,7 @@ public static void ExtractToDirectory(string sourceArchiveFileName, string desti /// and file names must be less than 260 characters. /// The path specified by sourceArchive or destinationDirectoryName is invalid, /// (for example, it is on an unmapped drive). - /// The directory specified by destinationDirectoryName already exists. - /// -or- An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or + /// An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or /// more invalid characters as defined by InvalidPathChars. -or- Extracting an archive entry would result in a file destination that is outside the destination directory (for example, because of parent directory accessors). -or- An archive entry has the same name as an already extracted entry from the same archive. /// The caller does not have the required permission. /// sourceArchive or destinationDirectoryName is in an invalid format. @@ -150,8 +147,7 @@ public static void ExtractToDirectory(string sourceArchiveFileName, string desti /// and file names must be less than 260 characters. /// The path specified by sourceArchive or destinationDirectoryName is invalid, /// (for example, it is on an unmapped drive). - /// The directory specified by destinationDirectoryName already exists. - /// -or- An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or + /// An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or /// more invalid characters as defined by InvalidPathChars. -or- Extracting an archive entry would result in a file destination that is outside the destination directory (for example, because of parent directory accessors). -or- An archive entry has the same name as an already extracted entry from the same archive. /// The caller does not have the required permission. /// sourceArchive or destinationDirectoryName is in an invalid format. From 30775437200ddc0c47b064dbbeb507b70847d3cb Mon Sep 17 00:00:00 2001 From: Steve Berdy <86739818+steveberdy@users.noreply.github.com> Date: Thu, 15 Jul 2021 14:08:59 -0400 Subject: [PATCH 7/9] Update ZipFileExtensions.ZipArchiveEntry.Extract.cs --- .../ZipFileExtensions.ZipArchiveEntry.Extract.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.cs index a74aca915faaf..34c7ecd2e49cc 100644 --- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.cs +++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.cs @@ -19,8 +19,7 @@ public static partial class ZipFileExtensions /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. /// The path specified in destinationFileName is invalid (for example, it is on /// an unmapped drive). - /// destinationFileName already exists. - /// -or- An I/O error has occurred. -or- The entry is currently open for writing. + /// An I/O error has occurred. -or- The entry is currently open for writing. /// -or- The entry has been deleted from the archive. /// destinationFileName is in an invalid format /// -or- The ZipArchive that this entry belongs to was opened in a write-only mode. @@ -48,8 +47,7 @@ public static void ExtractToFile(this ZipArchiveEntry source, string destination /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. /// The path specified in destinationFileName is invalid /// (for example, it is on an unmapped drive). - /// destinationFileName exists and overwrite is false. - /// -or- An I/O error has occurred. + /// An I/O error has occurred. /// -or- The entry is currently open for writing. /// -or- The entry has been deleted from the archive. /// destinationFileName is in an invalid format From 018a2cacea358f4770f72ba2e68b9708c34cbaec Mon Sep 17 00:00:00 2001 From: Steve Berdy Date: Thu, 15 Jul 2021 14:49:27 -0400 Subject: [PATCH 8/9] Revert "Removed sourceFullPath from Unix FileSystem.MoveDirectory thrown exception" This reverts commit b88008d56cac7b8dc22e812e761cd68ccb853fc6. --- .../System.Private.CoreLib/src/System/IO/Directory.cs | 2 +- .../System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Directory.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Directory.cs index a30543ced5933..ac61bac5226c4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Directory.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Directory.cs @@ -288,7 +288,7 @@ public static void Move(string sourceDirName, string destDirName) if (!FileSystem.DirectoryExists(fullsourceDirName) && !FileSystem.FileExists(fullsourceDirName)) throw new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, fullsourceDirName)); - if (!sameDirectoryDifferentCase // This check is to allow renaming of directories + if (!sameDirectoryDifferentCase // This check is to allowing renaming of directories && FileSystem.DirectoryExists(fulldestDirName)) throw new IOException(SR.Format(SR.IO_AlreadyExists_Name, fulldestDirName)); diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs index 43111fb81ae01..0151499893aa8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs @@ -380,7 +380,7 @@ public static void MoveDirectory(string sourceFullPath, string destFullPath) // On Windows we end up with ERROR_INVALID_NAME, which is // "The filename, directory name, or volume label syntax is incorrect." // - // This surfaces as an IOException, if we let it go beyond here it would + // This surfaces as a IOException, if we let it go beyond here it would // give DirectoryNotFound. if (Path.EndsInDirectorySeparator(sourceFullPath)) @@ -405,7 +405,7 @@ public static void MoveDirectory(string sourceFullPath, string destFullPath) case Interop.Error.EACCES: // match Win32 exception throw new IOException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, sourceFullPath), errorInfo.RawErrno); default: - throw Interop.GetExceptionForIoErrno(errorInfo, isDirectory: true); + throw Interop.GetExceptionForIoErrno(errorInfo, sourceFullPath, isDirectory: true); } } } From 514ed373d34da24b7b34c9125d3b0d5eeae9d67a Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Sat, 24 Jul 2021 00:58:42 -0400 Subject: [PATCH 9/9] Fix badly encoded character in comments --- .../src/System/IO/Compression/ZipFile.Extract.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.cs index 89ead8b0171c0..eb908ed66f017 100644 --- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.cs +++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.cs @@ -28,7 +28,7 @@ public static partial class ZipFile /// and file names must be less than 260 characters. /// The path specified by sourceArchive or destinationDirectoryName is invalid, /// (for example, it is on an unmapped drive). - /// An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or + /// An I/O error has occurred. -or- An archive entry's name is zero-length, contains only whitespace, or contains one or /// more invalid characters as defined by InvalidPathChars. -or- Extracting an archive entry would result in a file destination that is outside the destination directory (for example, because of parent directory accessors). -or- An archive entry has the same name as an already extracted entry from the same archive. /// The caller does not have the required permission. /// sourceArchive or destinationDirectoryName is in an invalid format. @@ -60,7 +60,7 @@ public static void ExtractToDirectory(string sourceArchiveFileName, string desti /// and file names must be less than 260 characters. /// The path specified by sourceArchive or destinationDirectoryName is invalid, /// (for example, it is on an unmapped drive). - /// An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or + /// An I/O error has occurred. -or- An archive entry's name is zero-length, contains only whitespace, or contains one or /// more invalid characters as defined by InvalidPathChars. -or- Extracting an archive entry would result in a file destination that is outside the destination directory (for example, because of parent directory accessors). -or- An archive entry has the same name as an already extracted entry from the same archive. /// The caller does not have the required permission. /// sourceArchive or destinationDirectoryName is in an invalid format. @@ -93,7 +93,7 @@ public static void ExtractToDirectory(string sourceArchiveFileName, string desti /// and file names must be less than 260 characters. /// The path specified by sourceArchive or destinationDirectoryName is invalid, /// (for example, it is on an unmapped drive). - /// An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or + /// An I/O error has occurred. -or- An archive entry's name is zero-length, contains only whitespace, or contains one or /// more invalid characters as defined by InvalidPathChars. -or- Extracting an archive entry would result in a file destination that is outside the destination directory (for example, because of parent directory accessors). -or- An archive entry has the same name as an already extracted entry from the same archive. /// The caller does not have the required permission. /// sourceArchive or destinationDirectoryName is in an invalid format. @@ -147,7 +147,7 @@ public static void ExtractToDirectory(string sourceArchiveFileName, string desti /// and file names must be less than 260 characters. /// The path specified by sourceArchive or destinationDirectoryName is invalid, /// (for example, it is on an unmapped drive). - /// An I/O error has occurred. -or- An archive entry?s name is zero-length, contains only whitespace, or contains one or + /// An I/O error has occurred. -or- An archive entry's name is zero-length, contains only whitespace, or contains one or /// more invalid characters as defined by InvalidPathChars. -or- Extracting an archive entry would result in a file destination that is outside the destination directory (for example, because of parent directory accessors). -or- An archive entry has the same name as an already extracted entry from the same archive. /// The caller does not have the required permission. /// sourceArchive or destinationDirectoryName is in an invalid format.