You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[gopls-release-branch.0.10] gopls/internal/hooks: fixes to diff disaster logic
Previously, the disaster logic in the new diff implementation
would "encrypt" the before/after files using a monoalphabetic
substitution, which has been insecure since the 9th century.
Instead, save plain text, in file with mode 0600, and invite
the user to audit the file before sharing it with us.
Also, separate the two files using a NUL byte, not a newline,
which is highly ambiguous.
Also, in the JSON diff stats writer:
- print a warning if we can't create the log file.
(The previous code was subtle--it stored a nil *os.File in
an io.Writer, which caused Writes to fail with an error,
in effect, silently.)
- Don't hold the mutex around the write operation.
- Fix minor off-by-one error (re: 15)
- Crash if JSON encoding fails; it "can't happen".
Change-Id: I9b6a4145451afd77594f0ef9868143634a9c4561
Reviewed-on: https://go-review.googlesource.com/c/tools/+/445580
Run-TryBot: Alan Donovan <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
gopls-CI: kokoro <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
(cherry picked from commit 2af106e)
Reviewed-on: https://go-review.googlesource.com/c/tools/+/445816
Auto-Submit: Alan Donovan <[email protected]>
0 commit comments