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

Unified Diff: third_party/crashpad/crashpad/util/posix/drop_privileges.cc

Issue 2561963002: base: Remove the string logging from CHECK(). (Closed)
Patch Set: checkstring: rebase Created 4 years 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
Index: third_party/crashpad/crashpad/util/posix/drop_privileges.cc
diff --git a/third_party/crashpad/crashpad/util/posix/drop_privileges.cc b/third_party/crashpad/crashpad/util/posix/drop_privileges.cc
index 884a411c37a6827bcfdd3731ca78c5308e20a51a..ec5a0841559b264fb000c3507541070cb6407077 100644
--- a/third_party/crashpad/crashpad/util/posix/drop_privileges.cc
+++ b/third_party/crashpad/crashpad/util/posix/drop_privileges.cc
@@ -52,12 +52,16 @@ void DropPrivileges() {
// root. When running a setuid non-root or setgid program, they do not alter
// the saved ID, and do not effect a permanent privilege drop.
gid_t egid = getegid();
- PCHECK(setgid(gid) == 0) << "setgid";
- PCHECK(setregid(gid, gid) == 0) << "setregid";
+ // setgid
+ CHECK(setgid(gid) == 0);
+ // setregid
+ CHECK(setregid(gid, gid) == 0);
uid_t euid = geteuid();
- PCHECK(setuid(uid) == 0) << "setuid";
- PCHECK(setreuid(uid, uid) == 0) << "setreuid";
+ // setuid
+ CHECK(setuid(uid) == 0);
+ // setreuid
+ CHECK(setreuid(uid, uid) == 0);
if (uid != 0) {
// Because the setXid()+setreXid() interface to change IDs is fragile,
@@ -72,8 +76,10 @@ void DropPrivileges() {
}
}
#elif defined(OS_LINUX) || defined(OS_ANDROID)
- PCHECK(setresgid(gid, gid, gid) == 0) << "setresgid";
- PCHECK(setresuid(uid, uid, uid) == 0) << "setresuid";
+ // setresgid
+ CHECK(setresgid(gid, gid, gid) == 0);
+ // setresuid
+ CHECK(setresuid(uid, uid, uid) == 0);
// Don’t check to see if privileges can be regained on Linux, because on
// Linux, it’s not as simple as ensuring that this can’t be done if non-root.

Powered by Google App Engine
This is Rietveld 408576698