-
Notifications
You must be signed in to change notification settings - Fork 592
config: add "umask" field to POSIX "user" section #941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -217,6 +217,7 @@ For POSIX platforms the `user` structure has the following fields: | |
|
|
||
| * **`uid`** (int, REQUIRED) specifies the user ID in the [container namespace](glossary.md#container-namespace). | ||
| * **`gid`** (int, REQUIRED) specifies the group ID in the [container namespace](glossary.md#container-namespace). | ||
| * **`umask`** (int, OPTIONAL) specifies the [umask][umask_2] of the user. If unspecified, the umask should not be changed from the calling process' umask. | ||
| * **`additionalGids`** (array of ints, OPTIONAL) specifies additional group IDs in the [container namespace](glossary.md#container-namespace) to be added to the process. | ||
|
|
||
| _Note: symbolic name for uid and gid, such as uname and gname respectively, are left to upper levels to derive (i.e. `/etc/passwd` parsing, NSS, etc)_ | ||
|
|
@@ -233,6 +234,7 @@ _Note: symbolic name for uid and gid, such as uname and gname respectively, are | |
| "user": { | ||
| "uid": 1, | ||
| "gid": 1, | ||
| "umask": 63, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i get that they're just ints, but i wish octals were a viewable in json, and 077 wouldn't be 77 |
||
| "additionalGids": [5, 6] | ||
| }, | ||
| "env": [ | ||
|
|
@@ -291,6 +293,7 @@ _Note: symbolic name for uid and gid, such as uname and gname respectively, are | |
| "user": { | ||
| "uid": 1, | ||
| "gid": 1, | ||
| "umask": 7, | ||
| "additionalGids": [2, 8] | ||
| }, | ||
| "env": [ | ||
|
|
@@ -843,6 +846,7 @@ Here is a full example `config.json` for reference. | |
| [selinux]:http://selinuxproject.org/page/Main_Page | ||
| [no-new-privs]: https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt | ||
| [proc_2]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt | ||
| [umask.2]: http://pubs.opengroup.org/onlinepubs/009695399/functions/umask.html | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: POSIX functions should go be in section 3 (or 3p), so nit: you're linking to the 2004 edition of POSIX. I'd rather stay consistent with our other links and use the 2016 edition (#858). |
||
| [semver-v2.0.0]: http://semver.org/spec/v2.0.0.html | ||
| [ieee-1003.1-2008-xbd-c8.1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_01 | ||
| [ieee-1003.1-2008-functions-exec]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,6 +60,9 @@ | |
| "GID": { | ||
| "$ref": "#/definitions/uint32" | ||
| }, | ||
| "Umask": { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The indent here is a bit strange. You can automatically format these files by running |
||
| "$ref": "#/definitions/uint32" | ||
| }, | ||
| "ArrayOfGIDs": { | ||
| "type": "array", | ||
| "items": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,8 @@ type User struct { | |
| UID uint32 `json:"uid" platform:"linux,solaris"` | ||
| // GID is the group id. | ||
| GID uint32 `json:"gid" platform:"linux,solaris"` | ||
| // Umask is the umask for the init process. | ||
| Umask uint32 `json:"umask,omitempty" platform:"linux,solaris"` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Zero is a valid umask (it means “leave the permissions entirely up to the process itself”), so I think we need a pointer here. |
||
| // AdditionalGids are additional group ids set for the container's process. | ||
| AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"` | ||
| // Username is the user name. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the possessive of “process” is “process's”, see us here and the Linux man pages here.
nit: the “If unspecified…” sentence should go on its own line.