X-Git-Url: http://tinc-vpn.org/git/browse?a=blobdiff_plain;f=gui%2Ftinc-gui;h=d610d9d8c99a3655edc31c168ed62872f30eaee1;hb=558b19c2432d938afc4a659668bd461ace6ed744;hp=64b738ebaee196076f3dea2a3633b7417fb176f1;hpb=ab583f7e8c550822c63a1a6b73a7a329f622d9e0;p=tinc diff --git a/gui/tinc-gui b/gui/tinc-gui index 64b738eb..d610d9d8 100755 --- a/gui/tinc-gui +++ b/gui/tinc-gui @@ -1,7 +1,8 @@ -#!/usr/bin/python +#!/usr/bin/env python # tinc-gui -- GUI for controlling a running tincd -# Copyright (C) 2009-2012 Guus Sliepen +# Copyright (C) 2009-2014 Guus Sliepen +# 2014 Dennis Joachimsthaler # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -130,7 +131,11 @@ class VPN: else: # otherwise connect via TCP print(unixfile + " does not exist."); - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + if ':' in info[2]: + af = socket.AF_INET6 + else: + af = socket.AF_INET + s = socket.socket(af, socket.SOCK_STREAM) s.connect((info[2], int(info[4]))) self.sf = s.makefile() @@ -234,9 +239,15 @@ class VPN: def __init__(self, netname = None, pidfile = None): if platform.system() == 'Windows': + sam = _winreg.KEY_READ + if platform.machine().endswith('64'): + sam = sam | _winreg.KEY_WOW64_64KEY try: reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE) - key = _winreg.OpenKey(reg, "SOFTWARE\\tinc") + try: + key = _winreg.OpenKey(reg, "SOFTWARE\\tinc", 0, sam) + except WindowsError: + key = _winreg.OpenKey(reg, "SOFTWARE\\Wow6432Node\\tinc", 0, sam) VPN.confdir = _winreg.QueryValue(key, None) except WindowsError: pass