remoting/client: create lockfile with explicit r+w #762
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 patch was written before I noticed the legal notice: feel free to discard (but please do apply explicit
O_CREATparams to the client remoting code; it would simplify the packaging effort for NixOS: NixOS/nixpkgs#397658).Note: I have not tested the remoting functionality with this patch, only that it builds.
Cheers.
This fixes the compilation error below, which is triggered in hardened build environments (e.g. NixOS):
In short: O_CREAT without explicit mode params may generate a file with suid/sgid. Error triggered by _FORTIFY_SOURCE. This commit explicitly creates the file with read/write permissions for the file owner.
Adopted from facebook/hhvm#168
For legal reasons we're currently not accepting pull requests.
Please create an issue if you have suggestions for improvements.