Browse code

warn if no bzip2 support

git-svn: trunk@3988

aCaB authored on 2008/07/25 09:44:01
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Fri Jul 25 02:24:53 CEST 2008 (acab)
2
+------------------------------------
3
+  * libclamav/scanners.c: warn if no bzip2 support - bb#1060
4
+
1 5
 Wed Jul 23 23:44:59 CEST 2008 (tk)
2 6
 ----------------------------------
3 7
   * freshclam/mirman.c: fix handling of IPv6 addresses
... ...
@@ -24,9 +24,7 @@
24 24
 #include "regex/regex.h"
25 25
 
26 26
 struct regex_list {
27
-#ifdef CL_DEBUG
28 27
 	const char *pattern;
29
-#endif
30 28
 	regex_t preg;
31 29
 	struct regex_list *nxt;
32 30
 };
... ...
@@ -536,7 +536,14 @@ static int cli_scangzip(int desc, cli_ctx *ctx)
536 536
     return ret;
537 537
 }
538 538
 
539
-#ifdef HAVE_BZLIB_H
539
+
540
+#ifndef HAVE_BZLIB_H
541
+static int cli_scanbzip(int desc, cli_ctx *ctx) {
542
+    cli_warnmsg("cli_scanbzip: bzip2 support not compiled in\n");
543
+    return CL_CLEAN;
544
+}
545
+
546
+#else
540 547
 
541 548
 #ifdef NOBZ2PREFIX
542 549
 #define BZ2_bzReadOpen bzReadOpen
... ...
@@ -1891,10 +1898,8 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
1891 1891
 	    break;
1892 1892
 
1893 1893
 	case CL_TYPE_BZ:
1894
-#ifdef HAVE_BZLIB_H
1895 1894
 	    if(SCAN_ARCHIVE && (DCONF_ARCH & ARCH_CONF_BZ))
1896 1895
 		ret = cli_scanbzip(desc, ctx);
1897
-#endif
1898 1896
 	    break;
1899 1897
 	case CL_TYPE_ARJ:
1900 1898
 	    if(SCAN_ARCHIVE && (DCONF_ARCH & ARCH_CONF_ARJ))