clamav 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +5 -0
- data/TODO +4 -0
- data/VERSION +1 -1
- data/clamav.gemspec +5 -3
- data/ext/clamav/clamav.c +10 -4
- metadata +5 -3
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/clamav.gemspec
CHANGED
@@ -5,22 +5,24 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{clamav}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alexander Oryol"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-05-18}
|
13
13
|
s.description = %q{ClamAV Ruby bindings}
|
14
14
|
s.email = %q{eagle.alex@gmail.com}
|
15
15
|
s.extensions = ["ext/clamav/extconf.rb"]
|
16
16
|
s.extra_rdoc_files = [
|
17
17
|
"ChangeLog",
|
18
|
-
"README.rdoc"
|
18
|
+
"README.rdoc",
|
19
|
+
"TODO"
|
19
20
|
]
|
20
21
|
s.files = [
|
21
22
|
".gitignore",
|
22
23
|
"ChangeLog",
|
23
24
|
"README.rdoc",
|
25
|
+
"TODO",
|
24
26
|
"VERSION",
|
25
27
|
"clamav.gemspec",
|
26
28
|
"ext/clamav/clamav.c",
|
data/ext/clamav/clamav.c
CHANGED
@@ -13,9 +13,11 @@ struct ClamAV_R {
|
|
13
13
|
|
14
14
|
static void clamavr_free(struct ClamAV_R *ptr) {
|
15
15
|
int ret;
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
if(ptr->root != NULL) {
|
17
|
+
ret = cl_engine_free(ptr->root);
|
18
|
+
if(ret != CL_SUCCESS) {
|
19
|
+
rb_raise(rb_eRuntimeError, "cl_engine_free() error: %s\n", cl_strerror(ret));
|
20
|
+
}
|
19
21
|
}
|
20
22
|
xfree(ptr);
|
21
23
|
}
|
@@ -81,7 +83,7 @@ static VALUE clamavr_loaddb(int argc, VALUE *argv, VALUE self) {
|
|
81
83
|
rb_scan_args(argc, argv, "01", &v_db_options);
|
82
84
|
|
83
85
|
if(NIL_P(v_db_options)){
|
84
|
-
|
86
|
+
v_db_options = INT2FIX(CL_DB_STDOPT); /* default value */
|
85
87
|
}
|
86
88
|
|
87
89
|
if(ptr->root != NULL) {
|
@@ -208,6 +210,10 @@ static VALUE clamavr_scanfile(int argc, VALUE *argv, VALUE klass) {
|
|
208
210
|
VALUE v_options;
|
209
211
|
rb_scan_args(argc, argv, "11", &v_fname, &v_options);
|
210
212
|
|
213
|
+
if(ptr->root == NULL) {
|
214
|
+
rb_raise(rb_eRuntimeError, "ClamAV error: you should call loaddb() before scanning\n");
|
215
|
+
}
|
216
|
+
|
211
217
|
if(NIL_P(v_options)){
|
212
218
|
v_options = ptr->options; /* stored value */
|
213
219
|
}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 0.4.
|
8
|
+
- 1
|
9
|
+
version: 0.4.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alexander Oryol
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-05-18 00:00:00 +04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -27,10 +27,12 @@ extensions:
|
|
27
27
|
extra_rdoc_files:
|
28
28
|
- ChangeLog
|
29
29
|
- README.rdoc
|
30
|
+
- TODO
|
30
31
|
files:
|
31
32
|
- .gitignore
|
32
33
|
- ChangeLog
|
33
34
|
- README.rdoc
|
35
|
+
- TODO
|
34
36
|
- VERSION
|
35
37
|
- clamav.gemspec
|
36
38
|
- ext/clamav/clamav.c
|