Bug 1821973 - /usr/lib/tmpfiles.d/clamd.scan.conf not packaged as a config file in rpm spec file
Summary: /usr/lib/tmpfiles.d/clamd.scan.conf not packaged as a config file in rpm spec...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: clamav
Version: epel7
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Robert Scheck
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-08 00:42 UTC by Andrew Meredith
Modified: 2021-09-05 20:18 UTC (History)
11 users (show)

Fixed In Version: clamav-0.103.3-4.fc33 clamav-0.103.3-4.fc34 clamav-0.103.3-5.el8 clamav-0.103.3-5.el7
Clone Of:
Environment:
Last Closed: 2021-08-24 01:05:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Andrew Meredith 2020-04-08 00:42:35 UTC
Description of problem:

In order to integrate with mail framework /usr/lib/tmpfiles.d/clamd.scan.conf has been updated to use different owner and group, but as it isn't noted as a config file in the rpm spec file, this update gets overwritten with every rpm update .. which is a regular occurrence.

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

0.102.2-4.el7.x86_64

How reproducible:

Every update

Steps to Reproduce:
1. change the owner and group in /usr/lib/tmpfiles.d/clamd.scan.conf
2. change the permissions of /run/clamd.scan to match
3. run an update

Actual results:

The conf file changes back, causing problems at reboot

Expected results:

The conf file remains as it is with the new permissions intact

Additional info:

The practical effect is that the mail framework can no longer talk to the clamd daemon and the mail pipeline stalls.

Comment 1 Orion Poplawski 2020-04-09 01:41:11 UTC
See "Configuration Directories and Precedence" in https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html

Place your local custom config in /etc/tmpfiles.d/clamd.scan.conf.

Comment 2 Andrew Meredith 2020-06-03 13:44:07 UTC
I implemented the fix as above by adding a new file at /etc/tmpfiles.d/clamd.scan.conf

This worked for a while until the next update, when the fact that "/run/clamd.scan" is part of the rpm package as well as having the tmpfile.d config file became significant. The directory reference in the rpm also hardwires the wrong (for me) permissions.

The upshot was that clamd became inaccessible again and permission errors were thrown at restart. This jams up the mail server.

Comment 3 Orion Poplawski 2020-06-04 00:15:44 UTC
Ah, interesting.  We might be able to work around this by invoking systemd-tmpfiles in %post - but honestly you might be better off by defining your own clamd instance.

Comment 4 Orion Poplawski 2020-06-04 00:17:31 UTC
FYI - I face the same issue as well and have worked around it locally by running an ansible playbook after upgrades.  But I may just take my own advice above if I can't figure out a way to deal with this.

Comment 5 Sergio Basto 2020-06-14 18:32:50 UTC
from https://src.fedoraproject.org/rpms/clamav/blob/master/f/clamav.spec#_585 [1] 

I wonder if `%ghost %dir %attr(0710,%scanuser,virusgroup) %scanstatedir` is incorrect and should be just `%ghost %dir %scanstatedir` ? 

[1] 
%files -n clamd
(...)
%ghost %scanstatedir/clamd.sock
%if %{with tmpfiles}
  %_tmpfilesdir/clamd.scan.conf
  %ghost %dir %attr(0710,%scanuser,virusgroup) %scanstatedir
%else
  %dir %attr(0710,%scanuser,virusgroup) %scanstatedir
%endif

Comment 6 gyuyjxz5kv 2020-06-14 20:05:41 UTC
Not sure why I'm being cc'd here.  I reported bug 1840725. Is there a connection?

Comment 8 Sergio Basto 2020-06-15 03:29:37 UTC
My propose https://src.fedoraproject.org/rpms/clamav/pull-request/17

Comment 9 Fedora Update System 2021-08-15 13:49:57 UTC
FEDORA-2021-bfc4af9c9c has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-bfc4af9c9c

Comment 10 Fedora Update System 2021-08-15 13:50:18 UTC
FEDORA-2021-47655cb90e has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-47655cb90e

Comment 11 Fedora Update System 2021-08-15 13:51:09 UTC
FEDORA-EPEL-2021-90fc336455 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-90fc336455

Comment 12 Sergio Basto 2021-08-15 14:22:25 UTC
I think not running /bin/systemd-tmpfiles --create %_tmpfilesdir/clamd.scan.conf on post can fix this bug [1] 

please test it, thank you. 


[1]
https://src.fedoraproject.org/rpms/clamav/c/7f94084fd5c606f94c20c0aff0c0d0fc19b404dc?branch=rawhide

Comment 13 Fedora Update System 2021-08-15 20:25:44 UTC
FEDORA-EPEL-2021-c3dde95087 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-c3dde95087

Comment 14 Fedora Update System 2021-08-16 01:07:35 UTC
FEDORA-2021-bfc4af9c9c has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-bfc4af9c9c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-bfc4af9c9c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2021-08-16 01:12:48 UTC
FEDORA-2021-47655cb90e has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-47655cb90e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-47655cb90e

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2021-08-16 01:44:51 UTC
FEDORA-EPEL-2021-90fc336455 has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-90fc336455

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2021-08-16 01:45:16 UTC
FEDORA-EPEL-2021-c3dde95087 has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-c3dde95087

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 18 Fedora Update System 2021-08-24 01:05:18 UTC
FEDORA-2021-47655cb90e has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Fedora Update System 2021-08-24 03:32:41 UTC
FEDORA-2021-bfc4af9c9c has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 20 Fedora Update System 2021-08-29 18:43:41 UTC
FEDORA-EPEL-2021-568f2e4092 has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-568f2e4092

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 21 Fedora Update System 2021-08-29 18:53:55 UTC
FEDORA-EPEL-2021-01e7b83241 has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-01e7b83241

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 22 Fedora Update System 2021-09-05 20:15:32 UTC
FEDORA-EPEL-2021-568f2e4092 has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 23 Fedora Update System 2021-09-05 20:18:39 UTC
FEDORA-EPEL-2021-01e7b83241 has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, 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.