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:
parent
1ade1f6d81
commit
b58c572f32
1 changed files with 10 additions and 2 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue