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

Side by Side Diff: chrome/browser/component_updater/supervised_user_whitelist_installer.cc

Issue 1770313004: Not saving whitelist icon paths that reference the parent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/component_updater/supervised_user_whitelist_installer.h " 5 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h "
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const base::DictionaryValue* icons = nullptr; 71 const base::DictionaryValue* icons = nullptr;
72 if (!manifest.GetDictionary(kExtensionIcons, &icons)) 72 if (!manifest.GetDictionary(kExtensionIcons, &icons))
73 return base::FilePath(); 73 return base::FilePath();
74 74
75 base::FilePath path; 75 base::FilePath path;
76 const base::Value* path_value = nullptr; 76 const base::Value* path_value = nullptr;
77 if (!icons->Get(kExtensionLargeIcon, &path_value)) 77 if (!icons->Get(kExtensionLargeIcon, &path_value))
78 return base::FilePath(); 78 return base::FilePath();
79 if (!base::GetValueAsFilePath(*path_value, &path)) 79 if (!base::GetValueAsFilePath(*path_value, &path))
80 return base::FilePath(); 80 return base::FilePath();
81 // Path components ("..") are not allowed.
82 if (path.ReferencesParent())
83 return base::FilePath();
Marc Treib 2016/03/09 14:50:53 Probably the same should apply below for the raw w
atanasova 2016/03/10 10:35:28 Done.
Bernhard Bauer 2016/03/15 09:34:52 (The raw whitelists are read with ReadFileToString
81 84
82 return install_dir.Append(path); 85 return install_dir.Append(path);
83 } 86 }
84 87
85 base::FilePath GetRawWhitelistPath(const base::DictionaryValue& manifest, 88 base::FilePath GetRawWhitelistPath(const base::DictionaryValue& manifest,
86 const base::FilePath& install_dir) { 89 const base::FilePath& install_dir) {
87 const base::DictionaryValue* whitelist_dict = nullptr; 90 const base::DictionaryValue* whitelist_dict = nullptr;
88 if (!manifest.GetDictionary(kWhitelistedContent, &whitelist_dict)) 91 if (!manifest.GetDictionary(kWhitelistedContent, &whitelist_dict))
89 return base::FilePath(); 92 return base::FilePath();
90 93
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 619
617 // static 620 // static
618 void SupervisedUserWhitelistInstaller::TriggerComponentUpdate( 621 void SupervisedUserWhitelistInstaller::TriggerComponentUpdate(
619 OnDemandUpdater* updater, 622 OnDemandUpdater* updater,
620 const std::string& crx_id) { 623 const std::string& crx_id) {
621 const bool result = updater->OnDemandUpdate(crx_id); 624 const bool result = updater->OnDemandUpdate(crx_id);
622 DCHECK(result); 625 DCHECK(result);
623 } 626 }
624 627
625 } // namespace component_updater 628 } // namespace component_updater
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