Bug 1167493 - Application Reputation: disable remote lookup of zip files on Mac/Linux. r=gcp, a=sledru
authorFrancois Marier <francois@mozilla.com>
Sat, 23 May 2015 20:05:37 +1200
changeset 267626 80cde01ed15c67830de1cdf270299577596dccee
parent 267625 5c4d05edc7cf2f603ebea2e4b72f7f77fe8ce770
child 267627 415472b5a680be50f6ae2a95da2f98e939a39dfa
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp, sledru
bugs1167493
milestone39.0
Bug 1167493 - Application Reputation: disable remote lookup of zip files on Mac/Linux. r=gcp, a=sledru
toolkit/components/downloads/ApplicationReputation.cpp
--- a/toolkit/components/downloads/ApplicationReputation.cpp
+++ b/toolkit/components/downloads/ApplicationReputation.cpp
@@ -374,16 +374,20 @@ PendingLookup::IsBinaryFile()
   if (NS_FAILED(rv)) {
     LOG(("No suggested filename [this = %p]", this));
     return false;
   }
   LOG(("Suggested filename: %s [this = %p]",
        NS_ConvertUTF16toUTF8(fileName).get(), this));
   return
     // From https://code.google.com/p/chromium/codesearch#chromium/src/chrome/common/safe_browsing/download_protection_util.cc&l=14
+    // Archives _may_ contain binaries
+#ifdef XP_WIN // disable on Mac/Linux, see 1167493
+    StringEndsWith(fileName, NS_LITERAL_STRING(".zip")) ||
+#endif
     // Android extensions
     StringEndsWith(fileName, NS_LITERAL_STRING(".apk")) ||
     // Windows extensions
     StringEndsWith(fileName, NS_LITERAL_STRING(".bas")) ||
     StringEndsWith(fileName, NS_LITERAL_STRING(".bat")) ||
     StringEndsWith(fileName, NS_LITERAL_STRING(".cab")) ||
     StringEndsWith(fileName, NS_LITERAL_STRING(".cmd")) ||
     StringEndsWith(fileName, NS_LITERAL_STRING(".com")) ||
@@ -394,19 +398,17 @@ PendingLookup::IsBinaryFile()
     StringEndsWith(fileName, NS_LITERAL_STRING(".reg")) ||
     StringEndsWith(fileName, NS_LITERAL_STRING(".scr")) ||
     StringEndsWith(fileName, NS_LITERAL_STRING(".vb")) ||
     StringEndsWith(fileName, NS_LITERAL_STRING(".vbs")) ||
     // Mac extensions
     StringEndsWith(fileName, NS_LITERAL_STRING(".app")) ||
     StringEndsWith(fileName, NS_LITERAL_STRING(".dmg")) ||
     StringEndsWith(fileName, NS_LITERAL_STRING(".osx")) ||
-    StringEndsWith(fileName, NS_LITERAL_STRING(".pkg")) ||
-    // Archives _may_ contain binaries
-    StringEndsWith(fileName, NS_LITERAL_STRING(".zip"));
+    StringEndsWith(fileName, NS_LITERAL_STRING(".pkg"));
 }
 
 ClientDownloadRequest::DownloadType
 PendingLookup::GetDownloadType(const nsAString& aFilename) {
   MOZ_ASSERT(IsBinaryFile());
 
   // From https://code.google.com/p/chromium/codesearch#chromium/src/chrome/common/safe_browsing/download_protection_util.cc&l=46
   if (StringEndsWith(aFilename, NS_LITERAL_STRING(".zip"))) {