From 77f0a8c0810d46f846ff659b9e9ef08195e4721d Mon Sep 17 00:00:00 2001 From: Grzegorz Filo Date: Mon, 31 Jan 2022 20:16:28 +0100 Subject: [PATCH] Error/Pass logic on av engine not available --- services/virus_scan/virus_scan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/virus_scan/virus_scan.c b/services/virus_scan/virus_scan.c index cba2e37..60b2f5c 100644 --- a/services/virus_scan/virus_scan.c +++ b/services/virus_scan/virus_scan.c @@ -411,8 +411,12 @@ int virus_scan_check_preview_handler(char *preview_data, int preview_data_len, } if (!data->engine[0]) { - ci_debug_printf(1, "Antivirus engine is not available, allow 204\n"); - return CI_MOD_ALLOW204; + if (PASSONERROR) { + ci_debug_printf(1, "Antivirus engine is not available, allow 204 due to PassOnError\n"); + return CI_MOD_ALLOW204; + } + ci_debug_printf(1, "Antivirus engine is not available.\n"); + return CI_ERROR; } /*Compute the expected size, will be used by must_scanned*/