Commit 9b2acbe4 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

ns: Fix return collison in prepare_userns_creds()

"return" and "exit" are mixed in this function, and this is wrong.
Must be "return" only, because its callers don't want exit.
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 37887781
......@@ -1501,7 +1501,7 @@ int collect_namespaces(bool for_dump)
return 0;
}
static int prepare_userns_creds()
static int prepare_userns_creds(void)
{
/* UID and GID must be set after restoring /proc/PID/{uid,gid}_maps */
if (setuid(0) || setgid(0) || setgroups(0, NULL)) {
......@@ -1517,7 +1517,7 @@ static int prepare_userns_creds()
*/
if (prctl(PR_SET_DUMPABLE, 1, 0)) {
pr_perror("Unable to set PR_SET_DUMPABLE");
exit(1);
return -1;
}
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