aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/service
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-04-02 07:33:37 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-04-02 07:33:37 +0200
commitd28cd0100b89ef182c5c7b39ec1b6b90062647b7 (patch)
treeb8f29db3d80017d3d4b0199f1b0cfc312d69dd81 /service
parentui: remove spacer that was only needed in a container other than ScrollView (diff)
downloadwireguard-windows-d28cd0100b89ef182c5c7b39ec1b6b90062647b7.tar.xz
wireguard-windows-d28cd0100b89ef182c5c7b39ec1b6b90062647b7.zip
ringlogger: give unprivd access via inheritable mapping handle
Diffstat (limited to 'service')
-rw-r--r--service/ipc_client.go5
-rw-r--r--service/ipc_server.go6
-rw-r--r--service/service_manager.go7
3 files changed, 6 insertions, 12 deletions
diff --git a/service/ipc_client.go b/service/ipc_client.go
index 7e260ea7..e6295b91 100644
--- a/service/ipc_client.go
+++ b/service/ipc_client.go
@@ -141,11 +141,6 @@ func IPCClientQuit(stopTunnelsOnQuit bool) (bool, error) {
return alreadyQuit, rpcClient.Call("ManagerService.Quit", stopTunnelsOnQuit, &alreadyQuit)
}
-func IPCClientLogFilePath() (string, error) {
- var path string
- return path, rpcClient.Call("ManagerService.LogFilePath", uintptr(0), &path)
-}
-
func IPCClientRegisterTunnelChange(cb func(tunnel *Tunnel, state TunnelState, err error)) *TunnelChangeCallback {
s := &TunnelChangeCallback{cb}
tunnelChangeCallbacks[s] = true
diff --git a/service/ipc_server.go b/service/ipc_server.go
index 079dc85c..17ea67c2 100644
--- a/service/ipc_server.go
+++ b/service/ipc_server.go
@@ -11,7 +11,6 @@ import (
"github.com/Microsoft/go-winio"
"golang.org/x/sys/windows/svc"
"golang.zx2c4.com/wireguard/windows/conf"
- "golang.zx2c4.com/wireguard/windows/ringlogger"
"io/ioutil"
"net/rpc"
"os"
@@ -207,11 +206,6 @@ func (s *ManagerService) Quit(stopTunnelsOnQuit bool, alreadyQuit *bool) error {
return nil
}
-func (s *ManagerService) LogFilePath(unused uintptr, filepath *string) error {
- *filepath = ringlogger.Global.Filename()
- return nil
-}
-
func IPCServerListen(reader *os.File, writer *os.File, events *os.File) error {
service := &ManagerService{events: events}
diff --git a/service/service_manager.go b/service/service_manager.go
index 9fffbfe3..3d7449bd 100644
--- a/service/service_manager.go
+++ b/service/service_manager.go
@@ -169,6 +169,11 @@ func (service *managerService) Execute(args []string, r <-chan svc.ChangeRequest
log.Printf("Unable to listen on IPC pipes: %v", err)
return
}
+ theirLogMapping, err := ringlogger.Global.ExportInheritableMappingHandleStr()
+ if err != nil {
+ log.Printf("Unable to export inheritable mapping handle for logging: %v", err)
+ return
+ }
log.Printf("Starting UI process for user: '%s@%s'", username, domain)
attr := &os.ProcAttr{
@@ -177,7 +182,7 @@ func (service *managerService) Execute(args []string, r <-chan svc.ChangeRequest
},
Files: []*os.File{devNull, devNull, devNull},
}
- proc, err := os.StartProcess(path, []string{path, "/ui", theirReaderStr, theirWriterStr, theirEventStr}, attr)
+ proc, err := os.StartProcess(path, []string{path, "/ui", theirReaderStr, theirWriterStr, theirEventStr, theirLogMapping}, attr)
theirReader.Close()
theirWriter.Close()
theirEvents.Close()