diff options
author | jschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-15 03:20:25 +0000 |
---|---|---|
committer | jschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-15 03:21:43 +0000 |
commit | 9307a07c02cddbe1fa886fdf89204bea5b330d47 (patch) | |
tree | 5078ac3a908ee3e3401c90b573d59e8ef80f6f35 /sandbox | |
parent | ab84a8ce94b70c131f5292bdd3c1ec20072b3805 (diff) | |
download | chromium_src-9307a07c02cddbe1fa886fdf89204bea5b330d47.zip chromium_src-9307a07c02cddbe1fa886fdf89204bea5b330d47.tar.gz chromium_src-9307a07c02cddbe1fa886fdf89204bea5b330d47.tar.bz2 |
Resolve registry root paths in HandleCloser
BUG=349162
Review URL: https://codereview.chromium.org/430753002
Cr-Commit-Position: refs/heads/master@{#289764}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/win/src/handle_closer.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sandbox/win/src/handle_closer.cc b/sandbox/win/src/handle_closer.cc index 30e8977..4111623 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")) + 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; |