-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only try and set permissions if permissions have changed. (#295)
* Only try and set permissions if permissions have changed. This is a workaround for jruby/jruby#6693 - stat is currently reporting incorrect values of `uid` and `gid` on aarch64 linux nodes, and appears to be setting `uid` and `gid` to 0, ie `root` It is highly unlikely that `chown` needs to be called on the file - and even more unlikely that `chown` would succeed anyway - `chmod` typically requires superuser privileges, unless the change of ownerhip is a change of group to another group the user is already a member of. This workaround updates the code to only attempt to call `chown` in the unlikely event that file ownership of the temp file is different from the original file, which should avoid the scenario that is currently occurring due to the above jruby bug. This commit also falls back to a non-atomic write in the event of a failure to write the file atomically.
- Loading branch information
Showing
4 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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