aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/updater/msirunner_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-25 02:23:34 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-25 02:23:34 +0200
commitb33299a29713f2d87fba572010f87f1361480cba (patch)
tree432899e15da424b1a2c28041190db3144c94480c /updater/msirunner_windows.go
parentbuild: opt in to walk cgo (diff)
downloadwireguard-windows-b33299a29713f2d87fba572010f87f1361480cba.tar.xz
wireguard-windows-b33299a29713f2d87fba572010f87f1361480cba.zip
global: use filepath.Join uniformly
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'updater/msirunner_windows.go')
-rw-r--r--updater/msirunner_windows.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/updater/msirunner_windows.go b/updater/msirunner_windows.go
index 38acc0ac..84ddde28 100644
--- a/updater/msirunner_windows.go
+++ b/updater/msirunner_windows.go
@@ -11,7 +11,7 @@ import (
"errors"
"os"
"os/exec"
- "path"
+ "path/filepath"
"runtime"
"syscall"
"unsafe"
@@ -35,10 +35,10 @@ func runMsi(msiPath string, userToken uintptr) error {
Token: syscall.Token(userToken),
},
Files: []*os.File{devNull, devNull, devNull},
- Dir: path.Dir(msiPath),
+ Dir: filepath.Dir(msiPath),
}
- msiexec := path.Join(system32, "msiexec.exe")
- proc, err := os.StartProcess(msiexec, []string{msiexec, "/qb!-", "/i", path.Base(msiPath)}, attr)
+ msiexec := filepath.Join(system32, "msiexec.exe")
+ proc, err := os.StartProcess(msiexec, []string{msiexec, "/qb!-", "/i", filepath.Base(msiPath)}, attr)
if err != nil {
return err
}
@@ -71,7 +71,7 @@ func msiTempFile() (*os.File, error) {
}
//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!
- name := path.Join(os.TempDir(), hex.EncodeToString(randBytes[:]))
+ name := filepath.Join(os.TempDir(), hex.EncodeToString(randBytes[:]))
name16 := windows.StringToUTF16Ptr(name)
//TODO: it would be nice to specify delete_on_close, but msiexec.exe doesn't open its files with read sharing.
fileHandle, err := windows.CreateFile(name16, windows.GENERIC_WRITE, windows.FILE_SHARE_READ, sa, windows.CREATE_NEW, windows.FILE_ATTRIBUTE_NORMAL, 0)