mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
*: correctly chown() consoles
In user namespaces, we need to make sure we don't chown() the console to unmapped users. This means we need to get both the UID and GID of the root user in the container when changing the owner. Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
+2
-1
@@ -117,6 +117,7 @@ using the runc checkpoint command.`,
|
||||
func restoreContainer(context *cli.Context, spec *specs.Spec, config *configs.Config, imagePath string) (code int, err error) {
|
||||
var (
|
||||
rootuid = 0
|
||||
rootgid = 0
|
||||
id = context.Args().First()
|
||||
)
|
||||
factory, err := loadFactory(context)
|
||||
@@ -149,7 +150,7 @@ func restoreContainer(context *cli.Context, spec *specs.Spec, config *configs.Co
|
||||
defer destroy(container)
|
||||
}
|
||||
process := &libcontainer.Process{}
|
||||
tty, err := setupIO(process, rootuid, "", false, detach)
|
||||
tty, err := setupIO(process, rootuid, rootgid, "", false, detach)
|
||||
if err != nil {
|
||||
return -1, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user