diff options
Diffstat (limited to 'main/clamav/clamd.initd')
-rwxr-xr-x | main/clamav/clamd.initd | 12 |
1 files changed, 12 insertions, 0 deletions
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} +} + + |