From db17a304b00b71be619c2361030a3c81d117edcb Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 23 Feb 2019 10:34:16 +0100 Subject: [PATCH] [ClamAV] Create directory before handling whitelist --- data/Dockerfiles/clamd/bootstrap.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/data/Dockerfiles/clamd/bootstrap.sh b/data/Dockerfiles/clamd/bootstrap.sh index 0bd2fb26..1d49cd20 100755 --- a/data/Dockerfiles/clamd/bootstrap.sh +++ b/data/Dockerfiles/clamd/bootstrap.sh @@ -7,6 +7,9 @@ if [[ "${SKIP_CLAMD}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then fi # Prepare whitelist + +mkdir -p /run/clamav /var/lib/clamav + if [[ -s /etc/clamav/whitelist.ign2 ]]; then echo "Copying non-empty whitelist.ign2 to /var/lib/clamav/whitelist.ign2" cp /etc/clamav/whitelist.ign2 /var/lib/clamav/whitelist.ign2 @@ -16,14 +19,15 @@ if [[ ! -f /var/lib/clamav/whitelist.ign2 ]]; then echo "Example-Signature.Ignore-1" > /var/lib/clamav/whitelist.ign2 fi -mkdir -p /run/clamav /var/lib/clamav - chown clamav:clamav -R /var/lib/clamav /run/clamav chmod 755 /var/lib/clamav chmod 644 -R /var/lib/clamav/* chmod 750 /run/clamav +echo "Stating whitelist.ign2" +stat /var/lib/clamav/whitelist.ign2 + dos2unix /var/lib/clamav/whitelist.ign2 sed -i '/^\s*$/d' /var/lib/clamav/whitelist.ign2