clamby 1.6.8 → 1.6.9

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: 81853e9529f298f606bb599f22da044e9ada2f805d2d6f6635caac455450e93e
4
- data.tar.gz: d122cf67adcfd0187c8fabd7153ca7fe20643b075f9bcfe77c8d482075462f74
3
+ metadata.gz: 171036eaf5b847c95d24d69acf689dad2c9eda942a746b5c98182058446e9af0
4
+ data.tar.gz: 862529ea5008ebd2568c40ea3dd8c2e38cc5467733edf13b97ac67b6ac817e03
5
5
  SHA512:
6
- metadata.gz: c56dc7d74dfa3e29eeeca5d44b0cee9fc55efbc55269bcee95cd5108cb8c09ac8faa5a353bd6932ae7602adf1686bec8df4671a5afd57997bb0bdf605d2c2bdc
7
- data.tar.gz: 85b9072343ce8061cb67ab7607a52570f6d42459e9ad3467c3497c381a9df6cdea3832435dd276e306b1b5fdc1a8bb415940e0a90371027f65497952f215a89b
6
+ metadata.gz: 8c416805c97b12c6f2ed9dbb43843be08841ca0821ea2036f9ab903feceecf7fabde4fc6786fb7a0ef5e1e628123329e29478bfb843540cf416c6709e174cb56
7
+ data.tar.gz: a5667261a416a5eb2ade0ba75f1982949ae9845849a8f647bcd918091720b5b1e95c30477b838e94a7d297256c45263bc09268aef6b711d2ed2e704845554f51
data/README.md CHANGED
@@ -99,6 +99,7 @@ Configuration is rather limited right now. You can exclude the check if `clamsca
99
99
  :error_file_virus => false,
100
100
  :fdpass => false,
101
101
  :stream => false,
102
+ :reload => false,
102
103
  :output_level => 'medium', # one of 'off', 'low', 'medium', 'high'
103
104
  :executable_path_clamscan => 'clamscan',
104
105
  :executable_path_clamdscan => 'clamdscan',
@@ -128,6 +129,12 @@ Setting the `stream` configuration option will stream the file to the daemon. Th
128
129
 
129
130
  `--stream : Forces file streaming to clamd. This is generally not needed as clamdscan detects automatically if streaming is required. This option only exists for debugging and testing purposes, in all other cases --fdpass is preferred.`
130
131
 
132
+ #### Force streaming files to clamd
133
+
134
+ Setting the `reload` configuration option to `true` will pass the `--reload` option to the daemon. Only works when also specifying `daemonize`. From the clamdscan man page:
135
+
136
+ `--reload : Request clamd to reload virus database.`
137
+
131
138
  #### Output levels
132
139
 
133
140
  - *off*: suppress all output
data/clamby.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["dave@k-innovations.net"]
11
11
  spec.summary = "Scan file uploads with ClamAV"
12
12
  spec.description = "Clamby allows users to scan files uploaded with Paperclip or Carrierwave. If a file has a virus, then you can delete this file and discard it without causing harm to other users."
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/kobaltz/clamby"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -21,6 +21,7 @@ module Clamby
21
21
  if Clamby.config[:daemonize]
22
22
  args << '--fdpass' if Clamby.config[:fdpass]
23
23
  args << '--stream' if Clamby.config[:stream]
24
+ args << '--reload' if Clamby.config[:reload]
24
25
  end
25
26
 
26
27
  args << "-d #{Clamby.config[:datadir]}" if Clamby.config[:datadir]
@@ -1,3 +1,3 @@
1
1
  module Clamby
2
- VERSION = "1.6.8"
2
+ VERSION = "1.6.9"
3
3
  end
data/lib/clamby.rb CHANGED
@@ -14,6 +14,7 @@ module Clamby
14
14
  :error_file_virus => false,
15
15
  :fdpass => false,
16
16
  :stream => false,
17
+ :reload => false,
17
18
  :output_level => 'medium',
18
19
  :datadir => nil,
19
20
  :executable_path_clamscan => 'clamscan',
@@ -84,6 +84,32 @@ describe Clamby::Command do
84
84
  end
85
85
  end
86
86
 
87
+ describe 'reloading virus database' do
88
+ it 'does not include reload in the command by default' do
89
+ Clamby.configure
90
+ expect(runner).to receive(:run).with('clamscan', good_path, '--no-summary')
91
+ allow(described_class).to receive(:new).and_return(runner)
92
+
93
+ described_class.scan(good_path)
94
+ end
95
+
96
+ it 'omits the reload option when invoking clamscan if it is set, but daemonize isn\'t' do
97
+ Clamby.configure(reload: true)
98
+ expect(runner).to receive(:run).with('clamscan', good_path, '--no-summary')
99
+ allow(described_class).to receive(:new).and_return(runner)
100
+
101
+ described_class.scan(good_path)
102
+ end
103
+
104
+ it 'passes the reload option when invoking clamscan if it is set with daemonize' do
105
+ Clamby.configure(reload: true, daemonize: true)
106
+ expect(runner).to receive(:run).with('clamdscan', good_path, '--no-summary', '--reload')
107
+ allow(described_class).to receive(:new).and_return(runner)
108
+
109
+ described_class.scan(good_path)
110
+ end
111
+ end
112
+
87
113
  describe 'specifying config-file' do
88
114
  it 'does not include the parameter in the clamscan command by default' do
89
115
  Clamby.configure
data/spec/clamby_spec.rb CHANGED
@@ -66,6 +66,18 @@ describe Clamby do
66
66
  end
67
67
  end
68
68
 
69
+ # From the clamscan man page:
70
+ # Request clamd to reload virus database.
71
+ context 'reload option' do
72
+ it 'is false by default' do
73
+ expect(Clamby.config[:reload]).to eq false
74
+ end
75
+ it 'accepts an reload option in the config' do
76
+ Clamby.configure(reload: true)
77
+ expect(Clamby.config[:reload]).to eq true
78
+ end
79
+ end
80
+
69
81
  context 'error_clamscan_client_error option' do
70
82
  it 'is false by default' do
71
83
  expect(Clamby.config[:error_clamscan_client_error]).to eq false
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.8
4
+ version: 1.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - kobaltz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-28 00:00:00.000000000 Z
11
+ date: 2023-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -83,7 +83,7 @@ files:
83
83
  - spec/fixtures/safe.txt
84
84
  - spec/spec_helper.rb
85
85
  - spec/support/shared_context.rb
86
- homepage: ''
86
+ homepage: https://github.com/kobaltz/clamby
87
87
  licenses:
88
88
  - MIT
89
89
  metadata: {}
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
- rubygems_version: 3.2.32
105
+ rubygems_version: 3.4.19
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Scan file uploads with ClamAV