clamby 1.6.6 → 1.6.8

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
  SHA256:
3
- metadata.gz: e9bf0bfa99f769f41a964838dca46fcb5d6b4c2a2e1653ff43c3a40fde25480f
4
- data.tar.gz: 95615a8f2c69aa42a593f909a426266253026c7bc3d24a74dfabb13dd931c526
3
+ metadata.gz: 81853e9529f298f606bb599f22da044e9ada2f805d2d6f6635caac455450e93e
4
+ data.tar.gz: d122cf67adcfd0187c8fabd7153ca7fe20643b075f9bcfe77c8d482075462f74
5
5
  SHA512:
6
- metadata.gz: d4af568ba3f78fb465a18625ff9e9fca343de65b95b155b57cd3b7156d19db876457837331896c3c9c6767326a93f6dcf01f73c5518180df9ff95b7af8868b5e
7
- data.tar.gz: 3c2b5004c4b5dbb2fc627a2d20a79307361b5385b3b53dc0500fe1683430db9619d90a18e0aa414d28ce103bbbe9265409462c0d3845f0e6667a76ff788743a6
6
+ metadata.gz: c56dc7d74dfa3e29eeeca5d44b0cee9fc55efbc55269bcee95cd5108cb8c09ac8faa5a353bd6932ae7602adf1686bec8df4671a5afd57997bb0bdf605d2c2bdc
7
+ data.tar.gz: 85b9072343ce8061cb67ab7607a52570f6d42459e9ad3467c3497c381a9df6cdea3832435dd276e306b1b5fdc1a8bb415940e0a90371027f65497952f215a89b
data/.travis.yml CHANGED
@@ -9,7 +9,9 @@ rvm:
9
9
  - 2.5.3
10
10
  - 2.6.3
11
11
  - 2.6.5
12
- install:
12
+ - 2.6.6
13
+ - 2.7.2
14
+ install:
13
15
  - sudo apt-get install clamav
14
16
  - sudo freshclam
15
17
 
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v1.6.8
2
+ - [codezomb](https://github.com/kobaltz/clamby/commits?author=codezomb) - Allow paths to be escaped #37
3
+
1
4
  # v1.6.5
2
5
  - [bennacer860](https://github.com/kobaltz/clamby/commits?author=bennacer860) - Added config data dir option
3
6
 
@@ -25,7 +28,7 @@
25
28
 
26
29
  # v1.3.2
27
30
  - [emilong](https://github.com/kobaltz/clamby/commits/master?author=emilong) added `stream` option
28
-
31
+
29
32
  # v1.3.1
30
33
  - [zealot128](https://github.com/kobaltz/clamby/commits/master?author=zealot128) added `silence_output` option
31
34
 
@@ -43,7 +46,7 @@
43
46
  - Refactor of logic
44
47
  - Cleanup
45
48
  - Thanks to @hderms for contributing!
46
-
49
+
47
50
  # v1.1.0
48
51
  - Changed `scan()` to `safe?()`
49
52
  - Added `virus?()`
@@ -70,7 +73,7 @@ HTTP request sent, awaiting response... 200 OK
70
73
  Length: 68 [application/octet-stream]
71
74
  Saving to: 'eicar.com'
72
75
 
73
- 100%[=================>] 68 --.-K/s in 0s
76
+ 100%[=================>] 68 --.-K/s in 0s
74
77
 
75
78
  2014-03-10 21:35:50 (13.0 MB/s) - 'eicar.com' saved [68/68]
76
79
 
data/clamby.gemspec CHANGED
@@ -21,5 +21,4 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "rspec"
24
- spec.add_development_dependency "byebug"
25
24
  end
@@ -16,7 +16,7 @@ module Clamby
16
16
  def self.scan(path)
17
17
  return nil unless file_exists?(path)
18
18
 
19
- args = [path, '--no-summary']
19
+ args = [Shellwords.escape(path), '--no-summary']
20
20
 
21
21
  if Clamby.config[:daemonize]
22
22
  args << '--fdpass' if Clamby.config[:fdpass]
@@ -1,3 +1,3 @@
1
1
  module Clamby
2
- VERSION = "1.6.6"
2
+ VERSION = "1.6.8"
3
3
  end
@@ -134,9 +134,7 @@ describe Clamby::Command do
134
134
 
135
135
  it 'executes the clamscan executable from the custom path' do
136
136
  expect(runner).to receive(:system).with(
137
- "#{custom_path}/clamscan",
138
- '--no-summary',
139
- good_path,
137
+ "#{custom_path}/clamscan --no-summary #{good_path}",
140
138
  {}
141
139
  ) { system("exit 0", out: File::NULL) }
142
140
 
@@ -149,9 +147,7 @@ describe Clamby::Command do
149
147
 
150
148
  it 'executes the clamdscan executable from the custom path' do
151
149
  expect(runner).to receive(:system).with(
152
- "#{custom_path}/clamdscan",
153
- '--no-summary',
154
- good_path,
150
+ "#{custom_path}/clamdscan --no-summary #{good_path}",
155
151
  {}
156
152
  ) { system("exit 0", out: File::NULL) }
157
153
 
@@ -159,5 +155,11 @@ describe Clamby::Command do
159
155
  end
160
156
  end
161
157
  end
158
+
159
+ describe 'special filenames' do
160
+ it 'does not fail' do
161
+ expect(described_class.scan(special_path)).to be(false)
162
+ end
163
+ end
162
164
  end
163
165
  end
@@ -0,0 +1,2 @@
1
+ This is a virus-free file.
2
+ It is used by automated tests.
@@ -1,4 +1,5 @@
1
1
  RSpec.shared_context 'paths' do
2
+ let(:special_path) { File.expand_path('../../fixtures/safe (special).txt', __FILE__) }
2
3
  let(:good_path) { File.expand_path('../../fixtures/safe.txt', __FILE__) }
3
4
  let(:bad_path) { File.expand_path("not-here/#{rand 10e6}.txt", __FILE__) }
4
5
  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.6.6
4
+ version: 1.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - kobaltz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-05 00:00:00.000000000 Z
11
+ date: 2021-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: byebug
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  description: Clamby allows users to scan files uploaded with Paperclip or Carrierwave.
70
56
  If a file has a virus, then you can delete this file and discard it without causing
71
57
  harm to other users.
@@ -93,6 +79,7 @@ files:
93
79
  - spec/.DS_Store
94
80
  - spec/clamby/command_spec.rb
95
81
  - spec/clamby_spec.rb
82
+ - spec/fixtures/safe (special).txt
96
83
  - spec/fixtures/safe.txt
97
84
  - spec/spec_helper.rb
98
85
  - spec/support/shared_context.rb
@@ -115,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
102
  - !ruby/object:Gem::Version
116
103
  version: '0'
117
104
  requirements: []
118
- rubygems_version: 3.0.8
105
+ rubygems_version: 3.2.32
119
106
  signing_key:
120
107
  specification_version: 4
121
108
  summary: Scan file uploads with ClamAV
@@ -123,6 +110,7 @@ test_files:
123
110
  - spec/.DS_Store
124
111
  - spec/clamby/command_spec.rb
125
112
  - spec/clamby_spec.rb
113
+ - spec/fixtures/safe (special).txt
126
114
  - spec/fixtures/safe.txt
127
115
  - spec/spec_helper.rb
128
116
  - spec/support/shared_context.rb