2018-01-19 21:37:10 +00:00
|
|
|
// +build linux
|
2017-02-01 00:45:59 +00:00
|
|
|
|
|
|
|
package configs
|
|
|
|
|
|
|
|
var (
|
2017-02-06 20:16:36 +00:00
|
|
|
// DefaultSimpleDevices are devices that are to be both allowed and created.
|
2017-02-01 00:45:59 +00:00
|
|
|
DefaultSimpleDevices = []*Device{
|
|
|
|
// /dev/null and zero
|
|
|
|
{
|
|
|
|
Path: "/dev/null",
|
|
|
|
Type: 'c',
|
|
|
|
Major: 1,
|
|
|
|
Minor: 3,
|
|
|
|
Permissions: "rwm",
|
|
|
|
FileMode: 0666,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Path: "/dev/zero",
|
|
|
|
Type: 'c',
|
|
|
|
Major: 1,
|
|
|
|
Minor: 5,
|
|
|
|
Permissions: "rwm",
|
|
|
|
FileMode: 0666,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
Path: "/dev/full",
|
|
|
|
Type: 'c',
|
|
|
|
Major: 1,
|
|
|
|
Minor: 7,
|
|
|
|
Permissions: "rwm",
|
|
|
|
FileMode: 0666,
|
|
|
|
},
|
|
|
|
|
|
|
|
// consoles and ttys
|
|
|
|
{
|
|
|
|
Path: "/dev/tty",
|
|
|
|
Type: 'c',
|
|
|
|
Major: 5,
|
|
|
|
Minor: 0,
|
|
|
|
Permissions: "rwm",
|
|
|
|
FileMode: 0666,
|
|
|
|
},
|
|
|
|
|
|
|
|
// /dev/urandom,/dev/random
|
|
|
|
{
|
|
|
|
Path: "/dev/urandom",
|
|
|
|
Type: 'c',
|
|
|
|
Major: 1,
|
|
|
|
Minor: 9,
|
|
|
|
Permissions: "rwm",
|
|
|
|
FileMode: 0666,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Path: "/dev/random",
|
|
|
|
Type: 'c',
|
|
|
|
Major: 1,
|
|
|
|
Minor: 8,
|
|
|
|
Permissions: "rwm",
|
|
|
|
FileMode: 0666,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
DefaultAllowedDevices = append([]*Device{
|
|
|
|
// allow mknod for any device
|
|
|
|
{
|
|
|
|
Type: 'c',
|
|
|
|
Major: Wildcard,
|
|
|
|
Minor: Wildcard,
|
|
|
|
Permissions: "m",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Type: 'b',
|
|
|
|
Major: Wildcard,
|
|
|
|
Minor: Wildcard,
|
|
|
|
Permissions: "m",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
Path: "/dev/console",
|
|
|
|
Type: 'c',
|
|
|
|
Major: 5,
|
|
|
|
Minor: 1,
|
|
|
|
Permissions: "rwm",
|
|
|
|
},
|
|
|
|
// /dev/pts/ - pts namespaces are "coming soon"
|
|
|
|
{
|
|
|
|
Path: "",
|
|
|
|
Type: 'c',
|
|
|
|
Major: 136,
|
|
|
|
Minor: Wildcard,
|
|
|
|
Permissions: "rwm",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Path: "",
|
|
|
|
Type: 'c',
|
|
|
|
Major: 5,
|
|
|
|
Minor: 2,
|
|
|
|
Permissions: "rwm",
|
|
|
|
},
|
|
|
|
|
|
|
|
// tuntap
|
|
|
|
{
|
|
|
|
Path: "",
|
|
|
|
Type: 'c',
|
|
|
|
Major: 10,
|
|
|
|
Minor: 200,
|
|
|
|
Permissions: "rwm",
|
|
|
|
},
|
|
|
|
}, DefaultSimpleDevices...)
|
2017-02-06 20:16:36 +00:00
|
|
|
DefaultAutoCreatedDevices = append([]*Device{}, DefaultSimpleDevices...)
|
2017-02-01 00:45:59 +00:00
|
|
|
)
|