From 174d267d5a849178c742c574edcf60a831e63695 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 18:20:35 +0000 Subject: [PATCH 1/4] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- clamav.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clamav.spec b/clamav.spec index 2ad2853..7bbdc37 100644 --- a/clamav.spec +++ b/clamav.spec @@ -26,7 +26,7 @@ Summary: End-user tools for the Clam Antivirus scanner Name: clamav Version: 1.4.3 -Release: 1%{?dist} +Release: 2%{?dist} License: %{?with_unrar:proprietary}%{!?with_unrar:GPL-2.0-only} URL: https://www.clamav.net/ %if %{with unrar} @@ -665,6 +665,9 @@ done %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 1.4.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Wed Jun 18 2025 Gwyn Ciesla - 1.4.3-1 - 1.4.3 From 1f1f2b49de3a56477b63d53dee815c00bdb80098 Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Mon, 25 Aug 2025 12:36:30 -0500 Subject: [PATCH 2/4] Revert "Add sysusers.d config file to allow rpm to create users/groups automatically" This reverts commit a5a23da3f55a76acdeb2ff2a0799bc00b0fa7f71. --- clamav.spec | 65 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/clamav.spec b/clamav.spec index 2ad2853..f036763 100644 --- a/clamav.spec +++ b/clamav.spec @@ -26,7 +26,7 @@ Summary: End-user tools for the Clam Antivirus scanner Name: clamav Version: 1.4.3 -Release: 1%{?dist} +Release: 2%{?dist} License: %{?with_unrar:proprietary}%{!?with_unrar:GPL-2.0-only} URL: https://www.clamav.net/ %if %{with unrar} @@ -161,6 +161,7 @@ Summary: Filesystem structure for clamav # Prevent version mix Conflicts: %{name} < %{version}-%{release} Conflicts: %{name} > %{version}-%{release} +Requires(pre): shadow-utils BuildArch: noarch %description filesystem @@ -294,6 +295,7 @@ Requires: data(clamav) Requires: clamav-filesystem = %{version}-%{release} Requires: clamav-lib = %{version}-%{release} Requires: coreutils +Requires(pre): shadow-utils # This is still used by clamsmtp and exim-clamav Provides: clamav-server = %{version}-%{release} Provides: clamav-scanner-systemd = %{version}-%{release} @@ -314,9 +316,9 @@ Summary: Milter module for the Clam Antivirus scanner #Requires: clamd = %%{version}-%%{release} #Requires: /usr/sbin/sendmail Requires: clamav-filesystem = %{version}-%{release} +Requires(pre): shadow-utils Provides: clamav-milter-systemd = %{version}-%{release} Obsoletes: clamav-milter-systemd < %{version}-%{release} -Requires: group(clamscan) %description milter This package contains files which are needed to run the clamav-milter. @@ -354,21 +356,6 @@ install -p -m0644 %{SOURCE300} clamav-milter/ mkdir -p libclamunrar{,_iface} %{!?with_unrar:touch libclamunrar/{Makefile.in,all,install}} -# Create sysusers.d config files -cat >clamav.sysusers.conf <clamd.sysusers.conf <clamav-milter.sysusers.conf <= 9 %generate_buildrequires @@ -378,6 +365,7 @@ cd libclamav_rust %cargo_generate_buildrequires %endif + %build # add -Wl,--as-needed if not exist export LDFLAGS=$(echo %{?__global_ldflags} | sed '/-Wl,--as-needed/!s/$/ -Wl,--as-needed/') @@ -495,10 +483,6 @@ install -m 0644 %SOURCE1 %{buildroot}%{_includedir}/clamav-types.h # TODO: Evaluate using upstream's unit with clamav-daemon.socket rm %{buildroot}%{_unitdir}/clamav-daemon.* -install -m0644 -D clamav.sysusers.conf %{buildroot}%{_sysusersdir}/clamav.conf -install -m0644 -D clamd.sysusers.conf %{buildroot}%{_sysusersdir}/clamd.conf -install -m0644 -D clamav-milter.sysusers.conf %{buildroot}%{_sysusersdir}/clamav-milter.conf - %check %ifarch s390x @@ -532,6 +516,25 @@ do [ -f $f -a $f -nt $cvd ] && rm -f $cvd || : done + +%pre filesystem +getent group %{updateuser} >/dev/null || groupadd -r %{updateuser} +getent passwd %{updateuser} >/dev/null || \ + useradd -r -g %{updateuser} -d %{homedir} -s /sbin/nologin \ + -c "Clamav database update user" %{updateuser} +getent group virusgroup >/dev/null || groupadd -r virusgroup +usermod %{updateuser} -a -G virusgroup +exit 0 + + +%pre -n clamd +getent group %{scanuser} >/dev/null || groupadd -r %{scanuser} +getent passwd %{scanuser} >/dev/null || \ + useradd -r -g %{scanuser} -d / -s /sbin/nologin \ + -c "Clamav scanner user" %{scanuser} +usermod %{scanuser} -a -G virusgroup +exit 0 + %post -n clamd # Point to the new service unit [ -L /etc/systemd/system/multi-user.target.wants/clamd@scan.service ] && @@ -544,6 +547,20 @@ done %postun -n clamd %systemd_postun_with_restart clamd@scan.service + +%triggerin milter -- clamav-scanner +# Add the milteruser to the scanuser group; this is required when +# milter and clamd communicate through local sockets +/usr/sbin/groupmems -g %{scanuser} -a %{milteruser} &>/dev/null || : + +%pre milter +getent group %{milteruser} >/dev/null || groupadd -r %{milteruser} +getent passwd %{milteruser} >/dev/null || \ + useradd -r -g %{milteruser} -d %{_rundir}/clamav-milter -s /sbin/nologin \ + -c "Clamav Milter user" %{milteruser} +usermod %{milteruser} -a -G virusgroup +exit 0 + %post milter %systemd_post clamav-milter.service @@ -610,7 +627,6 @@ done %dir %{_sysconfdir}/clamd.d # Used by both clamd, clamdscan, and clamonacc %config(noreplace) %{_sysconfdir}/clamd.d/scan.conf -%{_sysusersdir}/clamav.conf %files data @@ -650,7 +666,6 @@ done %{_sbindir}/clamd %{_unitdir}/clamd@.service %{_tmpfilesdir}/clamd.scan.conf -%{_sysusersdir}/clamd.conf %files milter @@ -661,10 +676,12 @@ done %dir %{_sysconfdir}/mail %config(noreplace) %{_sysconfdir}/mail/clamav-milter.conf %{_tmpfilesdir}/clamav-milter.conf -%{_sysusersdir}/clamav-milter.conf %changelog +* Mon Aug 25 2025 Gwyn Ciesla - 1.4.3-2 +- Revert sysusers change + * Wed Jun 18 2025 Gwyn Ciesla - 1.4.3-1 - 1.4.3 From 997040fb1e1c61fbdc3e7d1e25936c17eb6354b3 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 4 Dec 2025 10:03:08 +0000 Subject: [PATCH 3/4] Allow hex-literal 1.0 --- ...341e8e34aa325ac03718121e33a3b4e5b75e.patch | 22 ------------------- clamav-rust-dependency-versions.patch | 21 ++++++++++++++++++ clamav.spec | 14 ++++++------ 3 files changed, 28 insertions(+), 29 deletions(-) delete mode 100644 24d1341e8e34aa325ac03718121e33a3b4e5b75e.patch create mode 100644 clamav-rust-dependency-versions.patch diff --git a/24d1341e8e34aa325ac03718121e33a3b4e5b75e.patch b/24d1341e8e34aa325ac03718121e33a3b4e5b75e.patch deleted file mode 100644 index 7bd5cfb..0000000 --- a/24d1341e8e34aa325ac03718121e33a3b4e5b75e.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 24d1341e8e34aa325ac03718121e33a3b4e5b75e Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Sun, 15 Sep 2024 12:50:07 -0400 -Subject: [PATCH] In libclamav_rust, use the current version of the image crate - ---- - libclamav_rust/Cargo.toml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libclamav_rust/Cargo.toml b/libclamav_rust/Cargo.toml -index 526951c519..eb95ca8011 100644 ---- a/libclamav_rust/Cargo.toml -+++ b/libclamav_rust/Cargo.toml -@@ -12,7 +12,7 @@ log = { version = "0.4", features = ["std"] } - sha2 = "0.10" - tempfile = "3" - thiserror = "1" --image = "0.24" -+image = "0.25" - rustdct = "0.7" - transpose = "0.2" - num-traits = "0.2" diff --git a/clamav-rust-dependency-versions.patch b/clamav-rust-dependency-versions.patch new file mode 100644 index 0000000..56bd08d --- /dev/null +++ b/clamav-rust-dependency-versions.patch @@ -0,0 +1,21 @@ +diff -Naur clamav-1.4.3-original/libclamav_rust/Cargo.toml clamav-1.4.3/libclamav_rust/Cargo.toml +--- clamav-1.4.3-original/libclamav_rust/Cargo.toml 2025-12-04 10:01:33.233889863 +0000 ++++ clamav-1.4.3/libclamav_rust/Cargo.toml 2025-12-04 10:02:29.088468217 +0000 +@@ -12,7 +12,7 @@ + sha2 = "0.10" + tempfile = "3" + thiserror = "1" +-image = "0.24" ++image = ">=0.24, <0.26" + rustdct = "0.7" + transpose = "0.2" + num-traits = "0.2" +@@ -21,7 +21,7 @@ + unicode-segmentation = "1.10" + bindgen = "0.69" + onenote_parser = "0.3.1" +-hex-literal = "0.4" ++hex-literal = ">=0.4, <2.0" + inflate = "0.4" + bzip2-rs = "0.1" + byteorder = "1.5" diff --git a/clamav.spec b/clamav.spec index 7bbdc37..e09b9c4 100644 --- a/clamav.spec +++ b/clamav.spec @@ -75,8 +75,12 @@ Patch5: clamav-clamonacc-service.patch Patch6: clamav-freshclam.service.patch # Debian patch to fix big-endian Patch7: https://salsa.debian.org/clamav-team/clamav/-/raw/unstable/debian/patches/libclamav-pe-Use-endian-wrapper-in-more-places.patch -# Update the image crate dependency to 0.25, the current release -Patch8: https://github.com/Cisco-Talos/clamav/pull/1366/commits/24d1341e8e34aa325ac03718121e33a3b4e5b75e.patch +# - Update the image crate dependency to 0.25, the current release, +# https://github.com/Cisco-Talos/clamav/pull/1366/commits/24d1341e8e34aa325ac03718121e33a3b4e5b75e, +# allowing 0.24 for backwards-compatibility with vendored dependencies in EPEL8 +# - Allow version 1.0 of the hex-literal crate dependency; not suitable for +# upstream yet due to MSRV +Patch8: clamav-rust-dependency-versions.patch BuildRequires: cmake3 BuildRequires: gettext-devel @@ -343,11 +347,7 @@ cd .. %patch -P5 -p1 -b .clamonacc-service %patch -P6 -p1 -b .freshclam-service %patch -P7 -p1 -b .big-endian -# This patch is not made to be backwards-compatible (even though it could have -# been), and the vendored dependencies in EPEL8 include image 0.24, not 0.25. -%if 0%{?fedora} || 0%{?rhel} >= 9 -%patch -P8 -p1 -b .image-0.25 -%endif +%patch -P8 -p1 -b .rust-dependencies install -p -m0644 %{SOURCE300} clamav-milter/ From 1fb46f57547554441dd90612360f0198aee5971b Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Thu, 4 Dec 2025 16:45:08 -0600 Subject: [PATCH 4/4] Bump EVR --- clamav.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clamav.spec b/clamav.spec index e09b9c4..60ea311 100644 --- a/clamav.spec +++ b/clamav.spec @@ -26,7 +26,7 @@ Summary: End-user tools for the Clam Antivirus scanner Name: clamav Version: 1.4.3 -Release: 2%{?dist} +Release: 3%{?dist} License: %{?with_unrar:proprietary}%{!?with_unrar:GPL-2.0-only} URL: https://www.clamav.net/ %if %{with unrar} @@ -665,6 +665,9 @@ done %changelog +* Thu Dec 04 2025 Gwyn Ciesla - 1.4.3-3 +- Bump EVR, hex-literal patches. + * Wed Jul 23 2025 Fedora Release Engineering - 1.4.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild