summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-05-21 08:52:05 -0300
committerTomás Touceda <chiiph@leap.se>2014-05-21 08:52:05 -0300
commit8448a42c81da482063233da48dc66a5ddcf7d13d (patch)
treefbf91cfed9a472c9910e991b010d3209ad62c963 /src/leap
parent548b413939362e23f7dd84b80519c7eb6c052e76 (diff)
parenta68960c1dcb7670687cb08610c9132cdf9b5a595 (diff)
Merge remote-tracking branch 'refs/remotes/kali/feature/psutil-compat' into develop
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/bitmask/services/eip/vpnprocess.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/leap/bitmask/services/eip/vpnprocess.py b/src/leap/bitmask/services/eip/vpnprocess.py
index 1559ea8b..734b88df 100644
--- a/src/leap/bitmask/services/eip/vpnprocess.py
+++ b/src/leap/bitmask/services/eip/vpnprocess.py
@@ -30,9 +30,11 @@ import psutil
try:
# psutil < 2.0.0
from psutil.error import AccessDenied as psutil_AccessDenied
+ PSUTIL_2 = False
except ImportError:
# psutil >= 2.0.0
from psutil import AccessDenied as psutil_AccessDenied
+ PSUTIL_2 = True
from leap.bitmask.config import flags
from leap.bitmask.config.providerconfig import ProviderConfig
@@ -676,7 +678,13 @@ class VPNManager(object):
# we need to be able to filter out arguments in the form
# --openvpn-foo, since otherwise we are shooting ourselves
# in the feet.
- if any(map(lambda s: s.find("LEAPOPENVPN") != -1, p.cmdline)):
+
+ if PSUTIL_2:
+ cmdline = p.cmdline()
+ else:
+ cmdline = p.cmdline
+ if any(map(lambda s: s.find(
+ "LEAPOPENVPN") != -1, cmdline)):
openvpn_process = p
break
except psutil_AccessDenied: