Chown stdio with proper user

If user namespace is used we should chown with a remapped ID.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2016-01-25 17:57:42 -08:00
parent 1ade1f6d81
commit b58c572f32

View file

@ -414,7 +414,11 @@ func (r *libcontainerRuntime) Create(id, bundlePath, consolePath string) (runtim
return nil, nil, err return nil, nil, err
} }
} else { } else {
i, err := process.InitializeIO(int(spec.Process.User.UID)) uid, err := config.HostUID()
if err != nil {
return nil, nil, err
}
i, err := process.InitializeIO(uid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
@ -449,7 +453,11 @@ func (r *libcontainerRuntime) StartProcess(ci runtime.Container, p specs.Process
return nil, nil, err return nil, nil, err
} }
} else { } else {
i, err := process.InitializeIO(int(p.User.UID)) uid, err := c.c.Config().HostUID()
if err != nil {
return nil, nil, err
}
i, err := process.InitializeIO(uid)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }