Clamdscan Lstat Failed Permission Denied Error
Contents |
Post #1 of 12 (17743 views) clamdscan permission denied. error Permalink lstat() failed: Permission denied. ERROR Hi all! I'm clamdscan vs clamscan getting the following error message while try to run clamdscan: $ clamdscan eicar.txt eicar.txt:
Allowsupplementarygroups
lstat() failed: Permission denied. ERROR I've enable debug mode and got: $fds_poll_recv: timeout after 600 seconds $Received POLLIN|POLLHUP on fd 5 $Got
Error: Could Not Lookup : Servname Not Supported For Ai_socktype
new connection, FD 10 $Received POLLIN|POLLHUP on fd 6 $fds_poll_recv: timeout after 5 seconds $Received POLLIN|POLLHUP on fd 10 $got command CONTSCAN /home/superuser/eicar.txt (35, 7), argument: /home/superuser/eicar.txt $mode -> MODE_WAITREPLY $Breaking command loop, mode is no longer MODE_COMMAND $Consumed entire command $Number of file descriptors polled: amavis 1 fds $fds_poll_recv: timeout after 600 seconds $THRMGR: queue crossed low threshold -> signaling WARNING: lstat() failed on: /home/superuser/eicar.txt $Finished scanthread $Scanthread: connection shut down (FD 10) $THRMGR: queue crossed low threshold -> signaling This is a RHEL 5.4. Any ideas what's going on here ? Thanks! _______________________________________________ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://www.clamav.net/support/ml dan.mcdonald at austinenergy Dec21,2009,8:12AM Post #2 of 12 (17517 views) Permalink Re: lstat() failed: Permission denied. ERROR [In reply to] On Mon, 2009-12-21 at 13:02 -0300, Lima Union wrote: > Hi all! I'm getting the following error message while try to run clamdscan: > > $ clamdscan eicar.txt > eicar.txt: lstat() failed: Permission denied. ERROR clamdscan runs with the permissions of the daemon user. You probably want to do something like: $ cat eicar.txt | clamdscan -- Danie
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company
Clamav
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions ubuntu add user to group Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Configure clamdscan to scan all files on a system on Unbuntu 12.04 up vote 0 down vote favorite I did the http://www.gossamer-threads.com/lists/clamav/users/45998 following to install clamscan: sudo aptitude install clamav sudo aptitude install clamav-daemon and verified: sudo ps -eal | grep clam 1 S 116 4788 1 2 80 0 - 4004 pause ? 00:00:13 freshclam 1 S 116 5930 1 0 80 0 - 69984 poll_s ? 00:00:00 clamd however when I try to scan all the files on the the system by running #sudo clamdscan / I keep getting the following error message: lstat() http://stackoverflow.com/questions/25437940/configure-clamdscan-to-scan-all-files-on-a-system-on-unbuntu-12-04 failed: Permission denied. ERROR However if I run sudo clamscan / it works, but this process is much longer and not a good option. From my understanding clamd uses the user 'clamav' and is listed in the /etc/clamav/clamd.conf file. I've added the user clamav to the following groups : root, adm, sudo but it still doesn't work. I've also tried disabling Apparmor as I read that could be the issue but no success. ubuntu ubuntu-12.04 share|improve this question asked Aug 22 '14 at 0:28 Maria 63 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote sudo clamdscan /path/to/some_file.txt will pass the request along to the clamd daemon. That daemun runs under a different user, which may not have access to /path/to/some_file.txt However, the user invoking the command, may very well have access to that file. In order to pass your permissions along to the daemon, use the --fdpass flag: --fdpass Pass the file descriptor permissions to clamd. This is useful if clamd is running as a different user as it is faster than streaming the file to clamd. Only available if connected to clamd via local(unix) socket. In your case sudo clamdscan --fdpass / should do the trick. share|improve this answer answered Apr 1 '15 at 13:18 berkes 13.7k1267144 add a comment| Your Answer
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta http://unix.stackexchange.com/questions/91874/postfix-amavis-new-clamav-permission-denied-error Discuss the workings and policies of this site About Us Learn more https://www.mail-archive.com/clamav-users@lists.clamav.net/msg33470.html about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Unix & Linux Questions Tags Users Badges Unanswered Ask Question _ Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. permission denied Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Postfix, Amavis-new, ClamAV: Permission denied. ERROR up vote 4 down vote favorite 1 Error lines in /var/log/maillog Sep 22 12:08:20 sun amavis[4493]: (04493-09) (!)run_av (ClamAV-clamd) FAILED - clamdscan lstat failed unexpected , output="/var/spool/amavisd/tmp/amavis-20130922T052321-04493-crApLkq5/parts: lstat() failed: Permission denied. ERROR\n" Sep 22 12:08:20 sun amavis[4493]: (04493-09) (!)ClamAV-clamd av-scanner FAILED: CODE(0x29185c0) unexpected , output="/var/spool/amavisd/tmp/amavis-20130922T052321-04493-crApLkq5/parts: lstat() failed: Permission denied. ERROR\n" at (eval 113) line 897. Sep 22 12:08:20 sun amavis[4493]: (04493-09) (!)WARN: all primary virus scanners failed, considering backups Server user and group # cat /etc/passwd | grep "amavis\|clamav" clam:x:495:493:Clam Anti Virus Checker:/var/lib/clamav:/sbin/nologin amavis:x:494:492:User for amavisd-new:/var/spool/amavisd:/sbin/nologin # id amavis uid=494(amavis) gid=492(amavis) groups=492(amavis),493(clam) # id clam uid=495(clam) gid=493(clam) groups=493(clam),492(amavis) Services chkconfig --list | grep "amavisd\|clamd\|spamassassin" amavisd 0:off 1:off 2:on 3:on 4:off 5:off 6:off clamd 0:off 1:off 2:on 3:on 4:off 5:on 6:off clamd.amavisd 0:off 1:off 2:on 3:on 4:off 5:off 6:off spamassassin 0:off 1:off 2:on 3:on 4:off 5:off 6:off /etc/clamd.conf LocalSocket /var/run/clamav/clamd.sock LocalSocketGroup amavis User clam /etc/amavisd.conf ### http://www.clamav.net/ ['ClamAV-clamd', \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"], qr/\bOK$/, qr/\bFOUND$/, qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ], # # NOTE: run clamd under the same user as amavisd, or run it under its own # # uid such as clamav, add user clamav to the amavis group, and then add # # AllowSupplementaryGroups to clamd.conf; # # NOTE: match
Message----- From: clamav-users-boun...@lists.clamav.net [mailto:clamav-users- boun...@lists.clamav.net] On Behalf Of Lima Union Sent: Monday, December 21, 2009 12:41 PM To: ClamAV users ML Subject: Re: [Clamav-users] lstat() failed: Permission denied. ERROR You mean substituting clamdscan for clamscan ? This is the result: clamscan eicar.txt eicar.txt: Eicar-Test-Signature FOUND ----------- SCAN SUMMARY ----------- Known viruses: 678203 Engine version: 0.95.3 Scanned directories: 0 Scanned files: 1 Infected files: 1 Data scanned: 0.00 MB Data read: 0.00 MB (ratio 0.00:1) Time: 1.864 sec (0 m 1 s) But clamdscan still doesn't work... :( It's likely that the user clamd runs as doesn't have correct permissions to access the file you're scanning. An earlier suggestion was close but, I think, missing something. Try adding a hyphen at the end: cat eicar.txt | clamdscan - Your suggestion works! so this is a file permission problem ? where should I look ? Thanks! Hi Lima, I should let the experts answer, but I'll take a stab at it just to find out for myself. One of the differences between clamscan and clamdscan is that clamscan runs as the user requesting it whereas clamdscan runs as a special user (usually clamd, I believe), which would be in a special administrative category allowing it to read across multiple user's files. So you probably do not have a file permission problem per se and that is why the hyphen option is included so that when you run clamdscan as a normal user you can do what you were trying to do. I would recommend consulting "man clamdscan" for the options and descriptions. Let's see what others have to say. --Robert _______________________________________________ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://www.clamav.net/support/ml Previous message View by thread View by date Next message [Clamav-users] lstat() failed: Permission denied. ERROR Lima Union Re: [Clamav-users] lstat() failed: Permission denie... Daniel J McDonald Re: [Clamav-users] lstat() failed: Permission d... Lima Union Re: [Clamav-users] lstat() failed: Permission denie... Robert Wyatt Re: [Clamav-users] lstat() failed: Permission d... Lima Union Re: [Clamav-users] lstat() failed: Permissi... Jason Bertoch Re: [Clamav-users] lstat() failed: Perm... Lima Union Re: [Clamav-users] lstat() failed:... Robert Wyatt Re: [Clamav-users] lstat() fai... Lima Union Re: [Clamav-users] lstat()... Lima Union Re: [Clamav-users] lstat()... Jim Preston [Clamav-users] lstat() failed: Permission denied. E... dev . admin Reply via email to Search the site The Mail Archive home clamav-users - all me