Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Resolve symlinks being written with size 0 in tar#1488

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kylecarbs merged 1 commit intomainfromsymload
May 16, 2022

Conversation

kylecarbs
Copy link
Member

Solution found here:
https://stackoverflow.com/questions/38454850/getting-write-too-long-error-when-trying-to-create-tar-gz-file-from-file-and-d

Symlink's were being written with a size of 0, which surfaced an error
for write too long.

@kylecarbskylecarbs requested a review fromcoadlerMay 16, 2022 19:48
@kylecarbskylecarbs self-assigned thisMay 16, 2022
Comment on lines +28 to +35
var link string
if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink {
link, err = os.Readlink(file)
if err != nil {
return err
}
}
header, err := tar.FileInfoHeader(fileInfo, link)
Copy link
Contributor

@coadlercoadlerMay 16, 2022
edited
Loading

Choose a reason for hiding this comment

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

This is a bit confusing. It seems like this only works for symlinks, since we're no longer using thefile var if it's not.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

The second arg is actually only alink. It was implemented incorrectly beforehand.

Copy link
Contributor

Choose a reason for hiding this comment

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

So it should be empty if the file isn't a symlink?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I believe so

@kylecarbskylecarbsenabled auto-merge (squash)May 16, 2022 20:21
@kylecarbskylecarbs merged commita77da84 intomainMay 16, 2022
@kylecarbskylecarbs deleted the symload branchMay 16, 2022 20:26
kylecarbs added a commit that referenced this pull requestJun 10, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@coadlercoadlercoadler approved these changes

Assignees

@kylecarbskylecarbs

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@kylecarbs@coadler

[8]ページ先頭

©2009-2025 Movatter.jp