OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |