[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-167-g4319a8f
tkojm
tkojm at 77e5149b-7576-45b1-b177-96237e5ba77b
Fri Jun 12 19:11:49 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 42f07b4b1ad29b3921ab5752f697b103a7714e96
Author: tkojm <tkojm at 77e5149b-7576-45b1-b177-96237e5ba77b>
Date: Mon Apr 27 15:42:35 2009 +0000
clamconf: display info on software & dbs (bb#1461)
git-svn-id: http://svn.clamav.net/svn/clamav-devel/trunk@5056 77e5149b-7576-45b1-b177-96237e5ba77b
diff --git a/ChangeLog b/ChangeLog
index 4c6a1e4..e7810af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Apr 27 17:41:08 CEST 2009 (tk)
+----------------------------------
+ * clamconf: display info on software & dbs (bb#1461)
+
Fri Apr 24 15:20:48 CEST 2009 (acab)
....................................
* clamav-milter: drop support for QuarantineReject: it's a bad idea and
diff --git a/clamconf/Makefile.am b/clamconf/Makefile.am
index 4a2350f..f4d0fe8 100644
--- a/clamconf/Makefile.am
+++ b/clamconf/Makefile.am
@@ -27,7 +27,7 @@ clamconf_SOURCES = \
$(top_srcdir)/shared/misc.h \
clamconf.c
-DEFS = @DEFS@ -DCL_NOTHREADS -DCL_NOLIBCLAMAV
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared
-LIBS = $(top_builddir)/libclamav/libclamav_internal_utils_nothreads.la
+DEFS = @DEFS@ -DCL_NOTHREADS
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav
+LIBS = $(top_builddir)/libclamav/libclamav.la @CLAMD_LIBS@ @THREAD_LIBS@
CLEANFILES=*.gcda *.gcno
diff --git a/clamconf/Makefile.in b/clamconf/Makefile.in
index 8bd1ee2..52263b1 100644
--- a/clamconf/Makefile.in
+++ b/clamconf/Makefile.in
@@ -117,7 +117,7 @@ CURSES_CPPFLAGS = @CURSES_CPPFLAGS@
CURSES_LIBS = @CURSES_LIBS@
CYGPATH_W = @CYGPATH_W@
DBDIR = @DBDIR@
-DEFS = @DEFS@ -DCL_NOTHREADS -DCL_NOLIBCLAMAV
+DEFS = @DEFS@ -DCL_NOTHREADS
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
@@ -152,7 +152,7 @@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@
LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@
LIBLTDL = @LIBLTDL@
LIBOBJS = @LIBOBJS@
-LIBS = $(top_builddir)/libclamav/libclamav_internal_utils_nothreads.la
+LIBS = $(top_builddir)/libclamav/libclamav.la @CLAMD_LIBS@ @THREAD_LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
@@ -257,7 +257,7 @@ clamconf_SOURCES = \
$(top_srcdir)/shared/misc.h \
clamconf.c
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav
CLEANFILES = *.gcda *.gcno
all: all-am
diff --git a/clamconf/clamconf.c b/clamconf/clamconf.c
index f288bbf..42570ee 100644
--- a/clamconf/clamconf.c
+++ b/clamconf/clamconf.c
@@ -26,11 +26,14 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#include <time.h>
#include "shared/optparser.h"
#include "shared/misc.h"
#include "libclamav/str.h"
+#include "libclamav/clamav.h"
+#include "libclamav/others.h"
static struct _cfgfile {
const char *name;
@@ -42,6 +45,10 @@ static struct _cfgfile {
{ NULL, 0 }
};
+static const char *dbnames[] = { "main.cvd", "main.cld", "daily.cvd",
+ "daily.cld", "safebrowsing.cvd",
+ "safebrowsing.cld", NULL };
+
static void printopts(struct optstruct *opts, int nondef)
{
const struct optstruct *opt;
@@ -194,10 +201,12 @@ static void help(void)
int main(int argc, char **argv)
{
const char *dir;
- char path[512];
+ char path[512], dbdir[512], *pt;
struct optstruct *opts, *toolopts;
const struct optstruct *opt;
unsigned int i, j;
+ struct cl_cvd *cvd;
+ unsigned int flevel;
opts = optparse(NULL, argc, argv, 1, OPT_CLAMCONF, 0, NULL);
@@ -224,9 +233,7 @@ int main(int argc, char **argv)
return 0;
}
- printf("ClamAV engine version: %s\n", get_version());
- /* TODO: db information */
-
+ dbdir[0] = 0;
dir = optget(opts, "config-dir")->strarg;
printf("Checking configuration files in %s\n", dir);
for(i = 0; cfgfile[i].name; i++) {
@@ -244,8 +251,72 @@ int main(int argc, char **argv)
if(!toolopts)
continue;
printopts(toolopts, optget(opts, "non-default")->enabled);
+ if(cfgfile[i].tool == OPT_FRESHCLAM) {
+ opt = optget(toolopts, "DatabaseDirectory");
+ strncpy(dbdir, opt->strarg, sizeof(dbdir));
+ dbdir[sizeof(dbdir) - 1] = 0;
+ }
optfree(toolopts);
}
optfree(opts);
+
+ printf("\nSoftware settings\n-----------------\n");
+ printf("Version: %s\n", cl_retver());
+ if(strcmp(cl_retver(), get_version()))
+ printf("WARNING: Version mismatch: libclamav=%s, clamconf=%s\n", cl_retver(), get_version());
+ cl_init(CL_INIT_DEFAULT);
+ printf("Optional features supported: ");
+#ifdef USE_MPOOL
+ printf("MEMPOOL ");
+#endif
+#ifdef SUPPORT_IPv6
+ printf("IPv6 ");
+#endif
+#ifdef CLAMUKO
+ printf("CLAMUKO ");
+#endif
+#ifdef C_BIGSTACK
+ printf("BIGSTACK ");
+#endif
+#ifdef FRESHCLAM_DNS_FIX
+ printf("FRESHCLAM_DNS_FIX ");
+#endif
+#ifdef FPU_WORDS_BIGENDIAN
+ printf("AUTOIT_EA06 ");
+#endif
+#ifdef HAVE_BZLIB_H
+ printf("BZIP2 ");
+#endif
+ if(have_rar)
+ printf("RAR");
+ printf("\n");
+
+ if(!strlen(dbdir)) {
+ pt = freshdbdir();
+ if(pt) {
+ strncpy(dbdir, pt, sizeof(dbdir));
+ free(pt);
+ } else {
+ strncpy(dbdir, DATADIR, sizeof(dbdir));
+ }
+ dbdir[sizeof(dbdir) - 1] = 0;
+ }
+ printf("Database directory: %s\n", dbdir);
+ flevel = cl_retflevel();
+ for(i = 0; dbnames[i]; i++) {
+ snprintf(path, sizeof(path), "%s/%s", dbdir, dbnames[i]);
+ path[511] = 0;
+ if(!access(path, R_OK)) {
+ cvd = cl_cvdhead(path);
+ if(!cvd) {
+ printf("%s: Can't get information about the database\n", dbnames[i]);
+ } else {
+ printf("%s: version %u, sigs: %u, built on %s", dbnames[i], cvd->version, cvd->sigs, ctime((const time_t *) &cvd->stime));
+ if(cvd->fl > flevel)
+ printf("%s: WARNING: This database requires f-level %u (current f-level: %u)\n", dbnames[i], cvd->fl, flevel);
+ cl_cvdfree(cvd);
+ }
+ }
+ }
return 0;
}
diff --git a/libclamav/libclamav.map b/libclamav/libclamav.map
index 89a29a7..7f1b106 100644
--- a/libclamav/libclamav.map
+++ b/libclamav/libclamav.map
@@ -33,6 +33,7 @@ CLAMAV_PUBLIC {
CLAMAV_PRIVATE {
global:
cli_strtok;
+ cli_strtokenize;
cli_cvdunpack;
cli_regcomp;
cli_regexec;
@@ -142,6 +143,7 @@ CLAMAV_PRIVATE {
messageCreate;
messageDestroy;
base64Flush;
+ have_rar;
local:
*;
};
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list