From c50ebc8d23916b7f5e35f399936cd4ff5f239c12 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Fri, 21 Oct 2016 17:01:43 -0400 Subject: [bug] avoid passing posix-only args to twistd on windows --- src/leap/bitmask/core/launcher.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/leap/bitmask/core') diff --git a/src/leap/bitmask/core/launcher.py b/src/leap/bitmask/core/launcher.py index cbe4064..62e8575 100644 --- a/src/leap/bitmask/core/launcher.py +++ b/src/leap/bitmask/core/launcher.py @@ -18,6 +18,7 @@ Run bitmask daemon. """ from os.path import join, abspath, dirname +import platform import sys from twisted.scripts.twistd import run @@ -29,10 +30,8 @@ from leap.common.config import get_path_prefix pid = abspath(join(get_path_prefix(), 'leap', 'bitmaskd.pid')) - STANDALONE = getattr(sys, 'frozen', False) - def here(module=None): if STANDALONE: # we are running in a |PyInstaller| bundle @@ -46,16 +45,19 @@ def here(module=None): def run_bitmaskd(): # TODO --- configure where to put the logs... (get --logfile, --logdir - # from the bitmask_cli + # from bitmaskctl for (index, arg) in enumerate(sys.argv): if arg == '--backend': flags.BACKEND = sys.argv[index + 1] - sys.argv[1:] = [ + args = [ '-y', join(here(core), "bitmaskd.tac"), - '--pidfile', pid, - '--umask', '0022', '--logfile', getLogPath(), ] + if platform.system() != 'Windows': + args.append([ + '--pidfile', pid, + '--umask', '0022']) + sys.argv[1:] = args print '[+] launching bitmaskd...' run() -- cgit v1.2.3