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

Side by Side Diff: chrome_frame/module_utils.cc

Issue 5057007: Remove a DCHECK when failing to secure the shared memory used to hold the cur... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome_frame/module_utils.h" 5 #include "chrome_frame/module_utils.h"
6 6
7 #include <aclapi.h> 7 #include <aclapi.h>
8 #include <atlbase.h> 8 #include <atlbase.h>
9 #include <atlsecurity.h> 9 #include <atlsecurity.h>
10 #include <sddl.h> 10 #include <sddl.h>
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 bool created_beacon = true; 143 bool created_beacon = true;
144 bool result = shared_memory_->CreateNamed(shared_memory_name_.c_str(), 144 bool result = shared_memory_->CreateNamed(shared_memory_name_.c_str(),
145 false, // open_existing 145 false, // open_existing
146 kSharedMemorySize); 146 kSharedMemorySize);
147 147
148 if (result) { 148 if (result) {
149 // We created the beacon, now we need to mutate the security attributes 149 // We created the beacon, now we need to mutate the security attributes
150 // on the shared memory to allow read-only access and let low-integrity 150 // on the shared memory to allow read-only access and let low-integrity
151 // processes open it. 151 // processes open it. This will fail on FAT32 file systems.
152 bool acls_set = SetFileMappingToReadOnly(shared_memory_->handle()); 152 if (!SetFileMappingToReadOnly(shared_memory_->handle())) {
153 DCHECK(acls_set); 153 DLOG(ERROR) << "Failed to set file mapping permissions.";
154 }
154 } else { 155 } else {
155 created_beacon = false; 156 created_beacon = false;
156 157
157 // We failed to create the shared memory segment, suggesting it may already 158 // We failed to create the shared memory segment, suggesting it may already
158 // exist: try to create it read-only. 159 // exist: try to create it read-only.
159 result = shared_memory_->Open(shared_memory_name_.c_str(), 160 result = shared_memory_->Open(shared_memory_name_.c_str(),
160 true /* read_only */); 161 true /* read_only */);
161 } 162 }
162 163
163 if (result) { 164 if (result) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 277
277 HMODULE hmodule = LoadLibrary(module_path.value().c_str()); 278 HMODULE hmodule = LoadLibrary(module_path.value().c_str());
278 if (hmodule == NULL) { 279 if (hmodule == NULL) {
279 DPLOG(ERROR) << "Could not load reported module version " 280 DPLOG(ERROR) << "Could not load reported module version "
280 << version->GetString(); 281 << version->GetString();
281 } 282 }
282 283
283 return hmodule; 284 return hmodule;
284 } 285 }
285 286
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698