SHA256
1
0
forked from pool/firewalld

Accepting request 960050 from home:mwilck:modprobe.d

- Add code for safe modprobe.d migration
  (https://en.opensuse.org/openSUSE:Packaging_UsrEtc)
- Always own %_modprobedir (bsc#1196275, jsc#SLE-20639)

OBS-URL: https://build.opensuse.org/request/show/960050
OBS-URL: https://build.opensuse.org/package/show/security:netfilter/firewalld?expand=0&rev=121
This commit is contained in:
Callum Farmer 2022-03-09 09:11:22 +00:00 committed by Git OBS Bridge
parent b31285ff7d
commit ceb14b7b7e
2 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Mon Mar 7 16:45:58 UTC 2022 - Martin Wilck <mwilck@suse.com>
- Add code for safe modprobe.d migration
(https://en.opensuse.org/openSUSE:Packaging_UsrEtc)
-------------------------------------------------------------------
Fri Mar 4 20:30:02 UTC 2022 - Martin Wilck <mwilck@suse.com>
- Always own %_modprobedir (bsc#1196275, jsc#SLE-20639)
-------------------------------------------------------------------
Thu Mar 3 14:26:57 UTC 2022 - Thorsten Kukuk <kukuk@suse.com>

View File

@ -24,6 +24,8 @@
# systemd-rpm-macros(or kmod) is wrong in 15.2 and 15.3
%define _modprobedir /lib/modprobe.d
%endif
%global modprobe_d_files firewalld-sysctls.conf
Name: firewalld
Version: 1.1.0
Release: 0
@ -197,6 +199,11 @@ mv %{buildroot}%{_sysconfdir}/xdg/autostart/* %{buildroot}%{_distconfdir}/xdg/au
%pre
%service_add_pre firewalld.service
# Avoid restoring outdated stuff in posttrans
for _f in %{?modprobe_d_files}; do
[ ! -f "/etc/modprobe.d/${_f}.rpmsave" ] || \
mv -f "/etc/modprobe.d/${_f}.rpmsave" "/etc/modprobe.d/${_f}.rpmsave.old" || :
done
%post
%service_add_post firewalld.service
@ -212,6 +219,13 @@ mv %{buildroot}%{_sysconfdir}/xdg/autostart/* %{buildroot}%{_distconfdir}/xdg/au
# Let the user restart it whenever he feels like it.
%service_del_postun_without_restart firewalld.service
%posttrans
# Migration of modprobe.conf files to _modprobedir
for _f in %{?modprobe_d_files}; do
[ ! -f "/etc/modprobe.d/${_f}.rpmsave" ] || \
mv -fv "/etc/modprobe.d/${_f}.rpmsave" "/etc/modprobe.d/${_f}" || :
done
%post -n firewall-applet
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
@ -263,9 +277,7 @@ fi
%{_datadir}/polkit-1
%dir %{_datadir}/dbus-1
%dir %{_datadir}/dbus-1/system.d
%if 0%{?suse_version} < 1550 && 0%{?sle_version} < 150300
%dir %{_modprobedir}
%endif
%{_modprobedir}/firewalld-sysctls.conf
%config(noreplace) %{_sysconfdir}/firewalld/firewalld.conf
%config(noreplace) %{_sysconfdir}/firewalld/lockdown-whitelist.xml