kernel/sysio: don't default to all-ones permissions #17
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.
The file-protection variable is understood to be an (unsigned) UNIX file mode everywhere, and contrary to what the comment says the -1 is not a default of any sort.
In fact, such a file mode is a pretty terrible thing, because the files end up being setuid executables. That is -- anyone could execute them with the privileges of whoever run the build. It's a matter of luck that umask typically chops off the writable bits and the images generated during the build are likely to just terminate upon an attempt to execute them.
This calls for wisdom: let's use what the UNIX programs typically use for mode bits, for it is the number of a regular non-executable file, and this number is 666, octal.
(Cherry picked from 8577d30 in quozl/openfirmware/)