diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-09-16 23:36:49 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-09-23 15:29:18 +0200 |
commit | 6f66c7697d3bb6a259bf8d0261490cdee0ef8986 (patch) | |
tree | 1f123998f801c375674326ba7946da568be32df0 /updater/msirunner_windows.go | |
parent | updater: use correct length for security attributes (diff) | |
download | wireguard-windows-6f66c7697d3bb6a259bf8d0261490cdee0ef8986.tar.xz wireguard-windows-6f66c7697d3bb6a259bf8d0261490cdee0ef8986.zip |
global: use SECURITY_DESCRIPTOR apis from x/sys/windows
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | updater/msirunner_windows.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/updater/msirunner_windows.go b/updater/msirunner_windows.go index 6b8ae476..c11d4db9 100644 --- a/updater/msirunner_windows.go +++ b/updater/msirunner_windows.go @@ -17,7 +17,6 @@ import ( "unsafe" "golang.org/x/sys/windows" - "golang.zx2c4.com/wireguard/ipc/winpipe" ) func runMsi(msiPath string, userToken uintptr) error { @@ -61,13 +60,13 @@ func msiTempFile() (*os.File, error) { if n != int(len(randBytes)) { return nil, errors.New("Unable to generate random bytes") } - sd, err := winpipe.SddlToSecurityDescriptor("O:SYD:PAI(A;;FA;;;SY)(A;;FR;;;BA)") + sd, err := windows.SecurityDescriptorFromString("O:SYD:PAI(A;;FA;;;SY)(A;;FR;;;BA)") if err != nil { return nil, err } sa := &windows.SecurityAttributes{ Length: uint32(unsafe.Sizeof(windows.SecurityAttributes{})), - SecurityDescriptor: uintptr(unsafe.Pointer(&sd[0])), + SecurityDescriptor: sd, } // TODO: os.TempDir() returns C:\windows\temp when calling from this context. Supposedly this is mostly secure // against TOCTOU, but who knows! Look into this! |