| OLD | NEW |
| 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 "sandbox/win/src/broker_services.h" | 5 #include "sandbox/win/src/broker_services.h" |
| 6 | 6 |
| 7 #include <AclAPI.h> | 7 #include <AclAPI.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 // Brokerservices does not own the target object. It is owned by the Policy. | 480 // Brokerservices does not own the target object. It is owned by the Policy. |
| 481 base::win::ScopedProcessInformation process_info; | 481 base::win::ScopedProcessInformation process_info; |
| 482 TargetProcess* target = new TargetProcess(initial_token.Take(), | 482 TargetProcess* target = new TargetProcess(initial_token.Take(), |
| 483 lockdown_token.Take(), | 483 lockdown_token.Take(), |
| 484 job.Get(), | 484 job.Get(), |
| 485 thread_pool_); | 485 thread_pool_); |
| 486 | 486 |
| 487 DWORD win_result = target->Create(exe_path, command_line, inherit_handles, | 487 DWORD win_result = target->Create(exe_path, command_line, inherit_handles, |
| 488 policy_base->GetLowBoxSid() ? true : false, | 488 policy_base->GetLowBoxSid() ? true : false, |
| 489 startup_info, &process_info); | 489 startup_info, &process_info); |
| 490 if (ERROR_SUCCESS != win_result) | 490 if (ERROR_SUCCESS != win_result) { |
| 491 return SpawnCleanup(target, win_result); | 491 SpawnCleanup(target, win_result); |
| 492 return SBOX_ERROR_PROCESS_CREATE; |
| 493 } |
| 492 | 494 |
| 493 // Now the policy is the owner of the target. | 495 // Now the policy is the owner of the target. |
| 494 if (!policy_base->AddTarget(target)) { | 496 if (!policy_base->AddTarget(target)) { |
| 495 return SpawnCleanup(target, 0); | 497 return SpawnCleanup(target, 0); |
| 496 } | 498 } |
| 497 | 499 |
| 498 // We are going to keep a pointer to the policy because we'll call it when | 500 // We are going to keep a pointer to the policy because we'll call it when |
| 499 // the job object generates notifications using the completion port. | 501 // the job object generates notifications using the completion port. |
| 500 policy_base->AddRef(); | 502 policy_base->AddRef(); |
| 501 if (job.IsValid()) { | 503 if (job.IsValid()) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 return SBOX_ERROR_UNSUPPORTED; | 592 return SBOX_ERROR_UNSUPPORTED; |
| 591 | 593 |
| 592 base::string16 name = LookupAppContainer(sid); | 594 base::string16 name = LookupAppContainer(sid); |
| 593 if (name.empty()) | 595 if (name.empty()) |
| 594 return SBOX_ERROR_INVALID_APP_CONTAINER; | 596 return SBOX_ERROR_INVALID_APP_CONTAINER; |
| 595 | 597 |
| 596 return DeleteAppContainer(sid); | 598 return DeleteAppContainer(sid); |
| 597 } | 599 } |
| 598 | 600 |
| 599 } // namespace sandbox | 601 } // namespace sandbox |
| OLD | NEW |