From: Michael Gilbert Date: Wed, 21 Nov 2018 02:37:35 +0000 Subject: Disable support for RAR files inspection --- .../download_protection/file_analyzer.cc | 2 +- chrome/common/safe_browsing/BUILD.gn | 33 ------------------- .../file_util/safe_archive_analyzer.cc | 4 +-- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc --- a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc +++ b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc @@ -90,7 +90,7 @@ void FileAnalyzer::Start(const base::FilePath& target_path, if (inspection_type == DownloadFileType::ZIP) { StartExtractZipFeatures(); } else if (inspection_type == DownloadFileType::RAR) { - StartExtractRarFeatures(); + LOG(WARNING) << "Safebrowser inspection of rar files is disabled in this build"; #if defined(OS_MAC) } else if (inspection_type == DownloadFileType::DMG) { StartExtractDmgFeatures(); diff --git a/chrome/common/safe_browsing/BUILD.gn b/chrome/common/safe_browsing/BUILD.gn --- a/chrome/common/safe_browsing/BUILD.gn +++ b/chrome/common/safe_browsing/BUILD.gn @@ -41,38 +41,6 @@ if (safe_browsing_mode == 1) { public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ] } - source_set("rar_analyzer") { - sources = [ - "rar_analyzer.cc", - "rar_analyzer.h", - ] - - deps = [ - ":archive_analyzer_results", - ":download_type_util", - "//base", - "//base:i18n", - "//components/safe_browsing/core/common", - "//third_party/unrar:unrar", - ] - - defines = [ - "_FILE_OFFSET_BITS=64", - "LARGEFILE_SOURCE", - "RAR_SMP", - "SILENT", - - # The following is set to disable certain macro definitions in the unrar - # source code. - "CHROMIUM_UNRAR", - - # Disables exceptions in unrar, replaces them with process termination. - "UNRAR_NO_EXCEPTIONS", - ] - - public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ] - } - if (is_mac) { source_set("disk_image_type_sniffer_mac") { sources = [ @@ -142,7 +110,6 @@ source_set("safe_browsing") { ":archive_analyzer_results", ":binary_feature_extractor", ":download_type_util", - ":rar_analyzer", "//components/safe_browsing/core/common", ] diff --git a/chrome/services/file_util/safe_archive_analyzer.cc b/chrome/services/file_util/safe_archive_analyzer.cc --- a/chrome/services/file_util/safe_archive_analyzer.cc +++ b/chrome/services/file_util/safe_archive_analyzer.cc @@ -7,7 +7,6 @@ #include "base/macros.h" #include "build/build_config.h" #include "chrome/common/safe_browsing/archive_analyzer_results.h" -#include "chrome/common/safe_browsing/rar_analyzer.h" #include "chrome/common/safe_browsing/zip_analyzer.h" #if defined(OS_MAC) @@ -47,8 +46,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file, AnalyzeRarFileCallback callback) { DCHECK(rar_file.IsValid()); + LOG(FATAL) << "AnalyzeRarFile is disabled in this build"; safe_browsing::ArchiveAnalyzerResults results; - safe_browsing::rar_analyzer::AnalyzeRarFile( - std::move(rar_file), std::move(temporary_file), &results); std::move(callback).Run(results); } -- 2.17.1