2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

namespaces: take into account USERNS id

and return an error, if a proccess live in another userns,
because criu doesn't support it.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2014-10-14 15:38:00 +04:00
committed by Pavel Emelyanov
parent 5ed535f17a
commit 102cbe8a09
4 changed files with 26 additions and 1 deletions

View File

@@ -467,9 +467,22 @@ int dump_task_ns_ids(struct pstree_item *item)
return -1;
}
ids->has_user_ns_id = true;
ids->user_ns_id = get_ns_id(pid, &user_ns_desc);
if (!ids->user_ns_id) {
pr_err("Can't make userns id\n");
return -1;
}
return 0;
}
static int dump_user_ns(pid_t pid, int ns_id)
{
pr_err("User namesapces are not supported yet\n");
return -1;
}
static int do_dump_namespaces(struct ns_id *ns)
{
int ret;
@@ -494,6 +507,11 @@ static int do_dump_namespaces(struct ns_id *ns)
ns->id, ns->pid);
ret = dump_net_ns(ns->id);
break;
case CLONE_NEWUSER:
pr_info("Dump USER namespace info %d via %d\n",
ns->id, ns->pid);
ret = dump_user_ns(ns->pid, ns->id);
break;
default:
pr_err("Unknown namespace flag %x", ns->nd->cflag);
break;