unrar.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. description: disable support for safe browsing inspection of rar files
  2. author: Michael Gilbert <mgilbert@debian.org>
  3. bug: http://bugs.debian.org/914487
  4. --- a/chrome/common/safe_browsing/BUILD.gn
  5. +++ b/chrome/common/safe_browsing/BUILD.gn
  6. @@ -64,41 +64,6 @@ if (safe_browsing_mode == 1) {
  7. ]
  8. }
  9. - source_set("rar_analyzer") {
  10. - sources = [
  11. - "rar_analyzer.cc",
  12. - "rar_analyzer.h",
  13. - ]
  14. -
  15. - deps = [
  16. - ":archive_analyzer_results",
  17. - ":download_type_util",
  18. - ":file_type_policies",
  19. - "//base",
  20. - "//base:i18n",
  21. - "//components/safe_browsing:features",
  22. - "//third_party/unrar:unrar",
  23. - ]
  24. -
  25. - defines = [
  26. - "_FILE_OFFSET_BITS=64",
  27. - "LARGEFILE_SOURCE",
  28. - "RAR_SMP",
  29. - "SILENT",
  30. -
  31. - # The following is set to disable certain macro definitions in the unrar
  32. - # source code.
  33. - "CHROMIUM_UNRAR",
  34. -
  35. - # Disables exceptions in unrar, replaces them with process termination.
  36. - "UNRAR_NO_EXCEPTIONS",
  37. - ]
  38. -
  39. - public_deps = [
  40. - "//components/safe_browsing:csd_proto",
  41. - ]
  42. - }
  43. -
  44. source_set("disk_image_type_sniffer_mac") {
  45. sources = [
  46. "disk_image_type_sniffer_mac.cc",
  47. @@ -167,7 +132,6 @@ source_set("safe_browsing") {
  48. ":archive_analyzer_results",
  49. ":binary_feature_extractor",
  50. ":download_type_util",
  51. - ":rar_analyzer",
  52. "//components/safe_browsing:features",
  53. ]
  54. --- a/chrome/services/file_util/safe_archive_analyzer.cc
  55. +++ b/chrome/services/file_util/safe_archive_analyzer.cc
  56. @@ -7,7 +7,6 @@
  57. #include "base/macros.h"
  58. #include "build/build_config.h"
  59. #include "chrome/common/safe_browsing/archive_analyzer_results.h"
  60. -#include "chrome/common/safe_browsing/rar_analyzer.h"
  61. #include "chrome/common/safe_browsing/zip_analyzer.h"
  62. #include "mojo/public/cpp/bindings/strong_binding.h"
  63. @@ -50,8 +49,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
  64. AnalyzeRarFileCallback callback) {
  65. DCHECK(rar_file.IsValid());
  66. + LOG(FATAL) << "AnalyzeRarFile is disabled in this build";
  67. safe_browsing::ArchiveAnalyzerResults results;
  68. - safe_browsing::rar_analyzer::AnalyzeRarFile(
  69. - std::move(rar_file), std::move(temporary_file), &results);
  70. std::move(callback).Run(results);
  71. }
  72. --- a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
  73. +++ b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
  74. @@ -97,7 +97,7 @@ void FileAnalyzer::Start(const base::Fil
  75. if (inspection_type == DownloadFileType::ZIP) {
  76. StartExtractZipFeatures();
  77. } else if (inspection_type == DownloadFileType::RAR) {
  78. - StartExtractRarFeatures();
  79. + LOG(WARNING) << "Safebrowser inspection of rar files is disabled in this build";
  80. #if defined(OS_MACOSX)
  81. } else if (inspection_type == DownloadFileType::DMG) {
  82. StartExtractDmgFeatures();