Bug 1473917

Summary: Terminator may crash on 32bit systems due to invalid dbus-interface name
Product: [Fedora] Fedora Reporter: Andreas Bleischwitz <ableisch>
Component: terminatorAssignee: Dominic Hopf <dmaphy>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 27CC: dmaphy, mattrose
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-30 21:30:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix to avoid output of hash() to be negative value none

Description Andreas Bleischwitz 2017-07-22 11:49:02 UTC
Created attachment 1302724 [details]
Fix to avoid output of hash() to be negative value

Description of problem:
When starting terminator under a 32bit system it may crash due to an invalid dbus-interface name which is combined from a base and a hex-hash of the display. If the hash has a negative value, the hyphen is included in the name which is invalid. The hash value has to be a positive value at any time, which hash() does not ensure.

Version-Release number of selected component (if applicable):
terminator-1.91-2.fc26.noarch

How reproducible:
Install 'terminator' on a 32bit system, open a terminal and invoke 'terminator'. Depending on the hash() of your display-session you may be able to start terminator or it fails with a complaint about an invalid DBus interface name.

Steps to Reproduce:
1. on Fedora-26.i686, install terminator-1.91-2.fc26.noarch
2. wayland-session, start 'termininator' from console
3. 'terminator' may or may not crash - in relation to the value of Gdk.get_display().partition('.')[0]

Actual results:
Terminator does crash on start

Expected results:
Terminator does not crash

Additional info:

Comment 1 Andreas Bleischwitz 2017-07-22 12:00:35 UTC
Output from terminator when hash() returns negative value:

Traceback (most recent call last):
  File "/usr/bin/terminator", line 83, in <module>
    from terminatorlib import ipc
  File "/usr/lib/python2.7/site-packages/terminatorlib/ipc.py", line 30, in <module>
    class DBusService(Borg, dbus.service.Object):
  File "/usr/lib/python2.7/site-packages/terminatorlib/ipc.py", line 61, in DBusService
    @dbus.service.method(BUS_NAME, in_signature='a{ss}')
  File "/usr/lib/python2.7/site-packages/dbus/decorators.py", line 155, in method
    validate_interface_name(dbus_interface)
ValueError: Invalid interface or error name 'net.tenshu.Terminator2-0x21012a2c': contains invalid character '-'

Checking line 61:
/usr/lib/python2.7/site-packages/terminatorlib/ipc.py:
     61     @dbus.service.method(BUS_NAME, in_signature='a{ss}')
     62     def new_window_cmdline(self, options=dbus.Dictionary()):

Fixed value of in_signature and variable BUS_NAME.

Checking line 30:
/usr/lib/python2.7/site-packages/terminatorlib/ipc.py:
     30 class DBusService(Borg, dbus.service.Object):
     31     """DBus Server class. This is implemented as a Borg"""

This is the instanciation of the DBus service.

Checking the origin of BUS_NAME:

     22 BUS_BASE = 'net.tenshu.Terminator2'
     23 BUS_PATH = '/net/tenshu/Terminator2'
     24 try:
     25     # Try and include the X11 display name in the dbus bus name
     26     DISPLAY  = hex(c_size_t(hash(Gdk.get_display().partition('.')[0])).value)
     27     BUS_NAME = '%s%s' % (BUS_BASE, DISPLAY)
     28 except:
     29     BUS_NAME = BUS_BASE

BUS_NAME is build from BUS_BASE (fixed) and DISPLAY - hex() of hash().
As DISPLAY is negative, and hex() does not introduce such negation, hash() is creating negative values.

Comment 2 Fedora End Of Life 2018-05-03 08:39:48 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 3 Andreas Bleischwitz 2018-05-07 13:34:56 UTC
Same issue on Fedora 27 as well.

Comment 4 Ben Cotton 2018-11-27 15:47:54 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Ben Cotton 2018-11-30 21:30:13 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.