Skip to content
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

Fix handling of symlinks extracted from zip files #39

Merged
merged 1 commit into from
Mar 14, 2024
Merged

Fix handling of symlinks extracted from zip files #39

merged 1 commit into from
Mar 14, 2024

Conversation

theory
Copy link
Member

@theory theory commented Mar 14, 2024

Setting unix attributes was breaking the detection of symlinks by Archive::Zip, so it was just writing out a file with the name of the linked file in it.

Fix it by instead removing an existing file if it exists and not setting permissions for symlinks. This allows Arhive::Zip to always create a proper symlink. While at it, change the permissions for files to we writable by the owner, so as to avoid any other permissions issues when re-indexing an archive, which needs to replace existing files.

Finallky, don't abandon unzipping a file on error, but just move on to the next file.

Setting unix attributes was breaking the detection of symlinks by
Archive::Zip, so it was just writing out a file with the name of the
linked file in it.

Fix it by instead removing an existing file if it exists and not setting
permissions for symlinks. This allows Arhive::Zip to always create a
proper symlink. While at it, change the permissions for files to we
writable by the owner, so as to avoid any other permissions issues when
re-indexing an archive, which needs to replace existing files.

Finallky, don't abandon unzipping a file on error, but just move on to
the next file.
@theory theory self-assigned this Mar 14, 2024
@theory theory merged commit 7f77cd7 into main Mar 14, 2024
26 checks passed
@theory theory deleted the symlinks branch March 14, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant