Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1367038 - firewall-cmd crashes if /run/dbus/system_bus_socket does not exist
Summary: firewall-cmd crashes if /run/dbus/system_bus_socket does not exist
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: firewalld
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Thomas Woerner
QA Contact: Tomas Dolezal
URL:
Whiteboard:
Depends On: 1358380
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-15 11:14 UTC by Thomas Woerner
Modified: 2016-11-03 21:04 UTC (History)
4 users (show)

Fixed In Version: firewalld-0.4.3.2-5.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1358380
Environment:
Last Closed: 2016-11-03 21:04:12 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2597 normal SHIPPED_LIVE Moderate: firewalld security, bug fix, and enhancement update 2016-11-03 12:11:47 UTC

Description Thomas Woerner 2016-08-15 11:14:28 UTC
+++ This bug was initially created as a clone of Bug #1358380 +++

Description of problem:

If /run/dbus/system_bus_socket does not exist (e.g. chrooting environment), firewall-cmd crashes as follows.
=====================
[root@localhost ~]# firewall-cmd --reload
Not using slip
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/firewall/client.py", line 2200, in __init__
    self.bus = slip.dbus.SystemBus()
  File "<string>", line 2, in SystemBus
  File "/usr/lib64/python3.5/site-packages/dbus/_dbus.py", line 194, in __new__
    private=private)
  File "/usr/lib64/python3.5/site-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib64/python3.5/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/firewall-cmd", line 913, in <module>
    fw = FirewallClient()
  File "<decorator-gen-615>", line 2, in __init__
  File "/usr/lib/python3.5/site-packages/firewall/client.py", line 53, in handle_exceptions
    return func(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/firewall/client.py", line 2204, in __init__
    self.bus = dbus.SystemBus()
  File "/usr/lib64/python3.5/site-packages/dbus/_dbus.py", line 194, in __new__
    private=private)
  File "/usr/lib64/python3.5/site-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib64/python3.5/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
=====================

This affects, e.g. when we run the following command:
# dnf --releasever=24 --installroot=/tmp/newsysimage install systemd-journal-remote

Version-Release number of selected component (if applicable):

firewalld-0.4.3.2-1.fc24.noarch
firewalld-0.4.3.2-1.fc25.noarch

How reproducible:

always

Steps to Reproduce:
1. dnf --releasever=24 --installroot=/tmp/newsysimage install systemd-journal-remote

Actual results:

crash with the above report.

Expected results:

firewall-cmd safely fails, that is, just output error message and exit.

Additional info:

firewall-cmd --reload is used in %firewalld_reload rpm macro.
So, when we install software which use the macro in their post scripts to chrooting environment, the above crash always occurs.
Fortunately, the crash does not cause any actual problem as we do not need to reload in such cases.

--- Additional comment from Thomas Woerner on 2016-08-15 06:52:24 EDT ---

Fixed upstream:

https://github.com/t-woerner/firewalld/commit/d9579e983f5a196e7ed155035c0e8283c4f9f904
https://github.com/t-woerner/firewalld/commit/937eb926a1ec6f09a3ff825296927e9964232204

Related to this is also the following upstream fix:

https://github.com/t-woerner/firewalld/commit/63f4f46180d5fe26a68ef6517d2f612fb74a3254

Comment 5 errata-xmlrpc 2016-11-03 21:04:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2597.html


Note You need to log in before you can comment on or make changes to this bug.