1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-09 00:00:02 +01:00

fs: Clone(): open the destination with O_TRUNC

This commit is contained in:
Ivan Shapovalov 2024-12-05 17:41:36 +04:00
parent e42ad4987a
commit ed13a20eef

View file

@ -145,7 +145,7 @@ func Clone(srcName, destName string) (cloned bool, err error) {
_ = src.Close()
}()
dest, err := OpenFile(destName, O_CREATE|O_WRONLY|O_NOFOLLOW, 0600)
dest, err := OpenFile(destName, O_CREATE|O_TRUNC|O_WRONLY|O_NOFOLLOW, 0600)
if err != nil {
return false, err
}