How to fix amvavis reporting "permission denied" for clamav

aSteve

I've recently noticed a frustrating niggle... When processing email, an Ubuntu Server (with all the updates applied) reports "Permission denied" when trying to virus scan attachments.

Apr  2 14:05:20 svr amavis[6376]: (06376-01) (!)run_av (ClamAV-clamd) FAILED - unexpected , output="/var/lib/amavis/tmp/amavis-20150402T140519-06376-PZcyHfOt/parts: lstat() failed: Permission denied. ERROR\n"
Apr  2 14:05:20 svr amavis[6376]: (06376-01) (!)ClamAV-clamd av-scanner FAILED: CODE(0x30cf250) unexpected , output="/var/lib/amavis/tmp/amavis-20150402T140519-06376-PZcyHfOt/parts: lstat() failed: Permission denied. ERROR\n" at (eval 136) line 899.
Apr  2 14:05:20 svr amavis[6376]: (06376-01) (!)WARN: all primary virus scanners failed, considering backups

When I look at the directories in question, I see this:

$ ls -ld /var/lib/amavis/tmp
drwxrwx--- 4 amavis amavis 4096 Apr  2 14:16 /var/lib/amavis/tmp
$ ls -ld /var/lib/amavis/tmp/amavis-20150402T140519-06376-PZcyHfOt/
drwxr-x--- 3 amavis amavis 4096 Apr  2 14:05 /var/lib/amavis/tmp/amavis-20150402T140519-06376-PZcyHfOt/
$ ls -ld /var/lib/amavis/tmp/amavis-20150402T140519-06376-PZcyHfOt/parts                                                                                                                                                                           
drwxr-x--- 2 amavis amavis 4096 Apr  2 14:16 /var/lib/amavis/tmp/amavis-20150402T140519-06376-PZcyHfOt/parts

I made sure the clamd user is a member of the amavisd group - but this didn't fix anything. Can anyone tell me, specifically, which component wants what permissions - and... ideally... what to do to fix this?

Clarification: I am not looking for explanations of the fundamentals of permissions. I am looking for a solution appropriate to this specific problem - which, at first glance, at least, looks as if a component of the amavis suite (perhaps clamd) is using the wrong umask value. Of course, this fault may have arisen as a result of a number of bugs or configuration glitches. I am looking, specifically, for the most appropriate resolution for this case... where a 'vanilla' amavis/clamav install fails to access the contents of temporary folders it creates as/when required to scan inbound email.

I am aware of this similar (non-Ubuntu) question. The Redhat/Centos answer doesn't solve the problem I experience with Ubuntu.

This problem is encountered on "Ubuntu 14.04.2 LTS" - there are no pending updates.

aSteve

While the clamd user was a member of the amavis group, the clamd process was running as the clamav (not clamd) user.

Adding clamav to the amavis group solved the issue.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to fix permission denied for .git/ directory when performing git push?

How to fix docker: Got permission denied issue

How to fix Error: mkdir(): Permission denied when running composer

How to fix gradlew permission denied in travis.yml?

How can I fix "PermissionError: [Errno 13] Permission denied: 'static'"?

How to fix Permission denied (publickey,password) in gitlab Ci/CD?

How do I fix ngrok permission denied?

How to fix" Permission denied when creating a hive orc table using spark "?

How to fix 'Permission denied'?

How to fix: Permission Denied, runtime error 70, FSO filescripting, Computer Issue

How to fix 'Permission denied' in Docker sh entrypoint

HOW to fix 'PermissionError: [Errno 13] Permission denied' in python-crontab in docker image?

How to fix Error: laravel.log could not be opened Permission denied?

How to fix Permission Denied (Public key) error?

How to fix "Permission Denied" in Git Bash in Windows 10?

How to fix 'Permission Denied' when using csshX

gitlab: Windows: How to use chmod and fix "Get Permission denied (publickey). fatal: Could not read from remote repository"

How do I fix this "Permission denied" error I get every time I execute aptitude?

How to fix “Permission denied” when trying to edit a file on aws server?

How to fix `listen EACCES: permission denied` on any port

How to fix [Errno13] permission denied when trying to read excel file?

How to fix " Error: Permission denied @ [file directory here]" while 'limking' python 3 on Mac

How to fix [Errno 13] Permission denied with openpyxl

How to fix Nginx connection to socket failed (Permission denied)

How to fix psutil import error "permission denied" on linux?

How can I fix "[Errno 13] Permission denied: '_cmp.pyi'" in my Python nix flake?

How do I Fix "Permission Denied" Error in Python

How do I fix the npm error EACCES: permission denied?

How do I fix problem with getting "permission denied" when Flask server is saving an image file