From 8076e206e03e132af3fae5765ff079fb60adf353 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 14 Mar 2019 20:09:23 +0100 Subject: [PATCH] Revert "Install the windows service as "NT AUTHORITY\NetworkService"" This reverts commit 17db0a658f724f82df5ea5246652317accb21664. On Windows, switching to user `NT AUTHORITY\NetworkService` apparently breaks logging (reported by @Aland_123). --- dnscrypt-proxy/main.go | 3 --- dnscrypt-proxy/privilege_linux.go | 4 ---- dnscrypt-proxy/privilege_others.go | 4 ---- dnscrypt-proxy/privilege_windows.go | 5 ----- 4 files changed, 16 deletions(-) diff --git a/dnscrypt-proxy/main.go b/dnscrypt-proxy/main.go index 533c40e2..c053665b 100644 --- a/dnscrypt-proxy/main.go +++ b/dnscrypt-proxy/main.go @@ -36,9 +36,6 @@ func main() { Description: "Encrypted/authenticated DNS proxy", WorkingDirectory: pwd, } - if serviceUserName := serviceStartupUserName(); serviceUserName != nil { - svcConfig.UserName = *serviceUserName - } svcFlag := flag.String("service", "", fmt.Sprintf("Control the system service: %q", service.ControlAction)) app := &App{} svc, err := service.New(app, svcConfig) diff --git a/dnscrypt-proxy/privilege_linux.go b/dnscrypt-proxy/privilege_linux.go index 006c6eff..76e168fd 100644 --- a/dnscrypt-proxy/privilege_linux.go +++ b/dnscrypt-proxy/privilege_linux.go @@ -12,10 +12,6 @@ import ( "github.com/jedisct1/dlog" ) -func serviceStartupUserName() *string { - return nil -} - func (proxy *Proxy) dropPrivilege(userStr string, fds []*os.File) { currentUser, err := user.Current() if err != nil && currentUser.Uid != "0" { diff --git a/dnscrypt-proxy/privilege_others.go b/dnscrypt-proxy/privilege_others.go index ad825d1f..b860e6ab 100644 --- a/dnscrypt-proxy/privilege_others.go +++ b/dnscrypt-proxy/privilege_others.go @@ -14,10 +14,6 @@ import ( "github.com/jedisct1/dlog" ) -func serviceStartupUserName() *string { - return nil -} - func (proxy *Proxy) dropPrivilege(userStr string, fds []*os.File) { currentUser, err := user.Current() if err != nil && currentUser.Uid != "0" { diff --git a/dnscrypt-proxy/privilege_windows.go b/dnscrypt-proxy/privilege_windows.go index c8e5cc93..61c08d1b 100644 --- a/dnscrypt-proxy/privilege_windows.go +++ b/dnscrypt-proxy/privilege_windows.go @@ -2,9 +2,4 @@ package main import "os" -func serviceStartupUserName() *string { - userName := "NT AUTHORITY\\NetworkService" - return &userName -} - func (proxy *Proxy) dropPrivilege(userStr string, fds []*os.File) {}