From 72d47b678d5cae58df6ea8c2c44e2e7ec4b5c3e5 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 21 May 2015 12:15:16 +0000 Subject: main/clamav: fix creation of socket dir fixes #4175 --- main/clamav/clamd.initd | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'main/clamav/clamd.initd') diff --git a/main/clamav/clamd.initd b/main/clamav/clamd.initd index f4d5cb27cc..37e29ecd0e 100755 --- a/main/clamav/clamd.initd +++ b/main/clamav/clamd.initd @@ -16,6 +16,7 @@ start() { local clamd_socket=$(awk '$1 == "LocalSocket" { print $2 }' $CONF) logfix + socketfix if [ -S "${clamd_socket:=/tmp/clamd}" ]; then rm -f ${clamd_socket} @@ -77,3 +78,14 @@ logfix() { chmod 640 ${logfile} fi } + +socketfix() { + # fix clamd run permissions + local socket=`awk '$1 == "LocalSocket" { print $2 }' $CONF` + local socketdir=${socket%/*} + local clamav_user=`awk '$1 == "User" { print $2 }' $CONF` + checkpath --directory --owner ${clamav_user:-clamav} \ + ${socketdir:-/var/run/clamav} +} + + -- cgit v1.2.3