Install the windows service as "NT AUTHORITY\NetworkService"
Untested Maybe Fixes #686
This commit is contained in:
parent
b886585486
commit
17db0a658f
|
@ -35,6 +35,9 @@ 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)
|
||||
|
|
|
@ -12,6 +12,10 @@ 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" {
|
||||
|
|
|
@ -14,6 +14,10 @@ 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" {
|
||||
|
|
|
@ -2,4 +2,9 @@ package main
|
|||
|
||||
import "os"
|
||||
|
||||
func serviceStartupUserName() *string {
|
||||
userName := "NT AUTHORITY\\NetworkService"
|
||||
return &userName
|
||||
}
|
||||
|
||||
func (proxy *Proxy) dropPrivilege(userStr string, fds []*os.File) {}
|
||||
|
|
Loading…
Reference in New Issue