From 14dfc4e3e1925fcc3d303100c44ef4c321427c6b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 6 Jun 2019 15:44:29 +0200 Subject: global: cleanup TODO comment spacing --- updater/downloader.go | 8 ++++---- updater/msirunner_windows.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'updater') diff --git a/updater/downloader.go b/updater/downloader.go index f9b70834..a12b5037 100644 --- a/updater/downloader.go +++ b/updater/downloader.go @@ -106,7 +106,7 @@ func DownloadVerifyAndExecute(userToken uintptr) (progress chan DownloadProgress file.Seek(0, io.SeekStart) file.Truncate(0) file.Close() - os.Remove(name) //TODO: Do we have any sort of TOCTOU here? + os.Remove(name) // TODO: Do we have any sort of TOCTOU here? } }() @@ -145,7 +145,7 @@ func DownloadVerifyAndExecute(userToken uintptr) (progress chan DownloadProgress return } - //TODO: it would be nice to rename in place from "file.msi.unverified" to "file.msi", but Windows TOCTOU stuff + // TODO: it would be nice to rename in place from "file.msi.unverified" to "file.msi", but Windows TOCTOU stuff // is hard, so we'll come back to this later. name := file.Name() file.Close() @@ -153,14 +153,14 @@ func DownloadVerifyAndExecute(userToken uintptr) (progress chan DownloadProgress progress <- DownloadProgress{Activity: "Verifying authenticode signature"} if !version.VerifyAuthenticode(name) { - os.Remove(name) //TODO: Do we have any sort of TOCTOU here? + os.Remove(name) // TODO: Do we have any sort of TOCTOU here? progress <- DownloadProgress{Error: errors.New("The downloaded update does not have an authentic authenticode signature")} return } progress <- DownloadProgress{Activity: "Installing update"} err = runMsi(name, userToken) - os.Remove(name) //TODO: Do we have any sort of TOCTOU here? + os.Remove(name) // TODO: Do we have any sort of TOCTOU here? if err != nil { progress <- DownloadProgress{Error: err} return diff --git a/updater/msirunner_windows.go b/updater/msirunner_windows.go index 84ddde28..62ec1cdf 100644 --- a/updater/msirunner_windows.go +++ b/updater/msirunner_windows.go @@ -69,11 +69,11 @@ func msiTempFile() (*os.File, error) { Length: uint32(len(sd)), SecurityDescriptor: uintptr(unsafe.Pointer(&sd[0])), } - //TODO: os.TempDir() returns C:\windows\temp when calling from this context. Supposedly this is mostly secure + // 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 := 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. + // 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) runtime.KeepAlive(sd) if err != nil { -- cgit v1.2.3-59-g8ed1b