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

dtar: fix creation with symlink and --preserve-* #629

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rezib
Copy link
Contributor

@rezib rezib commented Mar 6, 2025

Fix creation of corrupted archive with symlink when --preserve-{xattrs,acl,flags} command line option is used.

When it is provided a valid file descriptor, libarchive archive_read_disk_entry_from_file() calls fstat() which follows symlinks. This commit introduces an exception for symlinks to not provide a file descriptor to archive_read_disk_entry_from_file() which makes it call lstat() on entry path and create a valid symlink archive entry eventually.

fix #628

Fix creation of corrupted archive with symlink when
--preserve-{xattrs,acl,flags} command line option is used.

When it is provided a valid file descriptor, libarchive
archive_read_disk_entry_from_file() calls fstat() which follows
symlinks. This commit introduces an exception for symlinks to not
provide a file descriptor to archive_read_disk_entry_from_file() which
makes it call lstat() on entry path and create a valid symlink archive
entry eventually.

fix hpc#628

Signed-off-by: Rémi Palancher <[email protected]>
@rezib rezib force-pushed the fix-dtar-symlink-preserve branch from 01103bd to 02f61e7 Compare March 6, 2025 13:40
@rezib rezib mentioned this pull request Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dtar produces corrupted archive with symlinks and --preserve-{xattrs,acl,flags}
1 participant