diff --git a/net-snmp-tmpfilesd.conf b/net-snmp-tmpfilesd.conf new file mode 100644 index 0000000..7130bce --- /dev/null +++ b/net-snmp-tmpfilesd.conf @@ -0,0 +1 @@ +d /var/lib/net-snmp 0755 root root - diff --git a/net-snmp.spec b/net-snmp.spec index 3fe6c90..ee0c7be 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 18%{?dist} +Release: 19%{?dist} Epoch: 1 License: MIT-CMU and BSD-3-Clause and MIT and OpenSSL @@ -26,6 +26,7 @@ Source7: net-snmp-tmpfs.conf Source8: snmpd.service Source9: snmptrapd.service Source10: IETF-MIB-LICENSE.txt +Source11: net-snmp-tmpfilesd.conf Patch1: net-snmp-5.9-pie.patch Patch2: net-snmp-5.9-dir-fix.patch @@ -70,7 +71,7 @@ Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} # is not valid. We can use %%post because this particular %%triggerun script # should fire just after this package is installed. %{?systemd_requires} -BuildRequires: make +BuildRequires: make BuildRequires: systemd BuildRequires: gcc BuildRequires: openssl-devel, bzip2-devel, elfutils-devel @@ -97,6 +98,8 @@ BuildRequires: perl(warnings) BuildRequires: lm_sensors-devel >= 3 %endif BuildRequires: autoconf, automake +# For _tmpfilesdir macro +BuildRequires: systemd-rpm-macros %description SNMP (Simple Network Management Protocol) is a protocol used for @@ -351,6 +354,7 @@ install -m 644 %SOURCE4 %{buildroot}%{_sysconfdir}/snmp/snmptrapd.conf install -d %{buildroot}%{_sysconfdir}/sysconfig install -m 644 %SOURCE5 %{buildroot}%{_sysconfdir}/sysconfig/snmpd install -m 644 %SOURCE6 %{buildroot}%{_sysconfdir}/sysconfig/snmptrapd +install -p -D -m 644 %SOURCE11 %{buildroot}%{_tmpfilesdir}/%{name}.conf # prepare /var/lib/net-snmp install -d %{buildroot}%{_localstatedir}/lib/net-snmp @@ -446,6 +450,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_bindir}/snmpconf %{_bindir}/net-snmp-create-v3-user %{_sbindir}/* +%{_tmpfilesdir}/%{name}.conf %attr(0644,root,root) %{_mandir}/man[58]/snmp*d* %attr(0644,root,root) %{_mandir}/man5/snmp_config.5.gz %attr(0644,root,root) %{_mandir}/man5/variables* @@ -523,6 +528,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Feb 02 2026 Josef Ridky - 1:5.9.4-19 +- fix creation of /var/lib/net-snmp in image mode (RHEL-132654) + * Tue Jan 13 2026 Josef Ridky - 1:5.9.4-18 - fix out-of-bound access issue (RHEL-137498)