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

Unified Diff: content/common/sandbox_win.cc

Issue 937353002: Adding method to create process using LowBox token in sandbox code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed indent. 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
Index: content/common/sandbox_win.cc
diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc
index a3882d0d1dd709d581f695f2c990e6ee18ab0bbb..5d052083695b3f2d623d9cb6789d29a7d8f4f5c6 100644
--- a/content/common/sandbox_win.cc
+++ b/content/common/sandbox_win.cc
@@ -27,6 +27,7 @@
#include "sandbox/win/src/process_mitigations.h"
#include "sandbox/win/src/sandbox.h"
#include "sandbox/win/src/sandbox_nt_util.h"
+#include "sandbox/win/src/sid.h"
#include "sandbox/win/src/win_utils.h"
#include "ui/gfx/win/direct_write.h"
@@ -533,6 +534,16 @@ void AddBaseHandleClosePolicy(sandbox::TargetPolicy* policy) {
policy->AddKernelObjectToClose(L"Section", object_path.data());
}
+void AddAppContainerPolicy(sandbox::TargetPolicy* policy) {
+ if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ return;
+
+ std::wstring unique_sid;
+ sandbox::Sid(::WinBuiltinAnyPackageSid).GenerateUniqueSubAuthoritySid(
+ &unique_sid);
+ policy->SetAppContainer(unique_sid.c_str());
+}
+
bool InitBrokerServices(sandbox::BrokerServices* broker_services) {
// TODO(abarth): DCHECK(CalledOnValidThread());
// See <http://b/1287166>.

Powered by Google App Engine
This is Rietveld 408576698