diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-05-21 12:15:16 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-05-21 12:15:58 +0000 |
commit | 72d47b678d5cae58df6ea8c2c44e2e7ec4b5c3e5 (patch) | |
tree | 8dd44f4134913ae824816f6bda16c298d680d0e9 /main/clamav/clamd.initd | |
parent | 0e9949e1c4475d8e77cfffbe2bf9daf75050872f (diff) | |
download | aports-72d47b678d5cae58df6ea8c2c44e2e7ec4b5c3e5.tar.bz2 aports-72d47b678d5cae58df6ea8c2c44e2e7ec4b5c3e5.tar.xz |
main/clamav: fix creation of socket dir
fixes #4175
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} +} + + |