diff options
author | Sam Hartman <hartmans@debian.org> | 2019-05-06 22:10:51 -0400 |
---|---|---|
committer | Sam Hartman <hartmans@debian.org> | 2019-05-06 22:10:51 -0400 |
commit | 3afceceac2d1042645e470189c13edb4f965e7a9 (patch) | |
tree | ae5e297fd3df1ef49ddfb94acd5c2c2be7973958 | |
parent | ba8de16b7342ad381f56ac5725597b2dc428e95a (diff) |
Replace with security warning
On startup print to GUI and stdio a security warning and then exit.
-rwxr-xr-x | electrum/electrum | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/electrum/electrum b/electrum/electrum index dd35c35..8c5ef37 100755 --- a/electrum/electrum +++ b/electrum/electrum @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 # -*- mode: python -*- # # Electrum - lightweight Bitcoin client @@ -30,13 +30,42 @@ script_dir = os.path.dirname(os.path.realpath(__file__)) is_bundle = getattr(sys, 'frozen', False) is_local = not is_bundle and os.path.exists(os.path.join(script_dir, "electrum.desktop")) is_android = 'ANDROID_DATA' in os.environ - +try: + import PyQt5 +except Exception: + sys.exit("Error: Could not import PyQt5 on Linux systems, you may try 'sudo apt-get install python3-pyqt5'") + +from PyQt5.QtGui import * +from PyQt5.QtWidgets import * +from PyQt5.QtCore import * +import PyQt5.QtCore as QtCore # move this back to gui/kivy/__init.py once plugins are moved os.environ['KIVY_DATA_DIR'] = os.path.abspath(os.path.dirname(__file__)) + '/electrum/gui/kivy/data/' if is_local or is_android: sys.path.insert(0, os.path.join(script_dir, 'packages')) +security_message = ''' \ +This version of Electrum is vulnerable to malicious code inserted by +attackers and is being actively exploited to try and convince users to +give their private credentials to attackers. See +https://bugs.debian.org/921688 for details. Until the version in +Debian is updated, please see https://electrum.org/download.html +''' +sys.stderr.write(security_message) + + +from electrum.gui.qt.util import MessageBoxMixin +class Window(QMainWindow, MessageBoxMixin): + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.show_warning(msg = security_message, title = "THIS APPLICATION is INSECURE") + + +app = QApplication(["electrum", "gui"]) +window = Window() +sys.exit(2) def check_imports(): # pure-python dependencies need to be imported here for pyinstaller |