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 writing of cpio archives containing hardlinks without file type #1387

Merged
merged 1 commit into from
May 30, 2020

Conversation

glebfm
Copy link
Contributor

@glebfm glebfm commented May 28, 2020

I'm not sure.
May be we can just drop this check instead of touching API?

@@ -190,7 +190,7 @@ archive_write_newc_header(struct archive_write *a, struct archive_entry *entry)
const char *path;
size_t len;

if (archive_entry_filetype(entry) == 0) {
if (archive_entry_filetype(entry) == 0 && archive_entry_hardlink_is_set(entry) == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the right idea, I think. We should keep this check, since people trying to create archives programmatically can easily overlook important bits. You might consider using archive_entry_hardlink(entry) == NULL as the test here (as is used a few lines below) instead of adding a new API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, how did I miss that function? Thank you!

@glebfm glebfm force-pushed the tar2cpio-hardlink-filetype branch from a24d243 to 84b27e5 Compare May 29, 2020 10:13
@mmatuska mmatuska merged commit 9a15ef1 into libarchive:master May 30, 2020
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.

None yet

3 participants