From 82cf3d8869fd6370406abb65c5f7b82e1bcee111 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Fri, 13 Mar 2015 21:35:17 -0400 Subject: [PATCH] Fix bugs with posttrans - Remove nonexistent fedora-cloud.conf symlink --- firewalld.spec | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/firewalld.spec b/firewalld.spec index 0366f7c..f4290be 100644 --- a/firewalld.spec +++ b/firewalld.spec @@ -8,7 +8,7 @@ Summary: A firewall daemon with D-Bus interface providing a dynamic firewall Name: firewalld Version: 0.3.13 -Release: 4%{?dist} +Release: 5%{?dist} URL: http://www.firewalld.org License: GPLv2+ Source0: https://fedorahosted.org/released/firewalld/%{name}-%{version}.tar.bz2 @@ -193,20 +193,18 @@ rm -f %{buildroot}%{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.poli %systemd_postun_with_restart firewalld.service %posttrans -# Only on initial installation, not upgrades -if [ $1 -eq 0 ] +# If we don't yet have a symlink or existing file for firewalld.conf, +# create it. Note: this will intentionally reset the policykit policy +# at the same time, so they are in sync. +if [ \! -e %{_sysconfdir}/firewalld/firewalld.conf ]; then # Select the default config file based on /etc/os-release variant=$(awk -F "=" '/VARIANT/ {print $2}' /etc/os-release) || : - rm -f %{_sysconfdir}/firewalld/firewalld.conf - rm -f %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy + # Make sure that we remove any dangling links + rm -f %{_sysconfdir}/firewalld/firewalld.conf || : + rm -f %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || : case $variant in - "Cloud") - ln -sf firewalld-cloud.conf %{_sysconfdir}/firewalld/firewalld.conf || : - # The Cloud edition will share the Server policy for now - ln -sf org.fedoraproject.FirewallD1.server.policy %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || : - ;; "Server") ln -sf firewalld-server.conf %{_sysconfdir}/firewalld/firewalld.conf || : ln -sf org.fedoraproject.FirewallD1.server.policy %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || : @@ -220,10 +218,9 @@ if [ $1 -eq 0 ] # The standard firewall policy will be the same as Server ln -sf org.fedoraproject.FirewallD1.server.policy %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || : ;; - esac + esac fi - %post -n firewall-applet /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : @@ -350,6 +347,10 @@ fi %{_mandir}/man1/firewall-config*.1* %changelog +* Fri Mar 13 2015 Stephen Gallagher 0.3.13-5 +- Fix bugs with posttrans +- Remove nonexistent fedora-cloud.conf symlink + * Fri Mar 13 2015 Stephen Gallagher 0.3.13-4 - Remove per-edition config files - Decide on default configuration based on /etc/os-release