Skip to content

Commit

Permalink
freshdbdir() fixes
Browse files Browse the repository at this point in the history
git-svn: trunk@3656
  • Loading branch information
Tomasz Kojm committed Feb 19, 2008
1 parent d6bf90e commit e48e620
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Tue Feb 19 14:32:45 CET 2008 (tk)
---------------------------------
* shared/misc.c: freshdbdir(): check freshclam.conf instead of clamd.conf;
don't print any errors while checking
alternative database directories

Tue Feb 19 13:40:26 CET 2008 (tk)
---------------------------------
* libclamav/scanners.c: only scan normalised text with type-7 sigs
Expand Down
6 changes: 3 additions & 3 deletions shared/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ char *freshdbdir(void)

/* try to find fresh directory */
dbdir = cl_retdbdir();
if((copt = getcfg(CONFDIR"/clamd.conf", 0))) {
if((copt = getcfg(CONFDIR"/freshclam.conf", 0))) {
if((cpt = cfgopt(copt, "DatabaseDirectory"))->enabled || (cpt = cfgopt(copt, "DataDirectory"))->enabled) {
if(strcmp(dbdir, cpt->strarg)) {
char *daily = (char *) malloc(strlen(cpt->strarg) + strlen(dbdir) + 30);
sprintf(daily, "%s/daily.cvd", cpt->strarg);
if(access(daily, R_OK))
sprintf(daily, "%s/daily.cld", cpt->strarg);

if((d1 = cl_cvdhead(daily))) {
if(!access(daily, R_OK) && (d1 = cl_cvdhead(daily))) {
sprintf(daily, "%s/daily.cvd", dbdir);
if(access(daily, R_OK))
sprintf(daily, "%s/daily.cld", dbdir);

if((d2 = cl_cvdhead(daily))) {
if(!access(daily, R_OK) && (d2 = cl_cvdhead(daily))) {
free(daily);
if(d1->version > d2->version)
dbdir = cpt->strarg;
Expand Down

0 comments on commit e48e620

Please sign in to comment.