Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I can't seem to get this thing to work, some permission problem maybe, but i can't even run clamdscan normally form console with root the result is always Permission denied. for example i create a file test.txt (eicar file) in /tmp and execute "clandscan /tmp/test.txt" in console logged in as root and i get "/tmp/test.txt: Access denied. ERROR ". The clamd demon is running with user clamav could that be the reason? Now i want to scan the same file (/tmp/test.txt) via php , so i run (i have chowned the file to apache:apache )

$cmd="clamdscan /tmp/test.txt";
exec($cmd,$a,$b);

i get error 127 i try with the full path of the command /usr/bin/clamdscan i get error 126 (command is found but is not executable), this means that apache doesn't have the permission to execute /usr/bin/clamdscan ? what could be the problem?

share|improve this question

migrated from stackoverflow.com Dec 14 '12 at 23:49

This question came from our site for professional and enthusiast programmers.

    
Does /usr/bin/clamdcscan have execute flag set? Root won't run a program if there's no execute mode on it. –  Barmar Dec 14 '12 at 18:44
    
yes it has +x set –  Nikola Dec 14 '12 at 19:20

1 Answer 1

Which distro are you using and what verison. There are a number of challenges related to getting this all working which include selinux in RHEL, the new private tmp approach which is in Fedora17. If you stop the clamd deamon and start it from command line as root and then run clamdscan will this work?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.