summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/leap/bitmask/config/providerconfig.py2
-rw-r--r--src/leap/bitmask/gui/login.py3
-rw-r--r--src/leap/bitmask/gui/mainwindow.py6
-rw-r--r--src/leap/bitmask/platform_init/initializers.py44
-rw-r--r--src/leap/bitmask/services/eip/eipconfig.py2
-rw-r--r--src/leap/bitmask/services/eip/linuxvpnlauncher.py7
-rw-r--r--src/leap/bitmask/util/keyring_helpers.py10
7 files changed, 22 insertions, 52 deletions
diff --git a/src/leap/bitmask/config/providerconfig.py b/src/leap/bitmask/config/providerconfig.py
index 7b979e61..57bc3a98 100644
--- a/src/leap/bitmask/config/providerconfig.py
+++ b/src/leap/bitmask/config/providerconfig.py
@@ -22,6 +22,7 @@ import logging
import os
from leap.bitmask import provider
+from leap.bitmask.config import flags
from leap.bitmask.config.provider_spec import leap_provider_spec
from leap.bitmask.services import get_service_display_name
from leap.bitmask.util import get_path_prefix
@@ -43,6 +44,7 @@ class ProviderConfig(BaseConfig):
Provider configuration abstraction class
"""
def __init__(self):
+ self.standalone = flags.STANDALONE
BaseConfig.__init__(self)
def get_light_config(self, domain, lang=None):
diff --git a/src/leap/bitmask/gui/login.py b/src/leap/bitmask/gui/login.py
index f66e71d9..baf29c23 100644
--- a/src/leap/bitmask/gui/login.py
+++ b/src/leap/bitmask/gui/login.py
@@ -216,7 +216,8 @@ class LoginWidget(QtGui.QWidget):
"""
self.ui.lnUser.setEnabled(enabled)
self.ui.lnPassword.setEnabled(enabled)
- self.ui.chkRemember.setEnabled(enabled)
+ if has_keyring():
+ self.ui.chkRemember.setEnabled(enabled)
self.ui.cmbProviders.setEnabled(enabled)
self._set_cancel(not enabled)
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 8a5b8275..a7e35d15 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -960,6 +960,12 @@ class MainWindow(QtGui.QMainWindow):
if not visible:
QtGui.QApplication.setQuitOnLastWindowClosed(True)
self.show()
+ if IS_LINUX:
+ # On ubuntu, activateWindow doesn't work reliably, so
+ # we do the following as a workaround. See
+ # https://bugreports.qt-project.org/browse/QTBUG-24932
+ # for more details
+ QtGui.QX11Info.setAppUserTime(0)
self.activateWindow()
self.raise_()
else:
diff --git a/src/leap/bitmask/platform_init/initializers.py b/src/leap/bitmask/platform_init/initializers.py
index 384e1ec1..2d800703 100644
--- a/src/leap/bitmask/platform_init/initializers.py
+++ b/src/leap/bitmask/platform_init/initializers.py
@@ -373,30 +373,6 @@ def DarwinInitializer():
# Linux initializers
#
-def _get_missing_resolvconf_dialog():
- """
- Create a dialog for notifying about missing openresolv.
-
- :rtype: QtGui.QMessageBox instance
- """
- msgstr = QtCore.QObject()
- msgstr.NO_RESOLVCONF = msgstr.tr(
- "Could not find <b>resolvconf</b> installed in your system.\n"
- "Do you want to quit Bitmask now?")
-
- msgstr.EXPLAIN = msgstr.tr(
- "Encrypted Internet needs resolvconf installed to work properly.\n"
- "Please use your package manager to install it.\n")
-
- msg = QtGui.QMessageBox()
- msg.setWindowTitle(msg.tr("Missing resolvconf framework"))
- msg.setText(msgstr.NO_RESOLVCONF)
- # but maybe the user really deserve to know more
- msg.setInformativeText(msgstr.EXPLAIN)
- msg.setStandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
- msg.setDefaultButton(QtGui.QMessageBox.Yes)
- return msg
-
def _get_missing_complain_dialog(stuff):
"""
@@ -445,21 +421,6 @@ def _get_missing_complain_dialog(stuff):
return msg
-def _linux_check_resolvconf():
- """
- Raise a dialog warning about the lack of the resolvconf framework.
- """
- RESOLVCONF_PATH = "/sbin/resolvconf"
- missing = not os.path.isfile(RESOLVCONF_PATH)
-
- if missing:
- msg = _get_missing_resolvconf_dialog()
- ret = msg.exec_()
-
- if ret == QtGui.QMessageBox.Yes:
- sys.exit()
-
-
def _linux_install_missing_scripts(badexec, notfound):
"""
Try to install the missing helper files.
@@ -509,9 +470,8 @@ def LinuxInitializer():
"""
Raise a dialog if needed files are missing.
- Missing files can be either system-wide resolvconf, bitmask-root, or
- policykit file. The dialog will also be raised if some of those files are
+ Missing files can be either bitmask-root policykit file.
+ The dialog will also be raised if some of those files are
found to have incorrect permissions.
"""
- _linux_check_resolvconf()
check_missing()
diff --git a/src/leap/bitmask/services/eip/eipconfig.py b/src/leap/bitmask/services/eip/eipconfig.py
index e7419b22..37c0c8ae 100644
--- a/src/leap/bitmask/services/eip/eipconfig.py
+++ b/src/leap/bitmask/services/eip/eipconfig.py
@@ -24,6 +24,7 @@ import time
import ipaddr
+from leap.bitmask.config import flags
from leap.bitmask.config.providerconfig import ProviderConfig
from leap.bitmask.services import ServiceConfig
from leap.bitmask.services.eip.eipspec import get_schema
@@ -220,6 +221,7 @@ class EIPConfig(ServiceConfig):
OPENVPN_CIPHERS_REGEX = re.compile("[A-Z0-9\-]+")
def __init__(self):
+ self.standalone = flags.STANDALONE
ServiceConfig.__init__(self)
self._api_version = None
diff --git a/src/leap/bitmask/services/eip/linuxvpnlauncher.py b/src/leap/bitmask/services/eip/linuxvpnlauncher.py
index 8ec0c050..b6e47f25 100644
--- a/src/leap/bitmask/services/eip/linuxvpnlauncher.py
+++ b/src/leap/bitmask/services/eip/linuxvpnlauncher.py
@@ -74,6 +74,7 @@ def _is_auth_agent_running():
'ps aux | grep "polkit-[m]ate-authentication-agent-1"',
'ps aux | grep "[l]xpolkit"',
'ps aux | grep "[g]nome-shell"',
+ 'ps aux | grep "[f]ingerprint-polkit-agent"',
]
is_running = [commands.getoutput(cmd) for cmd in polkit_options]
@@ -126,12 +127,6 @@ class LinuxVPNLauncher(VPNLauncher):
# LinuxPolicyChecker will give us the right path if standalone.
return LinuxPolicyChecker.get_polkit_path()
- class RESOLVCONF_BIN_PATH(object):
- def __call__(self):
- return ("/usr/local/sbin/leap-resolvconf" if flags.STANDALONE else
- "/sbin/resolvconf")
- # this only will work with debian/ubuntu distros.
-
OTHER_FILES = (POLKIT_PATH, BITMASK_ROOT, OPENVPN_BIN_PATH)
@classmethod
diff --git a/src/leap/bitmask/util/keyring_helpers.py b/src/leap/bitmask/util/keyring_helpers.py
index ee2d7a1c..0512d988 100644
--- a/src/leap/bitmask/util/keyring_helpers.py
+++ b/src/leap/bitmask/util/keyring_helpers.py
@@ -34,6 +34,10 @@ except Exception:
# dbus socket, or stuff like that.
keyring = None
+# XXX remember password disabled right now!
+# see: https://leap.se/code/issues/4190
+keyring = None
+
logger = logging.getLogger(__name__)
@@ -46,7 +50,7 @@ def _get_keyring_with_fallback():
This is a workaround for the cases in which the keyring module chooses
an insecure keyring by default (ie, inside a virtualenv).
"""
- if not keyring:
+ if keyring is None:
return None
kr = keyring.get_keyring()
if not canuse(kr):
@@ -67,7 +71,7 @@ def has_keyring():
:rtype: bool
"""
- if not keyring:
+ if keyring is None:
return False
kr = _get_keyring_with_fallback()
return canuse(kr)
@@ -79,7 +83,7 @@ def get_keyring():
:rtype: keyringBackend or None
"""
- if not keyring:
+ if keyring is None:
return False
kr = _get_keyring_with_fallback()
return kr if canuse(kr) else None