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

Unified Diff: chrome/browser/policy/configuration_policy_handler_chromeos.cc

Issue 11469026: Extending ONC validator's logging. Completing toplevel validation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@add_error_handling_to_validator
Patch Set: Rebased. Created 8 years 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
Index: chrome/browser/policy/configuration_policy_handler_chromeos.cc
diff --git a/chrome/browser/policy/configuration_policy_handler_chromeos.cc b/chrome/browser/policy/configuration_policy_handler_chromeos.cc
index 63a6874a7ae53d4ed49533b00c6b2ed96518b364..8dffe13c5478d57a0ac6e930defca6afe13398b7 100644
--- a/chrome/browser/policy/configuration_policy_handler_chromeos.cc
+++ b/chrome/browser/policy/configuration_policy_handler_chromeos.cc
@@ -52,7 +52,7 @@ bool NetworkConfigurationPolicyHandler::CheckPolicySettings(
scoped_ptr<base::DictionaryValue> root_dict =
onc::ReadDictionaryFromJson(onc_blob);
if (root_dict.get() == NULL) {
- errors->AddError(policy_name(), IDS_POLICY_NETWORK_CONFIG_PARSE_ERROR);
+ errors->AddError(policy_name(), IDS_POLICY_NETWORK_CONFIG_PARSE_FAILED);
return false;
}
@@ -64,16 +64,18 @@ bool NetworkConfigurationPolicyHandler::CheckPolicySettings(
true); // Validate for managed ONC
// ONC policies are always unencrypted.
+ onc::Validator::Result validation_result;
root_dict = validator.ValidateAndRepairObject(
- &onc::kUnencryptedConfigurationSignature,
- *root_dict);
-
- if (root_dict.get() == NULL) {
- errors->AddError(policy_name(), IDS_POLICY_NETWORK_CONFIG_PARSE_ERROR);
- // Don't reject the policy, as some networks or certificates could still
- // be applied.
- return true;
+ &onc::kToplevelConfigurationSignature, *root_dict, &validation_result);
+ if (validation_result == onc::Validator::VALID_WITH_WARNINGS) {
+ errors->AddError(policy_name(),
+ IDS_POLICY_NETWORK_CONFIG_IMPORT_PARTIAL);
+ } else if (validation_result == onc::Validator::INVALID) {
+ errors->AddError(policy_name(), IDS_POLICY_NETWORK_CONFIG_IMPORT_FAILED);
}
+
+ // In any case, don't reject the policy as some networks or certificates
+ // could still be applied.
}
return true;
« no previous file with comments | « chrome/browser/policy/configuration_policy_handler.cc ('k') | chrome/browser/policy/network_configuration_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698