summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorTomas Touceda <chiiph@leap.se>2013-06-21 14:17:09 -0300
committerTomas Touceda <chiiph@leap.se>2013-06-21 14:19:01 -0300
commitb265380ebedb1603933251a6e8fd0e7c850eba5a (patch)
tree862b00f09937817ddb1a6bcbd321df8069220630 /src/leap
parent4cfe344fceb16d19936fa8d0d2f6bdaa7e747740 (diff)
Use an alternative method to check for file permission
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/platform_init/initializers.py2
-rw-r--r--src/leap/services/eip/vpnlaunchers.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/leap/platform_init/initializers.py b/src/leap/platform_init/initializers.py
index 3374e32e..5345f11a 100644
--- a/src/leap/platform_init/initializers.py
+++ b/src/leap/platform_init/initializers.py
@@ -195,7 +195,7 @@ def WindowsInitializer():
dev_installer = os.path.join(driver_path,
"devcon.exe")
if os.path.isfile(dev_installer) and \
- os.access(dev_installer, os.X_OK):
+ stat.S_IXUSR & os.stat(dev_installer)[stat.ST_MODE] != 0:
inf_path = os.path.join(driver_path,
"OemWin2k.inf")
cmd = [dev_installer, "install", inf_path, "tap0901"]
diff --git a/src/leap/services/eip/vpnlaunchers.py b/src/leap/services/eip/vpnlaunchers.py
index 762b536d..c5b21eac 100644
--- a/src/leap/services/eip/vpnlaunchers.py
+++ b/src/leap/services/eip/vpnlaunchers.py
@@ -24,6 +24,7 @@ import getpass
import os
import platform
import subprocess
+import stat
try:
import grp
except ImportError:
@@ -167,7 +168,7 @@ def _has_updown_scripts(path, warn=True):
"Might produce DNS leaks." % (path,))
# XXX check if applies in win
- is_exe = os.access(path, os.X_OK)
+ is_exe = (stat.S_IXUSR & os.stat(path)[stat.ST_MODE] != 0)
if warn and not is_exe:
logger.error("Up/down script %s is not executable. "
"Might produce DNS leaks." % (path,))