Skip to content

Commit 1fc1464

Browse files
author
Ma Shimiao
committed
config-linux: Add restriction for duplicated device path
I think runtime should generate an error, if devices has duplicated device path. Because we don't know which one is really needed. Signed-off-by: Ma Shimiao <[email protected]>
1 parent ced3365 commit 1fc1464

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

config-linux.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,15 @@ Each entry has the following structure:
115115
* **`type`** *(string, REQUIRED)* - type of device: `c`, `b`, `u` or `p`.
116116
More info in [mknod(1)][mknod.1].
117117
* **`path`** *(string, REQUIRED)* - full path to device inside container.
118+
If a [file][file.1] already exists at `path` that does not match the requested device, the runtime MUST generate an error.
118119
* **`major, minor`** *(int64, REQUIRED unless **`type`** is `p`)* - [major, minor numbers][devices] for the device.
119120
* **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device.
120121
You can also control access to devices [with cgroups](#device-whitelist).
121122
* **`uid`** *(uint32, OPTIONAL)* - id of device owner.
122123
* **`gid`** *(uint32, OPTIONAL)* - id of device group.
123124

125+
The same `type`, `major` and `minor` SHOULD NOT be used for multiple devices.
126+
124127
###### Example
125128

126129
```json
@@ -608,6 +611,7 @@ The values MUST be absolute paths in the [container namespace][container-namespa
608611
[cgroup-v2]: https://www.kernel.org/doc/Documentation/cgroup-v2.txt
609612
[devices]: https://www.kernel.org/doc/Documentation/devices.txt
610613
[devpts]: https://www.kernel.org/doc/Documentation/filesystems/devpts.txt
614+
[file.1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_164
611615

612616
[mknod.1]: http://man7.org/linux/man-pages/man1/mknod.1.html
613617
[mknod.2]: http://man7.org/linux/man-pages/man2/mknod.2.html

0 commit comments

Comments
 (0)