-
Notifications
You must be signed in to change notification settings - Fork 113
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
Set Umask as part of archive.Extract #730
Conversation
@aemengo, we would love to get your feedback! Thanks! |
var ( | ||
umaskLock sync.Mutex | ||
extractCounter int | ||
originalUmask int | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can put these three variables inside a private struct if anyone thinks it'll be clearer.
Or we can even move the variables and the related functions (setUmaskIfNeeded
and unsetUmaskIfNeeded
) to an internal package.
Personally, I don't think it's necessary but it's an option.
c8e5177
to
6e95ee6
Compare
Signed-off-by: Natalie Arellano <[email protected]>
I think this is the best solution. This way we don't force the complexity of setting the umask on the caller. @yaelharel thank you for thinking of it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it - it seems simpler than I initially figured it would end up. The complexity being trapped inside of Extract is probably the right move from an API perspective.
instead at the end of the function in case setUmask will panic. Signed-off-by: Natalie Arellano <[email protected]>
A different solution for #727.