Bug 1055670: Disable remote lookups (r=gcp)

This commit is contained in:
Monica Chew 2014-08-19 12:57:58 -07:00
parent 72652a658e
commit de3cc41dc4
2 changed files with 12 additions and 8 deletions

View File

@ -980,7 +980,11 @@ pref("browser.safebrowsing.reportMalwareURL", "http://%LOCALE%.malware-report.mo
pref("browser.safebrowsing.reportMalwareErrorURL", "http://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%");
pref("browser.safebrowsing.malware.reportURL", "https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
// Turn off remote lookups in beta and stable channel.
#ifndef RELEASE_BUILD
pref("browser.safebrowsing.appRepURL", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
#endif
#ifdef MOZILLA_OFFICIAL
// Normally the "client ID" sent in updates is appinfo.name, but for

View File

@ -422,6 +422,14 @@ PendingLookup::LookupNext()
return lookup->LookupSpec(spec, true);
}
#ifdef XP_WIN
// If there is no service URL for querying application reputation, abort.
nsCString serviceUrl;
NS_ENSURE_SUCCESS(Preferences::GetCString(PREF_SB_APP_REP_URL, &serviceUrl),
NS_ERROR_NOT_AVAILABLE);
if (serviceUrl.EqualsLiteral("")) {
return OnComplete(false, NS_ERROR_NOT_AVAILABLE);
}
// There are no more URIs to check against local list. If the file is not
// eligible for remote lookup, bail.
if (!IsBinaryFile()) {
@ -1066,14 +1074,6 @@ nsresult ApplicationReputationService::QueryReputationInternal(
return NS_ERROR_NOT_AVAILABLE;
}
// If there is no service URL for querying application reputation, abort.
nsCString serviceUrl;
NS_ENSURE_SUCCESS(Preferences::GetCString(PREF_SB_APP_REP_URL, &serviceUrl),
NS_ERROR_NOT_AVAILABLE);
if (serviceUrl.EqualsLiteral("")) {
return NS_ERROR_NOT_AVAILABLE;
}
nsCOMPtr<nsIURI> uri;
rv = aQuery->GetSourceURI(getter_AddRefs(uri));
NS_ENSURE_SUCCESS(rv, rv);