[programs] set restrictive umask before file creation#1652
Closed
chungy wants to merge 1 commit intofacebook:devfrom
chungy:umask_new_files
Closed
[programs] set restrictive umask before file creation#1652chungy wants to merge 1 commit intofacebook:devfrom chungy:umask_new_files
chungy wants to merge 1 commit intofacebook:devfrom
chungy:umask_new_files
Conversation
This resolves a condition where zstd or unzstd may expose read permissions beyond what the original file allowed. umask 077 blocks out all permissions for group and other while the file is being written to by zstd, and gets reset to the source file’s mode afterward. Fixes #1630
Contributor
Author
|
the chmod PR was pulled and one of the CI tests on this failed for some reason (the log doesn't tell me anything...). Closing. :) |
Contributor
|
The error was : at https://ci.appveyor.com/project/YannCollet/zstd-p0yf0/builds/25271621/job/4j0mfu1kvn7317nt#L40. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This resolves a condition where zstd or unzstd may expose read
permissions beyond what the original file allowed. umask 077
blocks out all permissions for group and other while the file
is being written to by zstd, and gets reset to the source file’s
mode afterward.
As suggested by @felixhandte in PR #1644, I think this solution is cleaner and removes the chance of reading the file before a chmod() call could be done. That PR should be closed if this one is accepted instead (one or the other).