OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 std::string service_name; | 61 std::string service_name; |
62 base::mac::ScopedMachReceiveRight local_port; | 62 base::mac::ScopedMachReceiveRight local_port; |
63 base::mac::ScopedMachSendRight remote_port; | 63 base::mac::ScopedMachSendRight remote_port; |
64 base::mac::ScopedMachSendRight child_task; // valid only in parent | 64 base::mac::ScopedMachSendRight child_task; // valid only in parent |
65 }; | 65 }; |
66 | 66 |
67 } // namespace internal | 67 } // namespace internal |
68 | 68 |
69 MachMultiprocess::MachMultiprocess() : Multiprocess(), info_(NULL) { | 69 MachMultiprocess::MachMultiprocess() : Multiprocess(), info_(nullptr) { |
70 } | 70 } |
71 | 71 |
72 void MachMultiprocess::Run() { | 72 void MachMultiprocess::Run() { |
73 ASSERT_EQ(NULL, info_); | 73 ASSERT_EQ(nullptr, info_); |
74 scoped_ptr<internal::MachMultiprocessInfo> info( | 74 scoped_ptr<internal::MachMultiprocessInfo> info( |
75 new internal::MachMultiprocessInfo); | 75 new internal::MachMultiprocessInfo); |
76 base::AutoReset<internal::MachMultiprocessInfo*> reset_info(&info_, | 76 base::AutoReset<internal::MachMultiprocessInfo*> reset_info(&info_, |
77 info.get()); | 77 info.get()); |
78 | 78 |
79 return Multiprocess::Run(); | 79 return Multiprocess::Run(); |
80 } | 80 } |
81 | 81 |
82 MachMultiprocess::~MachMultiprocess() { | 82 MachMultiprocess::~MachMultiprocess() { |
83 } | 83 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 pid_t audit_pid; | 163 pid_t audit_pid; |
164 au_asid_t audit_asid; | 164 au_asid_t audit_asid; |
165 audit_token_to_au32(message.audit_trailer.msgh_audit, | 165 audit_token_to_au32(message.audit_trailer.msgh_audit, |
166 &audit_auid, | 166 &audit_auid, |
167 &audit_euid, | 167 &audit_euid, |
168 &audit_egid, | 168 &audit_egid, |
169 &audit_ruid, | 169 &audit_ruid, |
170 &audit_rgid, | 170 &audit_rgid, |
171 &audit_pid, | 171 &audit_pid, |
172 &audit_asid, | 172 &audit_asid, |
173 NULL); | 173 nullptr); |
174 #else | 174 #else |
175 uid_t audit_auid = audit_token_to_auid(message.audit_trailer.msgh_audit); | 175 uid_t audit_auid = audit_token_to_auid(message.audit_trailer.msgh_audit); |
176 uid_t audit_euid = audit_token_to_euid(message.audit_trailer.msgh_audit); | 176 uid_t audit_euid = audit_token_to_euid(message.audit_trailer.msgh_audit); |
177 gid_t audit_egid = audit_token_to_egid(message.audit_trailer.msgh_audit); | 177 gid_t audit_egid = audit_token_to_egid(message.audit_trailer.msgh_audit); |
178 uid_t audit_ruid = audit_token_to_ruid(message.audit_trailer.msgh_audit); | 178 uid_t audit_ruid = audit_token_to_ruid(message.audit_trailer.msgh_audit); |
179 gid_t audit_rgid = audit_token_to_rgid(message.audit_trailer.msgh_audit); | 179 gid_t audit_rgid = audit_token_to_rgid(message.audit_trailer.msgh_audit); |
180 pid_t audit_pid = audit_token_to_pid(message.audit_trailer.msgh_audit); | 180 pid_t audit_pid = audit_token_to_pid(message.audit_trailer.msgh_audit); |
181 au_asid_t audit_asid = audit_token_to_asid(message.audit_trailer.msgh_audit); | 181 au_asid_t audit_asid = audit_token_to_asid(message.audit_trailer.msgh_audit); |
182 #endif | 182 #endif |
183 EXPECT_EQ(geteuid(), audit_euid); | 183 EXPECT_EQ(geteuid(), audit_euid); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if (testing::Test::HasFailure()) { | 270 if (testing::Test::HasFailure()) { |
271 // Trigger the ScopedForbidReturn destructor. | 271 // Trigger the ScopedForbidReturn destructor. |
272 return; | 272 return; |
273 } | 273 } |
274 | 274 |
275 forbid_return.Disarm(); | 275 forbid_return.Disarm(); |
276 } | 276 } |
277 | 277 |
278 } // namespace test | 278 } // namespace test |
279 } // namespace crashpad | 279 } // namespace crashpad |
OLD | NEW |