[CRIU] [PATCH 07/14] userns: save uid-s from a target userns (v2)

Pavel Emelyanov xemul at parallels.com
Thu Oct 30 05:05:32 PDT 2014


On 10/20/2014 01:29 PM, Andrey Vagin wrote:
> We are going to support user namespaces and uid-s will be converted
> accoding with userns mappings.
> 
> v2: conver id-s for sockets too
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---

> @@ -1505,6 +1505,12 @@ static int dump_one_task(struct pstree_item *item)
>  		goto err;
>  	}
>  
> +	for (i = 0; i < 4; i++)
> +		cr.uids[i] = userns_uid(cr.uids[i]);
> +
> +	for (i = 0; i < 4; i++)
> +		cr.gids[i] = userns_gid(cr.gids[i]);
> +

Why not just fetch them from parasite in dump_task_creds?

>  	ret = collect_mappings(pid, &vmas);
>  	if (ret) {
>  		pr_err("Collect mappings (pid: %d) failed with %d\n", pid, ret);



More information about the CRIU mailing list