unarchive - respect symlinks in archives#80136
Open
TheJJ wants to merge 1 commit intoansible:develfrom
Open
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Member
|
The PR needs rebasing for the CI to pick it up. |
this patch fixes the extraction if symlinks are present in an archive
but the symlinks don't exist in the target filesystem.
tar reports this with:
```
/bin/tar: $filename: Warning: Cannot readlink: No such file or directory
```
previously, this was not matched against, hence the re-extraction was not triggered, although needed.
additionally, setting permissions on that file later fails, leading to errors like:
Unexpected error when accessing exploded file: `[Errno 2] No such file or directory: b'/path/to/$filename'`
```
File "payload.zip/ansible/modules/unarchive.py", line 901, in main
File "payload.zip/ansible/module_utils/basic.py", line 1417, in set_fs_attributes_if_different
file_args['path'], file_args['owner'], changed, diff, expand
File "payload.zip/ansible/module_utils/basic.py", line 1058, in set_owner_if_different
orig_uid, orig_gid = self.user_and_group(b_path, expand)
File "payload.zip/ansible/module_utils/basic.py", line 952, in user_and_group
st = os.lstat(b_path)
```
152cc34 to
57f4527
Compare
Author
|
I've rebased. Please merge? :) @webknjaz |
Member
|
Looks like there's a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this patch fixes the extraction if symlinks are present in an archive but the symlinks don't exist in the target filesystem.
tar reports this with:
/bin/tar: $filename: Warning: Cannot readlink: No such file or directorypreviously, this was not matched against, hence the re-extraction was not triggered, although needed.
additionally, setting permissions on that file later fails, leading to errors like: Unexpected error when accessing exploded file:
[Errno 2] No such file or directory: b'/path/to/$filename'ISSUE TYPE
COMPONENT NAME
unarchivemodule