aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/manager/install.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-21 13:13:32 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-22 15:26:54 +0200
commitffa28be5eff6a109c8a6ae1ee6bd948ad794aee9 (patch)
tree25fa246ec63edfc6380239aae3a925905e984982 /manager/install.go
parentREADME: avoid confusion about downloads (diff)
downloadwireguard-windows-ffa28be5eff6a109c8a6ae1ee6bd948ad794aee9.tar.xz
wireguard-windows-ffa28be5eff6a109c8a6ae1ee6bd948ad794aee9.zip
firewall: use service-specific SID
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--manager/install.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/manager/install.go b/manager/install.go
index 4a570297..2eddbbbe 100644
--- a/manager/install.go
+++ b/manager/install.go
@@ -9,6 +9,7 @@ import (
"errors"
"os"
"time"
+ "unsafe"
"golang.org/x/sys/windows"
"golang.org/x/sys/windows/svc"
@@ -165,6 +166,14 @@ func InstallTunnel(configPath string) error {
if err != nil {
return err
}
+ sidType := uint32(windows.SERVICE_SID_TYPE_UNRESTRICTED)
+ err = windows.ChangeServiceConfig2(service.Handle, windows.SERVICE_CONFIG_SERVICE_SID_INFO, (*byte)(unsafe.Pointer(&sidType)))
+ if err != nil {
+ service.Delete()
+ service.Close()
+ return err
+ }
+
err = service.Start()
go trackTunnelService(name, service) // Pass off reference to handle.
return err