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

restore: set PR_SET_DUMPABLE to have access to proc files

It is cleared when a process is forked in a new userns.

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-31 12:14:30 +03:00
committed by Pavel Emelyanov
parent fa266bb0cb
commit c004ff7745

View File

@@ -836,6 +836,17 @@ static int prepare_userns_creds()
return -1;
}
/*
* This flag is dropped after entering userns, but is
* required to access files in /proc, so put one here
* temoprarily. It will be set to proper value at the
* very end.
*/
if (prctl(PR_SET_DUMPABLE, 1, 0)) {
pr_perror("Unable to set PR_SET_DUMPABLE");
exit(1);
}
return 0;
}