Forums | Mahara Community

Support /
File upload and ClamAV - edit, fixed.


anonymous profile picture
Account deleted
Posts: 1

20 June 2012, 6:19

I have a test install of Mahara 1.5 running under a basic Ubuntu 10.04.4 LTS LAMP setup.

My mahara data folder is at /var/maharadata

I have ClamAV (0.96.5) enabled for upload scanning, using clamd in daemon mode, running as user "clamav"

I've also enabled LogClean true in /etc/clamav/clamd.conf so I can see successful upload scanning in the logs.

If I upload a profile picture, the file uploads and is scanned by ClamAV without any issue and places it in /var/maharadata/artefact/file/profileicons/.....etc

If I upload the same file (or any other file) to my Files, it fails complaining about ClamAV misconfiguration.  ClamAV itself complains that

==> /var/log/clamav/clamav.log <==
Wed Jun 20 11:26:16 2012 -> WARNING: lstat() failed on: /var/www/artefact/file

If I turn off ClamAV scanning in the Mahara config, files upload without issue.

So my question(s):

1) Is ClamAV looking in the right place?  I was expecting it to be looking in /var/maharadata/artefact....

2) How does the scanning/uploading of profile pictures vs normal files differ?  It looks like a permissions issue with the "clamav" user being unable to write/access something.

Fix.

edit: Right, it's apparmour kicking in and blocking the scan when called by the file upload function (as opposed to the profile picture upload function?).

To set apparmour to "whine, but do it anyway" issue sudo aa-complain clamd

I'm still puzzled as to why one file upload function works without tweaking apparmour, but the other doesn't.

1 result