fs: Clone(): open the destination with O_TRUNC

This commit is contained in:
Ivan Shapovalov 2024-12-05 17:41:36 +04:00
parent eb2a4d29f8
commit 2b6cb44da5

View file

@ -143,7 +143,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
}