Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Unified Diff: sandbox/linux/services/credentials.cc

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/BUILD.gn ('k') | sandbox/linux/services/proc_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/services/credentials.cc
diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
index ed21fd192bd0c7eda1ffaadcbf6583c26f18751d..e571ddec59776a58a1810b22bf83ba4c63b8ba58 100644
--- a/sandbox/linux/services/credentials.cc
+++ b/sandbox/linux/services/credentials.cc
@@ -114,7 +114,7 @@ bool ChrootToSafeEmptyDir() {
int status = -1;
PCHECK(HANDLE_EINTR(waitpid(pid, &status, 0)) == pid);
- return WIFEXITED(status) && WEXITSTATUS(status) == kExitSuccess;
+ return kExitSuccess == status;
}
// CHECK() that an attempt to move to a new user namespace raised an expected
@@ -174,14 +174,12 @@ bool Credentials::CanCreateProcessInNewUserNS() {
// have disappeared. Make sure to not do anything in the child, as this is a
// fragile execution environment.
if (pid == 0) {
- _exit(kExitSuccess);
+ _exit(0);
}
// Always reap the child.
- int status = -1;
- PCHECK(HANDLE_EINTR(waitpid(pid, &status, 0)) == pid);
- CHECK(WIFEXITED(status));
- CHECK_EQ(kExitSuccess, WEXITSTATUS(status));
+ siginfo_t infop;
+ PCHECK(0 == HANDLE_EINTR(waitid(P_PID, pid, &infop, WEXITED)));
// clone(2) succeeded, we can use CLONE_NEWUSER.
return true;
« no previous file with comments | « sandbox/linux/BUILD.gn ('k') | sandbox/linux/services/proc_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698