tools: make sure the libclamav version is high enough (bb#2013)

0.96
Tomasz Kojm 15 years ago
parent 568e08fc79
commit bca0b67921
  1. 4
      ChangeLog
  2. 3
      clambc/bcrun.c
  3. 3
      clamd/clamd.c
  4. 3
      clamscan/clamscan.c
  5. 2
      freshclam/freshclam.c
  6. 9
      shared/misc.c
  7. 1
      shared/misc.h
  8. 3
      sigtool/sigtool.c

@ -1,3 +1,7 @@
Mon May 10 17:00:16 CEST 2010 (tk)
----------------------------------
* tools: make sure the libclamav version is high enough (bb#2013)
Mon May 10 14:51:24 CEST 2010 (tk)
----------------------------------
* sigtool/sigtool.c: fix error msg (bb#2002)

@ -240,6 +240,9 @@ int main(int argc, char *argv[])
int fd = -1;
unsigned tracelevel;
if(check_flevel())
exit(1);
opts = optparse(NULL, argc, argv, 1, OPT_CLAMBC, 0, NULL);
if (!opts) {
fprintf(stderr, "ERROR: Can't parse command line options\n");

@ -119,6 +119,9 @@ int main(int argc, char **argv)
struct stat sb;
#endif
if(check_flevel())
exit(1);
#ifndef _WIN32
memset(&sa, 0, sizeof(sa));
sa.sa_handler = SIG_IGN;

@ -66,6 +66,9 @@ int main(int argc, char **argv)
struct optstruct *opts;
const struct optstruct *opt;
if(check_flevel())
exit(2);
#if !defined(_WIN32) && !defined(C_BEOS)
sigemptyset(&sigset);
sigaddset(&sigset, SIGXFSZ);

@ -211,6 +211,8 @@ int main(int argc, char **argv)
struct stat statbuf;
struct mirdat mdat;
if(check_flevel())
exit(40);
if((opts = optparse(NULL, argc, argv, 1, OPT_FRESHCLAM, 0, NULL)) == NULL) {
mprintf("!Can't parse command line options\n");

@ -170,6 +170,15 @@ void print_version(const char *dbdir)
free(path);
}
int check_flevel(void)
{
if(cl_retflevel() < CL_FLEVEL) {
fprintf(stderr, "ERROR: This tool requires libclamav with functionality level %u or higher (current f-level: %u)\n", CL_FLEVEL, cl_retflevel());
return 1;
}
return 0;
}
#endif
const char *filelist(const struct optstruct *opts, int *err)

@ -45,6 +45,7 @@
char *freshdbdir(void);
void print_version(const char *dbdir);
int check_flevel(void);
const char *filelist(const struct optstruct *opts, int *err);
int filecopy(const char *src, const char *dest);
int daemonize(void);

@ -2569,6 +2569,9 @@ int main(int argc, char **argv)
struct optstruct *opts;
struct stat sb;
if(check_flevel())
exit(1);
opts = optparse(NULL, argc, argv, 1, OPT_SIGTOOL, 0, NULL);
if(!opts) {
mprintf("!Can't parse command line options\n");

Loading…
Cancel
Save