-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: doesn't preserve file permissions when modifying the go.mod and go.sum files #34634
Comments
Change https://golang.org/cl/199697 mentions this issue: |
@bcmills You mentioned using lockedfile rather than renameio while talking about on this issue. I reviewed the package and completed the implementation and also commented the sidelock block, but in the following tests creates the go.mod file 0444 then "go test" command fails with permission denied under lockedfile.Write command. Is there any special reason to create the mod file with 0444, i think we can create files with umask'd 0666. May i request your comments about the case? /cmd/cover/cover_test.go
|
@serhatgiydiren, yeah, that test is just wrong. I believe it's fixed incidentally in CL 202439 (@zx2c4). |
Change https://golang.org/cl/202442 mentions this issue: |
Change https://golang.org/cl/205637 mentions this issue: |
Change https://golang.org/cl/206142 mentions this issue: |
…the go.mod file Updates #34634 Fixes #35425 Change-Id: I878a8d229b33dcde9e7d4dfd82ddf9815d38a465 Reviewed-on: https://go-review.googlesource.com/c/go/+/206142 Run-TryBot: Bryan C. Mills <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
The
go
tool should preserves file permissions when modifying thego.mod
andgo.sum
files.What did you see instead?
The
go
tools overrides file permissions when modifying thego.mod
andgo.sum
files.This issue is that the WriteGoMod and WriteGoSum functions use renameio.WriteFile instead of ioutil.WriteFile.
Contrary to ioutil.WriteFile, renameio.WriteFile doesn't preserve permissions.
The text was updated successfully, but these errors were encountered: