Bug 1397546 - Allow Application Reputation lookups when the blacklist/whitelist is missing. r=francois
authorDimi Lee <dlee@mozilla.com>
Wed, 21 Nov 2018 19:43:06 +0000
changeset 504117 b7e40bdc132e6b0dbddc7e0a8fde8e3c0a04b957
parent 504116 5335dd9d85ca30c8e343040bf779337d95b1ea83
child 504118 eab58dd901f7d09fdc771c55853a37359a0c1c92
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrancois
bugs1397546
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1397546 - Allow Application Reputation lookups when the blacklist/whitelist is missing. r=francois Before landing this patch, download protection doesn't trigger a remote lookup when blocklist or allowlist is empty. After landing this patch, download protection triggers a remote lookup regardless if blocklist or allowlist is empty. This is safer default behavior in download protection. Differential Revision: https://phabricator.services.mozilla.com/D11621
toolkit/components/reputationservice/ApplicationReputation.cpp
--- a/toolkit/components/reputationservice/ApplicationReputation.cpp
+++ b/toolkit/components/reputationservice/ApplicationReputation.cpp
@@ -1417,39 +1417,16 @@ PendingLookup::SendRemoteQueryInternal()
   nsAutoCString serviceUrl;
   NS_ENSURE_SUCCESS(Preferences::GetCString(PREF_SB_APP_REP_URL, serviceUrl),
                     NS_ERROR_NOT_AVAILABLE);
   if (serviceUrl.IsEmpty()) {
     LOG(("Remote lookup URL is empty [this = %p]", this));
     return NS_ERROR_NOT_AVAILABLE;
   }
 
-  // If the blocklist or allowlist is empty (so we couldn't do local lookups),
-  // bail
-  {
-    nsAutoCString table;
-    NS_ENSURE_SUCCESS(Preferences::GetCString(PREF_DOWNLOAD_BLOCK_TABLE,
-                                              table),
-                      NS_ERROR_NOT_AVAILABLE);
-    if (table.IsEmpty()) {
-      LOG(("Blocklist is empty [this = %p]", this));
-      return NS_ERROR_NOT_AVAILABLE;
-    }
-  }
-  {
-    nsAutoCString table;
-    NS_ENSURE_SUCCESS(Preferences::GetCString(PREF_DOWNLOAD_ALLOW_TABLE,
-                                              table),
-                      NS_ERROR_NOT_AVAILABLE);
-    if (table.IsEmpty()) {
-      LOG(("Allowlist is empty [this = %p]", this));
-      return NS_ERROR_NOT_AVAILABLE;
-    }
-  }
-
   LOG(("Sending remote query for application reputation [this = %p]",
        this));
   // We did not find a local result, so fire off the query to the
   // application reputation service.
   nsCOMPtr<nsIURI> uri;
   nsresult rv;
   rv = mQuery->GetSourceURI(getter_AddRefs(uri));
   NS_ENSURE_SUCCESS(rv, rv);