clamrb 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -0
- data/Gemfile.lock +8 -7
- data/README.md +2 -1
- data/clamrb.gemspec +3 -3
- data/ext/clamrb/clamrb.c +6 -1
- data/lib/clamrb/version.rb +1 -1
- data/test/clamrb_test.rb +1 -1
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edae5b1daaf257d6492cf0618dd3ae8f0720de57167e9eaa4c205ba6d314183e
|
4
|
+
data.tar.gz: f04b48f11fdfdaa4ef44d59360a86dff5d7bb1e616e7c7df3d74c18211eaa7de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93262571c569c10ed803dca31178db1868529396e83ed606a7b577d355609846692d6090a595c7fd48bd32cc5ddd69af0a061707af3aae586fcf3ff1d0b72f5d
|
7
|
+
data.tar.gz: aa4fad33101cabc1eff5e036d9e75dfa80c5e9895d64bc5151ed3bf9af02cfde07ac1956d638f6256147cabdb72d0a1cc1056d23508321fa51056f1842484daf
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -7,21 +7,22 @@ PATH
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
power_assert (
|
11
|
-
rake (
|
12
|
-
rake-compiler (1.
|
10
|
+
power_assert (2.0.4)
|
11
|
+
rake (13.2.1)
|
12
|
+
rake-compiler (1.2.8)
|
13
13
|
rake
|
14
|
-
test-unit (3.2
|
14
|
+
test-unit (3.6.2)
|
15
15
|
power_assert
|
16
16
|
|
17
17
|
PLATFORMS
|
18
18
|
ruby
|
19
|
+
x86_64-linux-gnu
|
19
20
|
|
20
21
|
DEPENDENCIES
|
21
|
-
bundler (~>
|
22
|
+
bundler (~> 2.5)
|
22
23
|
clamrb!
|
23
|
-
rake (
|
24
|
+
rake (>= 12.3.3)
|
24
25
|
test-unit (~> 3.2)
|
25
26
|
|
26
27
|
BUNDLED WITH
|
27
|
-
|
28
|
+
2.5.21
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
# clamrb [![Build Status](https://secure.travis-ci.org/abedra/clamrb.png)](http://travis-ci.org/abedra/clamrb?branch=master) ![](https://
|
1
|
+
# clamrb [![Build Status](https://secure.travis-ci.org/abedra/clamrb.png)](http://travis-ci.org/abedra/clamrb?branch=master) ![Gem](https://img.shields.io/gem/dt/clamrb.svg) [![Gem Version](http://img.shields.io/gem/v/clamrb.svg)](https://rubygems.org/gems/clamrb)
|
2
|
+
|
2
3
|
|
3
4
|
This project is a Ruby gem that interfaces with the Clam AV engine using libclamav.
|
4
5
|
|
data/clamrb.gemspec
CHANGED
@@ -5,7 +5,7 @@ require "clamrb/version"
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'clamrb'
|
7
7
|
s.version = Clamrb::VERSION
|
8
|
-
s.date = '
|
8
|
+
s.date = '2024-10-04'
|
9
9
|
s.licenses = ['MIT']
|
10
10
|
s.summary = 'Ruby interface to Clam AV'
|
11
11
|
s.description = 'Native Ruby extension for running clamav scans'
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.files = %x{git ls-files}.split("\n").reject {|file| file =~ /^(test)/ }
|
18
18
|
s.test_files = %x{git ls-files}.split("\n").select {|file| file =~ /^(test)/ }
|
19
19
|
s.add_dependency "rake-compiler", "~> 1.0"
|
20
|
-
s.add_development_dependency "bundler", "~>
|
21
|
-
s.add_development_dependency "rake", "~>
|
20
|
+
s.add_development_dependency "bundler", "~> 2.5"
|
21
|
+
s.add_development_dependency "rake", "~> 12.3.3"
|
22
22
|
s.add_development_dependency "test-unit", "~> 3.2"
|
23
23
|
end
|
data/ext/clamrb/clamrb.c
CHANGED
@@ -33,7 +33,11 @@ VALUE scan(VALUE self, VALUE filename)
|
|
33
33
|
Data_Get_Struct(self, struct cl_engine, engine);
|
34
34
|
const char *name = NULL;
|
35
35
|
long unsigned int scanned = 0;
|
36
|
-
|
36
|
+
struct cl_scan_options scanoptions;
|
37
|
+
memset(&scanoptions, 0, sizeof(struct cl_scan_options));
|
38
|
+
scanoptions.parse |= -0;
|
39
|
+
scanoptions.general |= CL_SCAN_GENERAL_ALLMATCHES;
|
40
|
+
int ret = cl_scanfile(StringValueCStr(filename), &name, &scanned, engine, &scanoptions);
|
37
41
|
|
38
42
|
VALUE clamrb = rb_const_get(rb_cObject, rb_intern("Clamrb"));
|
39
43
|
VALUE clamrb_result = rb_const_get(clamrb, rb_intern("Result"));
|
@@ -58,4 +62,5 @@ void Init_clamrb(void)
|
|
58
62
|
VALUE klass = rb_define_class("Clamrb", rb_cObject);
|
59
63
|
rb_define_singleton_method(klass, "new", constructor, 0);
|
60
64
|
rb_define_method(klass, "scan", scan, 1);
|
65
|
+
rb_undef_alloc_func(klass);
|
61
66
|
}
|
data/lib/clamrb/version.rb
CHANGED
data/test/clamrb_test.rb
CHANGED
@@ -21,7 +21,7 @@ class ClamrbTest < Test::Unit::TestCase
|
|
21
21
|
def test_infected_file
|
22
22
|
result = @@clamrb.scan "test/files/eicar.txt"
|
23
23
|
assert_equal(:infected, result.status)
|
24
|
-
assert_equal("Eicar-
|
24
|
+
assert_equal("Eicar-Signature", result.identifier)
|
25
25
|
assert_true(result.virus?)
|
26
26
|
end
|
27
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clamrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Bedra
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.5'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 12.3.3
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 12.3.3
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: test-unit
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,7 +96,7 @@ homepage: https://github.com/abedra/clamrb
|
|
96
96
|
licenses:
|
97
97
|
- MIT
|
98
98
|
metadata: {}
|
99
|
-
post_install_message:
|
99
|
+
post_install_message:
|
100
100
|
rdoc_options: []
|
101
101
|
require_paths:
|
102
102
|
- lib
|
@@ -111,9 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
|
115
|
-
|
116
|
-
signing_key:
|
114
|
+
rubygems_version: 3.4.20
|
115
|
+
signing_key:
|
117
116
|
specification_version: 4
|
118
117
|
summary: Ruby interface to Clam AV
|
119
118
|
test_files:
|