--- p3scan.c 2008-04-02 14:03:59.000000000 +0100 +++ p3scan.c.new 2010-04-02 01:01:28.000000000 +0100 @@ -182,7 +182,7 @@ //struct cl_stat dbstat; const struct cfgstruct *copt; struct cl_engine *engine = NULL; -struct cl_limits limits; +//struct cl_limits limits; struct cl_cvd *daily; const char *dbdir; unsigned int sigs = 0; @@ -281,7 +281,7 @@ } if((ret=unlink(config->pidfile)!=0)) do_log(LOG_NOTICE, "ERR: Unable to remove %s", config->pidfile); #if HAVE_CLAMAV - if (engine) cl_free(engine); + if (engine) cl_engine_free(engine); #endif do_log(LOG_NOTICE, PROGRAM " terminates now"); exit(EXIT_SUCCESS); @@ -536,7 +536,7 @@ mvold=0; if (config->clamav){ if(engine){ - cl_free(engine); + cl_engine_free(engine); engine = NULL; } dbdir=cl_retdbdir(); @@ -566,27 +566,27 @@ if(dbstat == NULL){ dbstat = (struct cl_stat *) malloc(sizeof(struct cl_stat)); if(!dbstat) { - cl_free(engine); + cl_engine_free(engine); do_log(LOG_EMERG, "ClamAV can't allocate memory for dbstat ERR: %s",cl_strerror(ret)); return SCANNER_RET_ERR; } } else { if((ret = cl_statfree(dbstat))){ - if (engine) cl_free(engine); + if (engine) cl_engine_free(engine); do_log(LOG_EMERG, "ClamAV Database statfree ERR: %s",cl_strerror(ret)); return SCANNER_RET_ERR; } } //if((ret = cl_loaddbdir(dbdir, &engine, &sigs))) { if((ret = cl_load(dbdir, &engine, &sigs, CL_DB_STDOPT))) { - if (engine) cl_free(engine); + if (engine) cl_engine_free(engine); if (dbstat) cl_statfree(dbstat); do_log(LOG_EMERG, "ERR: %s",cl_strerror(ret)); return SCANNER_RET_ERR; } // build engine - if((ret = cl_build(engine))){ - if (engine) cl_free(engine); + if((ret = cl_engine_compile(engine))){ + if (engine) cl_engine_free(engine); if (dbstat) cl_statfree(dbstat); // Emergency: init_clamav. could not init. do_log(LOG_EMERG, "ClamAV Database build ERR: %s",cl_strerror(ret)); @@ -595,16 +595,16 @@ memset(dbstat, 0, sizeof(struct cl_stat)); cl_statinidir(dbdir, dbstat); // set up archive limits (ClamAV Defaults) - memset(&limits, 0, sizeof(struct cl_limits)); - limits.maxfilesize = 25 * 1048576; // compressed files will only be decompressed and scanned up to this size - limits.maxreclevel = 16; // maximum recursion level for archives - limits.maxfiles = 1000; // maximum number of files to be scanned within a single archive -#ifdef HAVE_MAXSCANSIZE - limits.maxscansize = 100 * 1048576; // during the scanning of archives this size will never be exceeded -#else - limits.maxmailrec = 64; // maximum recursion level for mail files - limits.maxratio = 200; // maximum compression ratio -#endif +// memset(&limits, 0, sizeof(struct cl_limits)); +// limits.maxfilesize = 25 * 1048576; // compressed files will only be decompressed and scanned up to this size +// limits.maxreclevel = 16; // maximum recursion level for archives +// limits.maxfiles = 1000; // maximum number of files to be scanned within a single archive +//#ifdef HAVE_MAXSCANSIZE +// limits.maxscansize = 100 * 1048576; // during the scanning of archives this size will never be exceeded +//#else +// limits.maxmailrec = 64; // maximum recursion level for mail files +// limits.maxratio = 200; // maximum compression ratio +//#endif } if (reload){ do_log(LOG_NOTICE, "ClamAV %s Database correctly reloaded (%d signatures)", cl_retver(), sigs); @@ -761,7 +761,7 @@ return SCANNER_RET_CRIT; } /* scan descriptor */ - if ((viret = cl_scandesc(fdc, &virnamec, &blocks, engine, &limits, CL_SCAN_STDOPT)) == CL_VIRUS){ + if ((viret = cl_scandesc(fdc, &virnamec, &blocks, engine, CL_SCAN_STDOPT)) == CL_VIRUS){ p->virinfo=strdup(virnamec); viret=SCANNER_RET_VIRUS; } else if (viret != CL_CLEAN) do_log(LOG_CRIT,"ERR: %s", cl_strerror(ret)); @@ -1170,7 +1170,7 @@ return SCANNER_RET_CRIT; } /* scan descriptor */ - if ((viret = cl_scandesc(fdc, &clamvirname, &blocks, engine, &limits, CL_SCAN_STDOPT)) == CL_VIRUS){ + if ((viret = cl_scandesc(fdc, &clamvirname, &blocks, engine, CL_SCAN_STDOPT)) == CL_VIRUS){ p->virinfo=strdup(clamvirname); viret=SCANNER_RET_VIRUS; } else if (viret != CL_CLEAN) do_log(LOG_CRIT,"ERR: %s", cl_strerror(ret));