-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Document symbolic link and junction extraction behavior for TarFile and ZipFile #12009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… will not be followed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds documentation about symbolic link and junction handling behavior to the extraction methods in both ZipFile and TarFile APIs.
- Clarifies that ZIP archives extract symbolic links as regular folders since symbolic link information isn't preserved in the ZIP format
- Documents that TAR archives throw an
IOExceptionwhen symbolic links or junctions would extract files outside the destination directory
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| xml/System.IO.Compression/ZipFile.xml | Added documentation stating that symbolic links in ZIP archives are extracted as regular folders across multiple ExtractToDirectory method overloads |
| xml/System.Formats.Tar/TarFile.xml | Added documentation explaining that symbolic links or junctions pointing outside the destination directory will throw an IOException across multiple ExtractToDirectory method overloads |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
This PR updates the API documentation for TarFile and ZipFile ExtractToDirectory methods. It clarifies how symbolic links and junctions are handled during extraction. For TarFile, the docs now state that extraction will throw an IOException if a symbolic link or junction would escape the destination directory. For ZipFile, the docs explain that symbolic link information is not preserved and such entries are extracted as regular folders.
Fixes dotnet/runtime#120966