Commit c004ff77 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

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: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent fa266bb0
...@@ -836,6 +836,17 @@ static int prepare_userns_creds() ...@@ -836,6 +836,17 @@ static int prepare_userns_creds()
return -1; 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; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment