From 525f364aa74ac7453ffc611e8ba4fbc43c9a72ae Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sat, 3 Feb 2007 13:12:20 +0000 Subject: [PATCH] Better virusscan checks --- mbfido/virscan.c | 4 ++-- mbsebbs/filesub.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mbfido/virscan.c b/mbfido/virscan.c index 75c3e8a9..c2c9c348 100644 --- a/mbfido/virscan.c +++ b/mbfido/virscan.c @@ -63,7 +63,7 @@ int VirScan(char *path) while (fread(&virscan, virscanhdr.recsize, 1, fp) == 1) { if (virscan.available) { - if (file_exist(virscan.scanner, X_OK)) { + if (file_exist(virscan.scanner, X_OK) == 0) { has_scan = TRUE; } else { Syslog('+', "Warning: virusscanner %s marked active but not present", virscan.comment); @@ -90,7 +90,7 @@ int VirScan(char *path) fseek(fp, virscanhdr.hdrsize, SEEK_SET); while (fread(&virscan, virscanhdr.recsize, 1, fp) == 1) { - if (virscan.available && file_exist(virscan.scanner, X_OK)) { + if (virscan.available && (file_exist(virscan.scanner, X_OK) ==0)) { Altime(3600); vrc = execute_str(virscan.scanner, virscan.options, (char *)NULL, (char *)"/dev/null", stdlog, errlog); if (file_size(stdlog)) { diff --git a/mbsebbs/filesub.c b/mbsebbs/filesub.c index 99febd2d..011cfb06 100644 --- a/mbsebbs/filesub.c +++ b/mbsebbs/filesub.c @@ -479,7 +479,7 @@ int ScanDirect(char *fn) while (fread(&virscan, virscanhdr.recsize, 1, fp) == 1) { - if (virscan.available && file_exist(virscan.scanner, X_OK)) { + if (virscan.available && (file_exist(virscan.scanner, X_OK) == 0)) { /* Scanning */ /* with */ snprintf(msg, 81, "%s %s %s %s ", (char *) Language(132), fn, (char *) Language(133), virscan.comment); pout(CFG.TextColourF, CFG.TextColourB, msg); @@ -617,7 +617,7 @@ int ScanArchive(char *fn, char *ftype) fread(&virscanhdr, sizeof(virscanhdr), 1, fp); while (fread(&virscan, virscanhdr.recsize, 1, fp) == 1) { - if (virscan.available && file_exist(virscan.scanner, X_OK)) { + if (virscan.available && (file_exist(virscan.scanner, X_OK) == 0)) { /* Scanning */ /* with */ snprintf(msg, 81, "%s %s %s %s ", (char *) Language(132), fn, (char *) Language(133), virscan.comment); pout(CFG.TextColourF, CFG.TextColourB, msg);