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/sandbox_policy_base.h" | 5 #include "sandbox/win/src/sandbox_policy_base.h" |
6 | 6 |
7 #include <sddl.h> | 7 #include <sddl.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 stdout_handle_(INVALID_HANDLE_VALUE), | 130 stdout_handle_(INVALID_HANDLE_VALUE), |
131 stderr_handle_(INVALID_HANDLE_VALUE), | 131 stderr_handle_(INVALID_HANDLE_VALUE), |
132 integrity_level_(INTEGRITY_LEVEL_LAST), | 132 integrity_level_(INTEGRITY_LEVEL_LAST), |
133 delayed_integrity_level_(INTEGRITY_LEVEL_LAST), | 133 delayed_integrity_level_(INTEGRITY_LEVEL_LAST), |
134 mitigations_(0), | 134 mitigations_(0), |
135 delayed_mitigations_(0), | 135 delayed_mitigations_(0), |
136 is_csrss_connected_(true), | 136 is_csrss_connected_(true), |
137 policy_maker_(NULL), | 137 policy_maker_(NULL), |
138 policy_(NULL), | 138 policy_(NULL), |
139 lowbox_sid_(NULL), | 139 lowbox_sid_(NULL), |
140 lockdown_default_dacl_(false) { | 140 lockdown_default_dacl_(false), |
| 141 enable_opm_redirection_(false) { |
141 ::InitializeCriticalSection(&lock_); | 142 ::InitializeCriticalSection(&lock_); |
142 dispatcher_.reset(new TopLevelDispatcher(this)); | 143 dispatcher_.reset(new TopLevelDispatcher(this)); |
143 } | 144 } |
144 | 145 |
145 PolicyBase::~PolicyBase() { | 146 PolicyBase::~PolicyBase() { |
146 TargetSet::iterator it; | 147 TargetSet::iterator it; |
147 for (it = targets_.begin(); it != targets_.end(); ++it) { | 148 for (it = targets_.begin(); it != targets_.end(); ++it) { |
148 TargetProcess* target = (*it); | 149 TargetProcess* target = (*it); |
149 delete target; | 150 delete target; |
150 } | 151 } |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 } | 657 } |
657 | 658 |
658 HANDLE PolicyBase::GetStdoutHandle() { | 659 HANDLE PolicyBase::GetStdoutHandle() { |
659 return stdout_handle_; | 660 return stdout_handle_; |
660 } | 661 } |
661 | 662 |
662 HANDLE PolicyBase::GetStderrHandle() { | 663 HANDLE PolicyBase::GetStderrHandle() { |
663 return stderr_handle_; | 664 return stderr_handle_; |
664 } | 665 } |
665 | 666 |
| 667 void PolicyBase::SetEnableOPMRedirection() { |
| 668 enable_opm_redirection_ = true; |
| 669 } |
| 670 |
| 671 bool PolicyBase::GetEnableOPMRedirection() { |
| 672 return enable_opm_redirection_; |
| 673 } |
| 674 |
666 bool PolicyBase::SetupAllInterceptions(TargetProcess* target) { | 675 bool PolicyBase::SetupAllInterceptions(TargetProcess* target) { |
667 InterceptionManager manager(target, relaxed_interceptions_); | 676 InterceptionManager manager(target, relaxed_interceptions_); |
668 | 677 |
669 if (policy_) { | 678 if (policy_) { |
670 for (int i = 0; i < IPC_LAST_TAG; i++) { | 679 for (int i = 0; i < IPC_LAST_TAG; i++) { |
671 if (policy_->entry[i] && !dispatcher_->SetupService(&manager, i)) | 680 if (policy_->entry[i] && !dispatcher_->SetupService(&manager, i)) |
672 return false; | 681 return false; |
673 } | 682 } |
674 } | 683 } |
675 | 684 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 break; | 777 break; |
769 } | 778 } |
770 | 779 |
771 default: { return SBOX_ERROR_UNSUPPORTED; } | 780 default: { return SBOX_ERROR_UNSUPPORTED; } |
772 } | 781 } |
773 | 782 |
774 return SBOX_ALL_OK; | 783 return SBOX_ALL_OK; |
775 } | 784 } |
776 | 785 |
777 } // namespace sandbox | 786 } // namespace sandbox |
OLD | NEW |