Bug 754555 - clamav-update does not create freshclam.log with correct permissions
Summary: clamav-update does not create freshclam.log with correct permissions
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: clamav
Version: rawhide
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Enrico Scholz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-16 20:08 UTC by Philip Prindeville
Modified: 2012-07-10 20:59 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-10 20:59:03 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 753962 0 unspecified CLOSED Selinux blocks mimedefang communicating with clamav 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 787434 0 unspecified CLOSED Clamav does not create /var/run/clamd.scan/ with correct permissions 2021-02-22 00:41:40 UTC

Internal Links: 753962 787434

Description Philip Prindeville 2011-11-16 20:08:10 UTC
Description of problem:

Having done an install of clamav-update, and verified that the log file was created per the script:

[root@mail ~]# rpm -q --scripts clamav-update
postinstall scriptlet (using /bin/sh):
test -e /var/log/freshclam.log || {
	touch /var/log/freshclam.log
	/bin/chmod 0664 /var/log/freshclam.log
	/bin/chown root:clamupdate /var/log/freshclam.log
}
[root@mail ~]# ls -ld /var/log/freshclam.log 
-rw-rw-r--. 1 root clamupdate 986 Nov 15 15:37 /var/log/freshclam.log
[root@mail ~]# 

I am nonetheless seeing error messages coming back from cron via email:

ERROR: Problem with internal logger (UpdateLogFile = /var/log/freshclam.log).
ERROR: Can't open /var/log/freshclam.log in append mode (check permissions!).


Version-Release number of selected component (if applicable):

clamav-update-0.97.3-1500


How reproducible:

Install clamav-update ... wait... read email.


Steps to Reproduce:
1.
2.
3.
  
Actual results:

The above error messages occurs at each cron interval.

Expected results:

It should not be generating warnings.

Additional info:

Comment 1 Philip Prindeville 2011-11-16 22:31:07 UTC
And... this may be a selinux issue:

[root@mail tmp]# audit2allow -m local > local.te
type=AVC msg=audit(1321481570.162:6971): avc:  denied  { open } for  pid=31073 comm="freshclam" name="freshclam.log" dev=sda2 ino=1179679 scontext=system_u:system_r:freshclam_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_log_t:s0 tclass=file
[root@mail tmp]# cat local.te

module local 1.0;

require {
	type var_log_t;
	type freshclam_t;
	class file open;
}

#============= freshclam_t ==============
allow freshclam_t var_log_t:file open;
[root@mail tmp]#

Comment 2 Daniel Walsh 2011-11-17 21:34:02 UTC
postinstall scriptlet (using /bin/sh):
test -e /var/log/freshclam.log || {
 touch /var/log/freshclam.log
 /bin/chmod 0664 /var/log/freshclam.log
 /bin/chown root:clamupdate /var/log/freshclam.log
 [-x /sbin/restorecon ] && /sbin/restorecon /var/log/freshclam.log
}

Will fix the problem.

Comment 3 Daniel Walsh 2011-11-17 21:34:43 UTC
Please fix this in F15 and F16, not sure if this effects RHEL6?

Comment 4 Fedora Update System 2012-01-08 13:12:49 UTC
clamav-0.97.3-1601.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/clamav-0.97.3-1601.fc16

Comment 5 Fedora Update System 2012-01-11 06:09:59 UTC
Package clamav-0.97.3-1601.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing clamav-0.97.3-1601.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-0334/clamav-0.97.3-1601.fc16
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2012-02-04 12:52:47 UTC
clamav-0.97.3-1602.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/clamav-0.97.3-1602.fc16

Comment 7 Philip Prindeville 2012-02-05 03:26:59 UTC
(In reply to comment #6)
> clamav-0.97.3-1602.fc16 has been submitted as an update for Fedora 16.
> https://admin.fedoraproject.org/updates/clamav-0.97.3-1602.fc16

This should have been yanked from testing for the reasons indicated in Bohdi.

See also #787434 for a still unresolved bug.

Comment 8 Fedora Update System 2012-06-16 10:48:54 UTC
clamav-0.97.5-1600.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/clamav-0.97.5-1600.fc16

Comment 9 Fedora Update System 2012-07-10 20:59:03 UTC
clamav-0.97.5-1600.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.