clamby 1.2.5 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b01112eed29677aba4c41681568068a07d1fd44f
4
- data.tar.gz: ea48a1a4470c40bcdc5e5d19ccda1c3013f711a5
3
+ metadata.gz: edb162206fdfb7dde77a731db954904ff0820e83
4
+ data.tar.gz: '069980cc92fa7a0fafa00023bdb8c1b7149c1515'
5
5
  SHA512:
6
- metadata.gz: fa1d122187e6860f951be981e45fddc4cc7ba816228f4b0665954595f90a93653b205f24099e6a0df5aae99c79234337f1f89126cb770d607576ece7890c5d0d
7
- data.tar.gz: 330b3bea8825e486404436c55e0b18ba4848673aa5e19e6f6b0fc75a62ce05d056db0d28ab3fc8d52ec2c99cb69dc6ae393a7dccf07949234b4b32ee55b90a95
6
+ metadata.gz: 4ae23ce1f09e0459784dfe12d69a3abaff9baaa871cd53649ecfc2e3d6394d14594286201f51710d043f68e35f29fed522a788d6b75993900c1a594c861d6ed8
7
+ data.tar.gz: 3f196f2bf45fcec04813d7e923d665d97c7e5ffbdd9c205afb75d3ac7b3048c395effdeeb75154200aaf9b2857cf3c088215a1963b3adfd5a60dd2e05710f14e
@@ -4,9 +4,10 @@ before_install:
4
4
  - gem install rake
5
5
  - gem install rspec
6
6
  rvm:
7
- - 1.9.3
8
7
  - 2.0.0
9
8
  - 2.1.1
9
+ - 2.3.4
10
+ - 2.4.1
10
11
  install:
11
12
  - sudo apt-get install clamav
12
13
  - sudo freshclam
@@ -1,3 +1,6 @@
1
+ #v1.3.0
2
+ - Fixed Dangerous Send on `system_command` method
3
+
1
4
  #v1.2.5
2
5
  - [bess](https://github.com/kobaltz/clamby/commits/master?author=bess) added `fdpass` option
3
6
 
@@ -27,17 +27,19 @@ module Clamby
27
27
  # @param [String] path path to the file being scanned
28
28
  # @return [String] command to be executed
29
29
  def self.system_command(path)
30
- command = clamd_executable_name
31
- command += ' --fdpass' if @config[:fdpass]
32
- command += " #{path}"
33
- command += ' --no-summary'
30
+ command = [].tap do |cmd|
31
+ cmd << clamd_executable_name
32
+ cmd << '--fdpass' if @config[:fdpass]
33
+ cmd << path
34
+ cmd << '--no-summary'
35
+ end
34
36
  command
35
37
  end
36
38
 
37
39
  def self.virus?(path)
38
40
  return nil unless scanner_exists?
39
41
  return nil unless file_exists?(path)
40
- scanner = system(system_command(path))
42
+ scanner = system(*system_command(path))
41
43
 
42
44
  return false if scanner
43
45
  return true unless @config[:error_file_virus]
@@ -1,3 +1,3 @@
1
1
  module Clamby
2
- VERSION = "1.2.5"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -61,11 +61,11 @@ describe Clamby do
61
61
  end
62
62
  it 'does not include fdpass in the command by default' do
63
63
  Clamby.configure(fdpass: false)
64
- expect(Clamby.system_command(good_path)).to eq "clamscan #{good_path} --no-summary"
64
+ expect(Clamby.system_command(good_path)).to eq ["clamscan", good_path, "--no-summary"]
65
65
  end
66
66
  it 'passes the fdpass option when invoking clamscan if it is set' do
67
67
  Clamby.configure(fdpass: true)
68
- expect(Clamby.system_command(good_path)).to eq "clamscan --fdpass #{good_path} --no-summary"
68
+ expect(Clamby.system_command(good_path)).to eq ["clamscan", "--fdpass", good_path, "--no-summary"]
69
69
  end
70
70
  end
71
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clamby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kobaltz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-12 00:00:00.000000000 Z
11
+ date: 2017-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler