From 400c17b1f3440f134a69ad51ae65e0f36428a805 Mon Sep 17 00:00:00 2001 From: Thomas Woerner Date: Jun 18 2015 15:54:59 +0000 Subject: - Fixed 'pid_file' referenced before assignment (RHBZ#1233232) --- diff --git a/firewalld-0.3.14.2-pid_file_RHBZ#1233232.patch b/firewalld-0.3.14.2-pid_file_RHBZ#1233232.patch new file mode 100644 index 0000000..f785bc7 --- /dev/null +++ b/firewalld-0.3.14.2-pid_file_RHBZ#1233232.patch @@ -0,0 +1,58 @@ +commit 3a1f22c95bb5723456533de5aa821143682b8e3d +Author: Thomas Woerner +Date: Thu Jun 18 16:55:40 2015 +0200 + + firewalld: Fixed 'pid_file' referenced before assignment (RHBZ#1233232) + +diff --git a/src/firewalld b/src/firewalld +index 2db71a8..bd81316 100755 +--- a/src/firewalld ++++ b/src/firewalld +@@ -82,6 +82,7 @@ def setup_logging(args): + log.addDebugLogging("*", log.stdout) + + def startup(args): ++ pid_file = "/var/run/firewalld.pid" + try: + if not args.nofork: + # do the UNIX double-fork magic, see Stevens' "Advanced +@@ -119,7 +120,6 @@ def startup(args): + + if not args.nopid: + # write the pid file +- pid_file = "/var/run/firewalld.pid" + with open(pid_file, "w") as f: + f.write(str(os.getpid())) + +@@ -128,27 +128,27 @@ def startup(args): + server.run_server(args.debug_gc) + + # Clean up on exit +- if os.path.exists(pid_file) and not args.nopid: ++ if not args.nopid and os.path.exists(pid_file): + os.remove(pid_file) + + except OSError as e: + log.fatal(_("Fork #1 failed: %d (%s)") % (e.errno, e.strerror)) + log.error(traceback.format_exc()) +- if os.path.exists(pid_file) and not args.nopid: ++ if not args.nopid and os.path.exists(pid_file): + os.remove(pid_file) + sys.exit(1) + + except dbus.exceptions.DBusException as e: + log.fatal(str(e)) + log.error(traceback.format_exc()) +- if os.path.exists(pid_file) and not args.nopid: ++ if not args.nopid and os.path.exists(pid_file): + os.remove(pid_file) + sys.exit(1) + + except IOError as e: + log.fatal(str(e)) + log.error(traceback.format_exc()) +- if os.path.exists(pid_file) and not args.nopid: ++ if not args.nopid and os.path.exists(pid_file): + os.remove(pid_file) + sys.exit(1) + diff --git a/firewalld.spec b/firewalld.spec index 8ac5059..3c5e09a 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.14.2 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.firewalld.org License: GPLv2+ Source0: https://fedorahosted.org/released/firewalld/%{name}-%{version}.tar.bz2 @@ -19,6 +19,7 @@ Source2: FedoraWorkstation.xml %if 0%{?fedora} Patch0: firewalld-0.2.6-MDNS-default.patch %endif +Patch1: firewalld-0.3.14.2-pid_file_RHBZ#1233232.patch BuildArch: noarch BuildRequires: desktop-file-utils BuildRequires: gettext @@ -167,6 +168,7 @@ Workstation product specific firewalld configuration settings. %if 0%{?fedora} %patch0 -p1 %endif +%patch1 -p1 %if 0%{?with_python3} rm -rf %{py3dir} @@ -474,6 +476,9 @@ fi %endif %changelog +* Thu Jun 18 2015 Thomas Woerner - 0.3.14.2-2 +- Fixed 'pid_file' referenced before assignment (RHBZ#1233232) + * Wed Jun 17 2015 Thomas Woerner - 0.3.14.2-1 - reunification of the firewalld spec files for all Fedora releases - fix dependencies for -applet and -config: use_python3 is the proper switch