unrar.patch 2.9 KB

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