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 issue when reading symlink during tar Archive #201

Conversation

technicianted
Copy link

@technicianted technicianted commented Nov 29, 2019

This PR fixes an issue when create tar archives with symbolic links.

The code uses the Name() value to call os.Readlink(). This does not work since this value is only the name of the link. not the full path.

To resolve this, we need to pass down the original full FS path and use it during os.* calls.

Fixes #202

@mholt
Copy link
Owner

mholt commented Nov 29, 2019

Thanks. Is there a test case that exhibits the bug? Or a related issue already reported?

@technicianted
Copy link
Author

#202

@mholt
Copy link
Owner

mholt commented Dec 2, 2019

Ah, thanks. I'm willing to merge this, but first, would it be an easy task to add a file to the test corpus which exhibits the behavior? If it is too complicated or something, let me know, but it'd be nice to be able to verify that the fix is working with a test.

@nishant-handa
Copy link

nishant-handa commented Jan 22, 2020

@mholt any updates on getting this in?
Will highly appreciate if we can expedite this.

@kneal
Copy link

kneal commented Apr 14, 2020

@mholt Any updates on this one?

@mholt
Copy link
Owner

mholt commented Apr 14, 2020

Nope, sorry, if there were updates they would be posted here.

I've been busy readying the Caddy 2 release. In the meantime, this PR needs tests, as stated above.

@jbrockopp
Copy link

@technicianted @mholt

I've opened a separate PR that attempts to copy the changes made in this PR, but also add tests:

#230

Please let me know if anything else is required 👍

@iotanbo iotanbo mentioned this pull request Oct 29, 2021
@mholt
Copy link
Owner

mholt commented Nov 1, 2021

Probably fixed in #296.

@mholt mholt closed this Nov 1, 2021
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.

Creating tar archive fails with symbolic links
5 participants