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

Archive extraction fails, if the archive includes a write-protected dir #6

Closed
wants to merge 2 commits into from

Conversation

eyalbe4
Copy link

@eyalbe4 eyalbe4 commented Sep 13, 2024

This is an attempt at fixing jfrog/jfrog-cli#2652 where the extraction of an archive fails, when the archive includes a directory without write permissions.
In that scenario, the extraction fails when it tries to create the new file inside the directory, beucase that directory has no write permissions.
To try and overcome this, the extraction process has been improved as part of this PR as follows:
A new mkdirAll function has been added, replacing the default od.MkdirAll function. The new function temporarily sets 0755 permissions for all the directories, and then returns a restore function to revert the permission changes, after the file was created.

Fix jfrog/jfrog-cli#2652

@eyalbe4 eyalbe4 marked this pull request as draft September 13, 2024 06:27
@eyalbe4
Copy link
Author

eyalbe4 commented Oct 5, 2024

Closing this PR, since this functionality doesn't work well on Windows.
This is because the Windows API used by Go doesn't allow overcoming a write-protected dir included inside an archive when extracting it.

@eyalbe4 eyalbe4 closed this Oct 5, 2024
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.

JFrog CLI stops, after finding existing write protected file in the same location
1 participant