lib/osutil: Preserve perms in AtomicWriter (fixes #tbd) (#6885)

This commit is contained in:
Simon Frei
2020-08-10 18:48:37 +02:00
committed by GitHub
parent f2f1a28206
commit fd8bea6179
2 changed files with 18 additions and 1 deletions
+6
View File
@@ -110,4 +110,10 @@ func testCreateAtomicReplace(t *testing.T, oldPerms os.FileMode) {
if !bytes.Equal(bs, []byte("hello")) {
t.Error("incorrect data")
}
if info, err := os.Stat(testfile); err != nil {
t.Fatal(err)
} else if info.Mode() != oldPerms {
t.Fatalf("Perms changed during atomic write: 0%o", info.Mode())
}
}