config-linux,schema: fix FileMode description#1298
Merged
AkihiroSuda merged 2 commits intoopencontainers:mainfrom Oct 15, 2025
Merged
config-linux,schema: fix FileMode description#1298AkihiroSuda merged 2 commits intoopencontainers:mainfrom
AkihiroSuda merged 2 commits intoopencontainers:mainfrom
Conversation
AkihiroSuda
reviewed
Oct 13, 2025
config-linux.md
Outdated
| The path MAY be anywhere in the container filesystem, notably outside of `/dev`. | ||
| * **`major, minor`** *(int64, REQUIRED unless `type` is `p`)* - [major, minor numbers][devices] for the device. | ||
| * **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device. | ||
| * **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device. The value MUST be a decimal (not an octal) number. |
Member
There was a problem hiding this comment.
This seems to be within the scope of the spec of JSON, not of the runtime-spec.
Contributor
Author
There was a problem hiding this comment.
Right, but the issue is, any octal number without a prefix (such as 0, 0o etc.) is a valid decimal number as well, so I wanted to add some kind of a warning here, as everyone is accustomed to using octal numbers for mode.
Would a note look better?
Suggested change
| * **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device. The value MUST be a decimal (not an octal) number. | |
| * **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device. Note it is a decimal (not an octal) number. |
Or should we just drop this hunk?
Originally, the file mode was indeed written in octal (see e.g. commit 5273b3d), but it was found out later that JSON does not allow octal values so the examples were changed to decimal in commit ccf3a24, but the "typically an octal value" bit (added by commit cdcabde) remains. Change it to emphasize the fact that this is in decimal. Also, add a note to config-linux.md saying the same thing. Signed-off-by: Kir Kolyshkin <[email protected]>
Current spec allows decimal 512 as a maximum value for FileMode, which is octal 1000, meaning sticky bit is set and no rwx permissions for anyone (aka s---------). This does not make sense,the maximum value should be 511 (which is octal 777, aka -rwxrwxrwx). Signed-off-by: Kir Kolyshkin <[email protected]>
61f3527 to
9efd9f2
Compare
tianon
approved these changes
Oct 15, 2025
AkihiroSuda
approved these changes
Oct 15, 2025
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.
Originally, the file mode was indeed written in octal (see e.g. commit 5273b3d), but it was found out later that JSON does not allow octal values so the examples were changed to decimal in commit ccf3a24, but the "typically an octal value" bit (added by commit cdcabde) remains.
Change it to emphasize the fact that this is in decimal.
Add a note to config-linux.md saying the same thing.