Skip to content

Fix overwrite of the tar header fields#24

Open
vasiliy-ul wants to merge 1 commit into
rmohr:mainfrom
vasiliy-ul:fix-typeflag-size-overwrite
Open

Fix overwrite of the tar header fields#24
vasiliy-ul wants to merge 1 commit into
rmohr:mainfrom
vasiliy-ul:fix-typeflag-size-overwrite

Conversation

@vasiliy-ul
Copy link
Copy Markdown

Set proper Typeflag and Size when handling hardlinks and regular files.

Noticed that by visual code inspection: in the original code, tarHeader.Typeflag was overwritten with tar.TypeReg when handling an entry for a hardlink. A similar issue was with the tarHeader.Size: it was set to 0 for regular files.

Set proper Typeflag and Size when handling hardlinks and regular files.

Signed-off-by: Vasiliy Ulyanov <vulyanov@suse.de>
@vasiliy-ul
Copy link
Copy Markdown
Author

@rmohr FYI.

@rmohr
Copy link
Copy Markdown
Owner

rmohr commented Sep 8, 2022

Thanks, I first have to check a fix in that are I did before. This seems to be the same area. Did you run into a specific issue to reproduce thus?

@vasiliy-ul
Copy link
Copy Markdown
Author

No, there was no specific issue. I was debugging some stuff and just noticed that in the code. That part with hardlinks seemed not right for me. Feel free to close the PR if the fix is not relevant or correct.

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.

2 participants