From 921b44435021716282bd51bf945b671928361176 Mon Sep 17 00:00:00 2001 From: Chris Orlando Date: Thu, 9 Mar 2023 14:13:03 -0500 Subject: [PATCH] fix setting scan_max_filesize the variable name $scan_max_filesize is being used to store the configuration value for the largest file size that should be scanned which is passed to find and also the largest file size in the signatures. add a new variable called $sig_max_filesize for that purpose and add a conditional check so that we don't override $scan_max_filesize if the user has set it in the configuration --- files/internals/functions | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/files/internals/functions b/files/internals/functions index 9b16c698..ccc3cd93 100644 --- a/files/internals/functions +++ b/files/internals/functions @@ -893,16 +893,20 @@ quar_hitlist() { } clamselector() { - scan_max_filesize=`cat $sig_md5_file | cut -d':' -f2 | sort -n | tail -n1` - if [ "$scan_max_filesize" -gt "1" 2> /dev/null ]; then - scan_max_filesize=$[scan_max_filesize+1] - clamscan_max_filesize="${scan_max_filesize}" - scan_max_filesize="${scan_max_filesize}c" + sig_max_filesize=`cat $sig_md5_file | cut -d':' -f2 | sort -n | tail -n1` + if [ "$sig_max_filesize" -gt "1" 2> /dev/null ]; then + if [ -z "$scan_max_filesize" ]; then + scan_max_filesize="${scan_max_filesize}c" + fi + clamscan_max_filesize=$[sig_max_filesize+1] else - scan_max_filesize="2048k" + if [ -z "$scan_max_filesize" ]; then + scan_max_filesize="2048k" + fi clamscan_max_filesize="2592000" fi + if [ "$scan_clamscan" == "1" ]; then trim_log $clamscan_log 10000 1 for dpath in $clamav_paths; do