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

Unified Diff: sandbox/win/src/window.cc

Issue 683683002: Further restrict access on the alternate winstation and desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/window.cc
diff --git a/sandbox/win/src/window.cc b/sandbox/win/src/window.cc
index ed5a6626338203014cc21a00f4da860c68cdf738..cfbf280d9cf2d563f7840765668f99a1a6ad0264 100644
--- a/sandbox/win/src/window.cc
+++ b/sandbox/win/src/window.cc
@@ -44,8 +44,8 @@ ResultCode CreateAltWindowStation(HWINSTA* winsta) {
// Create the window station using NULL for the name to ask the os to
// generate it.
- // TODO(nsylvain): don't ask for WINSTA_ALL_ACCESS if we don't need to.
- *winsta = ::CreateWindowStationW(NULL, 0, WINSTA_ALL_ACCESS, &attributes);
+ *winsta = ::CreateWindowStationW(
+ NULL, 0, GENERIC_READ | WINSTA_CREATEDESKTOP, &attributes);
LocalFree(attributes.lpSecurityDescriptor);
if (*winsta)
@@ -84,8 +84,12 @@ ResultCode CreateAltDesktop(HWINSTA winsta, HDESK* desktop) {
}
// Create the destkop.
- // TODO(nsylvain): don't ask for GENERIC_ALL if we don't need to.
- *desktop = ::CreateDesktop(desktop_name.c_str(), NULL, NULL, 0, GENERIC_ALL,
+ *desktop = ::CreateDesktop(desktop_name.c_str(),
+ NULL,
+ NULL,
+ 0,
+ DESKTOP_CREATEWINDOW | DESKTOP_READOBJECTS |
+ READ_CONTROL | WRITE_DAC | WRITE_OWNER,
&attributes);
::LocalFree(attributes.lpSecurityDescriptor);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698