Skip to content

Commit dda6820

Browse files
Merge pull request #12029 from dotnet/main
Merge main into live
2 parents ab5621b + aa655bd commit dda6820

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

xml/System.Formats.Tar/TarFile.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@
224224
<summary>Extracts the contents of a stream that represents a tar archive into the specified directory.</summary>
225225
<remarks>
226226
<para>If a symbolic link or junction in the tar archive results in a file being extracted outside the specified <paramref name="destinationDirectoryName" />, an <see cref="T:System.IO.IOException" /> is thrown to ensure extraction remains within the same directory.</para>
227+
<para>If <paramref name="destinationDirectoryName" /> or any of its parent directories is a pre-existing junction or symbolic link, the link is followed and the extraction writes to the final target folder.</para>
227228
<para>Files of type <see cref="F:System.Formats.Tar.TarEntryType.BlockDevice" />, <see cref="F:System.Formats.Tar.TarEntryType.CharacterDevice" />, or <see cref="F:System.Formats.Tar.TarEntryType.Fifo" /> can only be extracted in Unix platforms.</para>
228229
<para>Elevation is required to extract a <see cref="F:System.Formats.Tar.TarEntryType.BlockDevice" /> or <see cref="F:System.Formats.Tar.TarEntryType.CharacterDevice" /> to disk.</para>
229230
</remarks>
@@ -275,6 +276,7 @@ Extracting one of the tar entries would have resulted in a file outside the spec
275276
<summary>Extracts the contents of a tar file into the specified directory.</summary>
276277
<remarks>
277278
<para>If a symbolic link or junction in the tar archive results in a file being extracted outside the specified <paramref name="destinationDirectoryName" />, an <see cref="T:System.IO.IOException" /> is thrown to ensure extraction remains within the same directory.</para>
279+
<para>If <paramref name="destinationDirectoryName" /> or any of its parent directories is a pre-existing junction or symbolic link, the link is followed and the extraction writes to the final target folder.</para>
278280
<para>Files of type <see cref="F:System.Formats.Tar.TarEntryType.BlockDevice" />, <see cref="F:System.Formats.Tar.TarEntryType.CharacterDevice" />, or <see cref="F:System.Formats.Tar.TarEntryType.Fifo" /> can only be extracted in Unix platforms.</para>
279281
<para>Elevation is required to extract a <see cref="F:System.Formats.Tar.TarEntryType.BlockDevice" /> or <see cref="F:System.Formats.Tar.TarEntryType.CharacterDevice" /> to disk.</para>
280282
</remarks>
@@ -325,6 +327,7 @@ Extracting one of the tar entries would have resulted in a file outside the spec
325327
<returns>A task that represents the asynchronous extraction operation.</returns>
326328
<remarks>
327329
<para>If a symbolic link or junction in the tar archive results in a file being extracted outside the specified <paramref name="destinationDirectoryName" />, an <see cref="T:System.IO.IOException" /> is thrown to ensure extraction remains within the same directory.</para>
330+
<para>If <paramref name="destinationDirectoryName" /> or any of its parent directories is a pre-existing junction or symbolic link, the link is followed and the extraction writes to the final target folder.</para>
328331
<para>Files of type <see cref="F:System.Formats.Tar.TarEntryType.BlockDevice" />, <see cref="F:System.Formats.Tar.TarEntryType.CharacterDevice" />, or <see cref="F:System.Formats.Tar.TarEntryType.Fifo" /> can only be extracted in Unix platforms.</para>
329332
<para>Elevation is required to extract a <see cref="F:System.Formats.Tar.TarEntryType.BlockDevice" /> or <see cref="F:System.Formats.Tar.TarEntryType.CharacterDevice" /> to disk.</para>
330333
<para>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:System.Formats.Tar.TarFile.ExtractToDirectory(System.IO.Stream,System.String,System.Boolean)" />.</para>
@@ -380,6 +383,7 @@ Extracting one of the tar entries would have resulted in a file outside the spec
380383
<returns>A task that represents the asynchronous extraction operation.</returns>
381384
<remarks>
382385
<para>If a symbolic link or junction in the tar archive results in a file being extracted outside the specified <paramref name="destinationDirectoryName" />, an <see cref="T:System.IO.IOException" /> is thrown to ensure extraction remains within the same directory.</para>
386+
<para>If <paramref name="destinationDirectoryName" /> or any of its parent directories is a pre-existing junction or symbolic link, the link is followed and the extraction writes to the final target folder.</para>
383387
<para>Files of type <see cref="F:System.Formats.Tar.TarEntryType.BlockDevice" />, <see cref="F:System.Formats.Tar.TarEntryType.CharacterDevice" />, or <see cref="F:System.Formats.Tar.TarEntryType.Fifo" /> can only be extracted in Unix platforms.</para>
384388
<para>Elevation is required to extract a <see cref="F:System.Formats.Tar.TarEntryType.BlockDevice" /> or <see cref="F:System.Formats.Tar.TarEntryType.CharacterDevice" /> to disk.</para>
385389
<para>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:System.Formats.Tar.TarFile.ExtractToDirectory(System.String,System.String,System.Boolean)" />.</para>

xml/System.IO.Compression/ZipFile.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,7 @@ An I/O error occurred while opening a file to be archived.</exception>
10221022
Exceptions related to validating the paths in the <paramref name="destinationDirectoryName" /> or the files in the zip archive contained in <paramref name="source" /> parameters are thrown before extraction. Otherwise, if an error occurs during extraction, the archive remains partially extracted.
10231023
Each extracted file has the same relative path to the directory specified by <paramref name="destinationDirectoryName" /> as its source entry has to the root of the archive.
10241024
If an entry in the zip archive is a symbolic link, it's extracted as a regular folder since symbolic link information isn't preserved in the ZIP format.
1025+
If <paramref name="destinationDirectoryName" /> or any of its parent directories is a pre-existing junction or symbolic link, the link is followed and the extraction writes to the final target folder.
10251026
If a file to be archived has an invalid last modified time, the first date and time representable in the zip timestamp format (midnight on January 1, 1980) will be used.</remarks>
10261027
<exception cref="T:System.ArgumentException">
10271028
<paramref name="destinationDirectoryName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.</exception>
@@ -1102,6 +1103,7 @@ An archive entry was compressed by using a compression method that isn't support
11021103
This method creates the specified directory and all subdirectories. The destination directory cannot already exist. Exceptions related to validating the paths in the `destinationDirectoryName` or `sourceArchiveFileName` parameters are thrown before extraction. Otherwise, if an error occurs during extraction, the archive remains partially extracted. Each extracted file has the same relative path to the directory specified by `destinationDirectoryName` as its source entry has to the root of the archive.
11031104
11041105
If an entry in the zip archive is a symbolic link, it's extracted as a regular folder since symbolic link information isn't preserved in the ZIP format.
1106+
If `destinationDirectoryName` or any of its parent directories is a pre-existing junction or symbolic link, the link is followed and the extraction writes to the final target folder.
11051107
11061108
## Examples
11071109
This example shows how to create and extract a zip archive by using the <xref:System.IO.Compression.ZipFile> class. It compresses the contents of a folder into a zip archive and extracts that content to a new folder. To use the <xref:System.IO.Compression.ZipFile> class, you must reference the `System.IO.Compression.FileSystem` assembly in your project.
@@ -1178,6 +1180,7 @@ An archive entry was compressed by using a compression method that isn't support
11781180
Exceptions related to validating the paths in the <paramref name="destinationDirectoryName" /> or the files in the zip archive contained in <paramref name="source" /> parameters are thrown before extraction. Otherwise, if an error occurs during extraction, the archive remains partially extracted.
11791181
Each extracted file has the same relative path to the directory specified by <paramref name="destinationDirectoryName" /> as its source entry has to the root of the archive.
11801182
If an entry in the zip archive is a symbolic link, it's extracted as a regular folder since symbolic link information isn't preserved in the ZIP format.
1183+
If <paramref name="destinationDirectoryName" /> or any of its parent directories is a pre-existing junction or symbolic link, the link is followed and the extraction writes to the final target folder.
11811184
If a file to be archived has an invalid last modified time, the first date and time representable in the zip timestamp format (midnight on January 1, 1980) will be used.</remarks>
11821185
<exception cref="T:System.ArgumentException">
11831186
<paramref name="destinationDirectoryName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.</exception>
@@ -1335,6 +1338,7 @@ Each entry will be extracted such that the extracted file has the same relative
13351338
The `sourceArchiveFileName` and `destinationDirectoryName` parameters accept both relative and absolute paths. A relative path is interpreted as relative to the current working directory.
13361339
13371340
If an entry in the zip archive is a symbolic link, it's extracted as a regular folder since symbolic link information isn't preserved in the ZIP format.
1341+
If `destinationDirectoryName` or any of its parent directories is a pre-existing junction or symbolic link, the link is followed and the extraction writes to the final target folder.
13381342
13391343
If a file to be archived has an invalid last modified time, the first date and time representable in the zip timestamp format (midnight on January 1, 1980) will be used.
13401344
@@ -1443,6 +1447,7 @@ A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> has been compressed usi
14431447
This method creates the specified directory and all subdirectories, if necessary. Exceptions related to validating the paths in the `destinationDirectoryName` or `sourceArchiveFileName` parameters are thrown before extraction. Otherwise, if an error occurs during extraction, the archive remains partially extracted. Each extracted file has the same relative path to the directory specified by `destinationDirectoryName` as its source entry has to the root of the archive.
14441448
14451449
If an entry in the zip archive is a symbolic link, it's extracted as a regular folder since symbolic link information isn't preserved in the ZIP format.
1450+
If `destinationDirectoryName` or any of its parent directories is a pre-existing junction or symbolic link, the link is followed and the extraction writes to the final target folder.
14461451
14471452
If `entryNameEncoding` is set to a value other than `null`, entry names and comments are decoded according to the following rules:
14481453
@@ -1535,6 +1540,7 @@ If `entryNameEncoding` is set to `null`, entry names and comments are decoded ac
15351540
Exceptions related to validating the paths in the <paramref name="destinationDirectoryName" /> or the files in the zip archive contained in <paramref name="source" /> parameters are thrown before extraction. Otherwise, if an error occurs during extraction, the archive remains partially extracted.
15361541
Each extracted file has the same relative path to the directory specified by <paramref name="destinationDirectoryName" /> as its source entry has to the root of the archive.
15371542
If an entry in the zip archive is a symbolic link, it's extracted as a regular folder since symbolic link information isn't preserved in the ZIP format.
1543+
If <paramref name="destinationDirectoryName" /> or any of its parent directories is a pre-existing junction or symbolic link, the link is followed and the extraction writes to the final target folder.
15381544
If a file to be archived has an invalid last modified time, the first date and time representable in the zip timestamp format (midnight on January 1, 1980) will be used.</remarks>
15391545
<exception cref="T:System.ArgumentException">
15401546
<paramref name="destinationDirectoryName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.
@@ -1632,6 +1638,7 @@ An archive entry was compressed by using a compression method that isn't support
16321638
The `sourceArchiveFileName` and `destinationDirectoryName` parameters accept both relative and absolute paths. A relative path is interpreted as relative to the current working directory.
16331639
16341640
If an entry in the zip archive is a symbolic link, it's extracted as a regular folder since symbolic link information isn't preserved in the ZIP format.
1641+
If `destinationDirectoryName` or any of its parent directories is a pre-existing junction or symbolic link, the link is followed and the extraction writes to the final target folder.
16351642
16361643
If a file to be archived has an invalid last modified time, the first date and time representable in the zip timestamp format (midnight on January 1, 1980) will be used.
16371644

0 commit comments

Comments
 (0)