From 76a8044bf993f1c3116b4a94048ae91017bafe0e Mon Sep 17 00:00:00 2001 From: Ladar Levison Date: Tue, 9 Jun 2020 03:54:43 -0500 Subject: Updated the ClamAV freshen script to handle custom CA bundles. --- dev/scripts/freshen/freshen.clamav.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dev/scripts/freshen/freshen.clamav.sh b/dev/scripts/freshen/freshen.clamav.sh index 7f1ccee7..11c902a9 100755 --- a/dev/scripts/freshen/freshen.clamav.sh +++ b/dev/scripts/freshen/freshen.clamav.sh @@ -22,9 +22,16 @@ popd > /dev/null cd $BASE/../../../ export MAGMA_DIST=`pwd` - export LD_LIBRARY_PATH=$MAGMA_DIST/lib/sources/clamav/libclamav/.libs/:$MAGMA_DIST/lib/sources/clamav/libfreshclam/.libs/ -lib/sources/clamav/freshclam/.libs/freshclam --debug --verbose --user $USER --ca=$MAGMA_DIST/sandbox/etc/ca-bundle.crt --datadir=$MAGMA_DIST/sandbox/virus --config-file=$MAGMA_DIST/sandbox/etc/freshclam.conf + +# If the sandbox contains a CA bundle file, override the path to the CA file used by Freshclam. +if [ -f $MAGMA_DIST/sandbox/etc/ca-bundle.crt ]; then + lib/sources/clamav/freshclam/.libs/freshclam --user $USER --ca=$MAGMA_DIST/sandbox/etc/ca-bundle.crt --datadir=$MAGMA_DIST/sandbox/virus --config-file=$MAGMA_DIST/sandbox/etc/freshclam.conf +else + lib/sources/clamav/freshclam/.libs/freshclam --user $USER --datadir=$MAGMA_DIST/sandbox/virus --config-file=$MAGMA_DIST/sandbox/etc/freshclam.conf +fi + +# Print statistics for all of the ClamAV database files. printf "\n\n" find sandbox/virus/ \( -type f -name "*.cvd" -print0 \) -or \( -type f -name "*.cld" -print0 \) | xargs -0 --replace={} bash -c '$MAGMA_DIST/lib/sources/clamav/sigtool/sigtool --info={} | grep -v Builder | grep -v MD5 | grep -v "Digital signature" ; printf "\n"' -- cgit v1.2.3