ratonvirus 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0ee734de35bb79c99398afaf866f42c87e023aa4ab813ee8e582f4a1ea89597
4
- data.tar.gz: 3d15112835af1745bf61d7d7a0d6017a31b4e1d638211d26e909564baa19e733
3
+ metadata.gz: cc7e931fe59e66c07af39b8468730cb9f4c23e7680bd1a6110c1598cab73e328
4
+ data.tar.gz: 3bd536062079bb898448a87688563ec82abca7d04b075731f7a5a2002a6ea901
5
5
  SHA512:
6
- metadata.gz: a663b2d27b3c98c8f4d83093cb87f4dc5f7ad87cdd8897358a923d1105ff69cfcd1bbb10831b657aad6d1bf1ef84a7b1ef42ed4817eccdb27782fbf081be3b7d
7
- data.tar.gz: 5ba1e916ee109f4988c46c6bc325be84616af57f9a35b28390f55ea616b24a15de6a812d4dcbc58df11006b1d80b2636b4880c70abd45e517551392d64afc239
6
+ metadata.gz: 81b5a5ebb0c057392a0923d6c1cd292044845423d8459d0eec21c02d261ab581b0e6aaae23457ea28453fe7221154f2619f24d2b1b8202ce74e469ea446913b6
7
+ data.tar.gz: 3dab899e7141a7bdac10bb2bf4bc3c003744f8923fb4375e26cc79dc82b8efbfb6809bf221fc600daa07be78b5c7403e7dca80db23022f4a1d9944a6b3512b41
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # v0.3.1
2
+
3
+ Fixed:
4
+
5
+ - Issue related to the EICAR test scanner. Related to [#16](https://github.com/mainio/ratonvirus/pull/16)
6
+
1
7
  # v0.3.0
2
8
 
3
9
  Changed:
@@ -18,6 +24,12 @@ a changes concept in the library which this update takes in to account. In the n
18
24
  to the storage service before the validations have been successful, which led to rethinking how this storage engine
19
25
  works in Ratonvirus.
20
26
 
27
+ # v0.1.2
28
+
29
+ Fixed:
30
+
31
+ - Backport: Issue related with scanning files with CarrierWave storage engine using remote storage engines such as Fog.
32
+ Related to #9
21
33
 
22
34
  # v0.1.1
23
35
 
@@ -8,7 +8,13 @@ module Ratonvirus
8
8
  class Eicar < Base
9
9
  # SHA256 digest of the EICAR test file for virus testing
10
10
  # See: https://en.wikipedia.org/wiki/EICAR_test_file
11
- EICAR_SHA256 = "131f95c51cc819465fa1797f6ccacf9d494aaaff46fa3eac73ae63ffbdfd8267"
11
+ #
12
+ # This includes both, the default hash and a hash with for the file saved
13
+ # with a newline at the end of it.
14
+ EICAR_SHA256 = %w(
15
+ 275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f
16
+ 131f95c51cc819465fa1797f6ccacf9d494aaaff46fa3eac73ae63ffbdfd8267
17
+ ).freeze
12
18
 
13
19
  class << self
14
20
  def executable?
@@ -21,7 +27,7 @@ module Ratonvirus
21
27
  def run_scan(path)
22
28
  if File.file?(path)
23
29
  sha256 = Digest::SHA256.file path
24
- errors << :antivirus_virus_detected if sha256 == EICAR_SHA256
30
+ errors << :antivirus_virus_detected if EICAR_SHA256.include?(sha256.to_s)
25
31
  else
26
32
  errors << :antivirus_file_not_found
27
33
  end
@@ -37,8 +37,11 @@ module Ratonvirus
37
37
 
38
38
  def asset_remove(asset)
39
39
  path = asset.file.path
40
+ delete_dir = asset.file.is_a?(::CarrierWave::SanitizedFile)
40
41
  asset.remove!
41
42
 
43
+ return unless delete_dir
44
+
42
45
  # Remove the temp cache dir if it exists
43
46
  dir = File.dirname(path)
44
47
  FileUtils.remove_dir(dir) if File.directory?(dir)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ratonvirus
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ratonvirus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antti Hukkanen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-05 00:00:00.000000000 Z
11
+ date: 2022-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport