Merge pull request #564 from hallyn/2016-02-16/userns.devicecg
Do not set devices cgroup entries if in a user namespace
This commit is contained in:
commit
2c489ce2d9
|
@ -5,6 +5,7 @@ package fs
|
|||
import (
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
"github.com/opencontainers/runc/libcontainer/configs"
|
||||
"github.com/opencontainers/runc/libcontainer/system"
|
||||
)
|
||||
|
||||
type DevicesGroup struct {
|
||||
|
@ -25,6 +26,10 @@ func (s *DevicesGroup) Apply(d *cgroupData) error {
|
|||
}
|
||||
|
||||
func (s *DevicesGroup) Set(path string, cgroup *configs.Cgroup) error {
|
||||
if system.RunningInUserNS() {
|
||||
return nil
|
||||
}
|
||||
|
||||
devices := cgroup.Resources.Devices
|
||||
if len(devices) > 0 {
|
||||
for _, dev := range devices {
|
||||
|
|
Loading…
Reference in New Issue