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

Side by Side Diff: sandbox/win/src/app_container_test.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 comment inside target_process. Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | sandbox/win/src/broker_services.cc » ('j') | sandbox/win/src/sandbox_policy.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <windows.h> 5 #include <windows.h>
6 6
7 #define _ATL_NO_EXCEPTIONS 7 #define _ATL_NO_EXCEPTIONS
8 #include <atlbase.h> 8 #include <atlbase.h>
9 #include <atlsecurity.h> 9 #include <atlsecurity.h>
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 TEST(AppContainerTest, RequiresImpersonation) { 135 TEST(AppContainerTest, RequiresImpersonation) {
136 if (base::win::OSInfo::GetInstance()->version() < base::win::VERSION_WIN8) 136 if (base::win::OSInfo::GetInstance()->version() < base::win::VERSION_WIN8)
137 return; 137 return;
138 138
139 TestRunner runner(JOB_UNPROTECTED, USER_RESTRICTED, USER_RESTRICTED); 139 TestRunner runner(JOB_UNPROTECTED, USER_RESTRICTED, USER_RESTRICTED);
140 EXPECT_EQ(SBOX_ERROR_CANNOT_INIT_APPCONTAINER, 140 EXPECT_EQ(SBOX_ERROR_CANNOT_INIT_APPCONTAINER,
141 runner.GetPolicy()->SetAppContainer(kAppContainerSid)); 141 runner.GetPolicy()->SetAppContainer(kAppContainerSid));
142 } 142 }
143 143
144 // We are treating LowBox as another approach for launching appcontainer.
145 // For convenience including LowBox tests inside this file.
rvargas (doing something else) 2015/02/28 01:10:06 nit: remove lines 144-45
Shrikant Kelkar 2015/02/28 01:55:41 Done.
146 // We expect TEST_DENIED because when we setup appcontainer through lowbox way
rvargas (doing something else) 2015/02/28 01:10:06 nit: Actually, I think we can remove the whole com
Shrikant Kelkar 2015/02/28 01:55:41 Done.
147 // we are missing out on some initial setup of BNO and things like that, which
148 // seem to force NtOpenEvent to look for the object only inside
149 // AppContainerBasedNameObject namespace, where it doesn't find the required
150 // object.
151 TEST(AppContainerTest, DenyOpenEventForLowBox) {
152 if (base::win::OSInfo::GetInstance()->version() < base::win::VERSION_WIN8)
153 return;
154
155 TestRunner runner(JOB_UNPROTECTED, USER_UNPROTECTED, USER_UNPROTECTED);
156
157 base::win::ScopedHandle event(CreateEvent(NULL, FALSE, FALSE, L"test"));
158 ASSERT_TRUE(event.IsValid());
159
160 EXPECT_EQ(SBOX_ALL_OK, runner.GetPolicy()->SetLowBox(kAppContainerSid));
161
162 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_Open f test"));
163 }
rvargas (doing something else) 2015/02/28 01:10:06 caveat: missing more tests for a future CL (as in,
Shrikant Kelkar 2015/02/28 01:55:41 Done.
164
144 } // namespace sandbox 165 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | sandbox/win/src/broker_services.cc » ('j') | sandbox/win/src/sandbox_policy.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698