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

Unified Diff: sandbox/win/src/handle_closer.cc

Issue 430753002: Resolve registry root paths in HandleCloser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/sandbox_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/handle_closer.cc
diff --git a/sandbox/win/src/handle_closer.cc b/sandbox/win/src/handle_closer.cc
index 30e8977fa85d52f5b83dfcd2070900108d68c910..4111623038f8310e8fe89e6fb2cfbfcd0ee1df35 100644
--- a/sandbox/win/src/handle_closer.cc
+++ b/sandbox/win/src/handle_closer.cc
@@ -39,17 +39,25 @@ ResultCode HandleCloser::AddHandle(const base::char16* handle_type,
if (!handle_type)
return SBOX_ERROR_BAD_PARAMS;
+ base::string16 resolved_name;
+ if (handle_name) {
+ resolved_name = handle_name;
+ if (handle_type == base::string16(L"Key"))
cpu_(ooo_6.6-7.5) 2014/08/13 23:18:35 can you use == L"key"; so avoids constructing a st
+ if (!ResolveRegistryName(resolved_name, &resolved_name))
+ return SBOX_ERROR_BAD_PARAMS;
+ }
+
HandleMap::iterator names = handles_to_close_.find(handle_type);
if (names == handles_to_close_.end()) { // We have no entries for this type.
std::pair<HandleMap::iterator, bool> result = handles_to_close_.insert(
HandleMap::value_type(handle_type, HandleMap::mapped_type()));
names = result.first;
if (handle_name)
- names->second.insert(handle_name);
+ names->second.insert(resolved_name);
} else if (!handle_name) { // Now we need to close all handles of this type.
names->second.clear();
} else if (!names->second.empty()) { // Add another name for this type.
- names->second.insert(handle_name);
+ names->second.insert(resolved_name);
} // If we're already closing all handles of type then we're done.
return SBOX_ALL_OK;
« no previous file with comments | « content/common/sandbox_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698