mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #5929 from alexlarsson/systemd-cgroup-allow-mknod
cgroups: Allow mknod for any device in systemd cgroup backend
This commit is contained in:
commit
f3edb7c0e8
1 changed files with 15 additions and 6 deletions
|
@ -174,13 +174,22 @@ func Apply(c *cgroups.Cgroup, pid int) (cgroups.ActiveCgroup, error) {
|
||||||
|
|
||||||
path := filepath.Join(mountpoint, cgroup)
|
path := filepath.Join(mountpoint, cgroup)
|
||||||
|
|
||||||
// /dev/pts/*
|
allow := []string{
|
||||||
if err := ioutil.WriteFile(filepath.Join(path, "devices.allow"), []byte("c 136:* rwm"), 0700); err != nil {
|
// allow mknod for any device
|
||||||
|
"c *:* m",
|
||||||
|
"b *:* m",
|
||||||
|
|
||||||
|
// /dev/pts/ - pts namespaces are "coming soon"
|
||||||
|
"c 136:* rwm",
|
||||||
|
|
||||||
|
// tuntap
|
||||||
|
"c 10:200 rwm",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, val := range allow {
|
||||||
|
if err := ioutil.WriteFile(filepath.Join(path, "devices.allow"), []byte(val), 0700); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// tuntap
|
|
||||||
if err := ioutil.WriteFile(filepath.Join(path, "devices.allow"), []byte("c 10:200 rwm"), 0700); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue