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

Unified Diff: tools/exception_port_tool.cc

Issue 727053002: Add DropPrivileges() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Rebase Created 6 years, 1 month 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 | « no previous file | util/posix/drop_privileges.h » ('j') | util/posix/drop_privileges.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/exception_port_tool.cc
diff --git a/tools/exception_port_tool.cc b/tools/exception_port_tool.cc
index bcca29fcdd5ec0096f11c181fd20ffe4fe2e0750..81eca6bbf204db283f63e8bcf11f3b23a229bc77 100644
--- a/tools/exception_port_tool.cc
+++ b/tools/exception_port_tool.cc
@@ -34,6 +34,7 @@
#include "util/mach/mach_extensions.h"
#include "util/mach/symbolic_constants_mach.h"
#include "util/mach/task_for_pid.h"
+#include "util/posix/drop_privileges.h"
#include "util/stdlib/string_number_conversion.h"
namespace crashpad {
@@ -503,6 +504,10 @@ int ExceptionPortToolMain(int argc, char* argv[]) {
alternate_task_owner.reset(options.alternate_task);
}
+ // This tool may have been installed as a setuid binary so that TaskForPID()
+ // could succeed. Drop any privileges now that they’re no longer necessary.
+ DropPrivileges();
+
MachSendRightPool mach_send_right_pool;
// Show bootstrap services requested.
« no previous file with comments | « no previous file | util/posix/drop_privileges.h » ('j') | util/posix/drop_privileges.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698