rclone/backend/crypt
Nick Craig-Wood b91c349cd5 local: fix hash invalidation which caused errors with local crypt mount
Before this fix if a file was updated, but to the same length and
timestamp then the local backend would return the wrong (cached)
hashes for the object.

This happens regularly on a crypted local disk mount when the VFS
thinks files have been changed but actually their contents are
identical to that written previously. This is because when files are
uploaded their nonce changes so the contents of the file changes but
the timestamp and size remain the same because the file didn't
actually change.

This causes errors like this:

    ERROR: file: Failed to copy: corrupted on transfer: md5 crypted
    hash differ "X" vs "Y"

This turned out to be because the local backend wasn't clearing its
cache of hashes when the file was updated.

This fix clears the hash cache for Update and Remove.

It also puts a src and destination in the crypt message to make future
debugging easier.

Fixes #4031
2021-11-24 12:09:34 +00:00
..
pkcs7 Remove github.com/pkg/errors and replace with std library version 2021-11-07 11:53:30 +00:00
cipher.go crypt: add base64 and base32768 filename encoding options #5801 2021-11-15 17:57:02 +00:00
cipher_test.go crypt: add test cases and documentation for base64 and base32768 filename encoding #5801 2021-11-15 17:57:02 +00:00
crypt.go local: fix hash invalidation which caused errors with local crypt mount 2021-11-24 12:09:34 +00:00
crypt_internal_test.go fs: Add context to NewFs #3257 #4685 2020-11-09 18:05:54 +00:00
crypt_test.go crypt: add test cases and documentation for base64 and base32768 filename encoding #5801 2021-11-15 17:57:02 +00:00