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

Unified Diff: base/process_util_win.cc

Issue 125260: Don't grant unnecessary handle privileges in OpenProcessHandle. (Closed)
Patch Set: update Created 11 years, 6 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 | « no previous file | chrome/test/chrome_process_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_win.cc
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index aea8cb96667638b0392ebe142a619e4efc3e3288..eaa6c88f1193967581f40439bdd6a6d1e7e247a5 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -34,11 +34,10 @@ ProcessHandle GetCurrentProcessHandle() {
}
bool OpenProcessHandle(ProcessId pid, ProcessHandle* handle) {
- // TODO(phajdan.jr): Take even more permissions out of this list.
- ProcessHandle result = OpenProcess(PROCESS_DUP_HANDLE |
- PROCESS_TERMINATE |
- PROCESS_QUERY_INFORMATION |
- SYNCHRONIZE,
+ // We try to limit privileges granted to the handle. If you need this
+ // for test code, consider using OpenPrivilegedProcessHandle instead of
+ // adding more privileges here.
+ ProcessHandle result = OpenProcess(PROCESS_DUP_HANDLE | PROCESS_TERMINATE,
FALSE, pid);
if (result == INVALID_HANDLE_VALUE)
« no previous file with comments | « no previous file | chrome/test/chrome_process_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698