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:
committed by
Pavel Emelyanov
parent
fa266bb0cb
commit
c004ff7745
11
namespaces.c
11
namespaces.c
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user