summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Hartman <hartmans@debian.org>2019-05-06 22:13:16 -0400
committerSam Hartman <hartmans@debian.org>2019-05-06 22:13:16 -0400
commit12a0150d841d4d69817535ddb0c5427b2276f888 (patch)
treeaad9177d560ff0fce3fe1558fcb631be23e874bd
parent1a8d7100d92a79d8dfd9f13aff7dad824a176d87 (diff)
Commit Debian 3.0 (quilt) metadata
[dgit (8.3) quilt-fixup]
-rw-r--r--debian/patches/replace-with-security-warning.patch60
-rw-r--r--debian/patches/series1
2 files changed, 61 insertions, 0 deletions
diff --git a/debian/patches/replace-with-security-warning.patch b/debian/patches/replace-with-security-warning.patch
new file mode 100644
index 0000000..e8f409e
--- /dev/null
+++ b/debian/patches/replace-with-security-warning.patch
@@ -0,0 +1,60 @@
+From: Sam Hartman <hartmans@debian.org>
+Date: Mon, 6 May 2019 22:10:51 -0400
+X-Dgit-Generated: 3.2.3-1.1 3afceceac2d1042645e470189c13edb4f965e7a9
+Subject: Replace with security warning
+
+On startup print to GUI and stdio a security warning and then exit.
+
+---
+
+--- electrum-3.2.3.orig/electrum/electrum
++++ electrum-3.2.3/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.rea
+ 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
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8ffe66a
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+replace-with-security-warning.patch