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

Unified Diff: chrome/browser/chromeos/cros/network_library_impl_base.cc

Issue 11578005: Rejecting networks/certificates independently on ONC import and policy loading. (Closed) Base URL: http://git.chromium.org/chromium/src.git@reject_network_independently
Patch Set: Initial patch. 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/chromeos/cros/network_library_impl_base.cc
diff --git a/chrome/browser/chromeos/cros/network_library_impl_base.cc b/chrome/browser/chromeos/cros/network_library_impl_base.cc
index 768af924d1b0e5fe5e3ee7d049a360b7a4e15146..450085f4b6a8e833458d61a455f4a0f9108de2b0 100644
--- a/chrome/browser/chromeos/cros/network_library_impl_base.cc
+++ b/chrome/browser/chromeos/cros/network_library_impl_base.cc
@@ -1085,6 +1085,8 @@ bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob,
return false;
}
+ bool error_occurred = false;
stevenjb 2012/12/14 01:09:16 nit: 'success = true' would match the return value
+
const base::ListValue* certificates;
bool has_certificates =
root_dict->GetListWithoutPathExpansion(onc::kCertificates, &certificates);
@@ -1101,8 +1103,8 @@ bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob,
if (cert_importer.ParseAndStoreCertificates(*certificates) !=
onc::CertificateImporter::IMPORT_OK) {
LOG(ERROR) << "Cannot parse some of the certificates in the ONC from "
- << onc::GetSourceAsString(source);
- return false;
+ << onc::GetSourceAsString(source);
+ error_occurred = true;
}
}
@@ -1123,7 +1125,8 @@ bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob,
if (!network) {
LOG(ERROR) << "Error during ONC parsing network at index " << i
<< " from " << onc::GetSourceAsString(source);
- return false;
+ error_occurred = true;
+ continue;
}
// Disallow anything but WiFi and Ethernet for device-level policy (which
@@ -1210,14 +1213,11 @@ bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob,
// ONC blob. We first collect the networks and do the actual deletion later
// because ForgetNetwork() changes the remembered network vectors.
ForgetNetworksById(source, network_ids, false);
- } else if (source == onc::ONC_SOURCE_USER_IMPORT) {
- if (removal_ids.empty())
- return true;
-
+ } else if (source == onc::ONC_SOURCE_USER_IMPORT && !removal_ids.empty()) {
ForgetNetworksById(source, removal_ids, true);
}
- return true;
+ return !error_occurred;
}
////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « chrome/browser/chromeos/cros/network_library.h ('k') | chrome/browser/policy/network_configuration_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698