crypt: fix for unencrypted directory names on case insensitive remotes

rclone sync erroneously deleted folders renamed to a different case on
crypts where directory name encryption was disabled and the underlying
remote was case insensitive.

Example: Renaming the folder Test to tEST before a sync to a crypt having
remote=OneDrive:crypt and directory_name_encryption=false could result in
the folder and all its content being deleted. The following sync would
correctly create the tEST folder and upload all of the content.

Additional tests have revealed other potential issues when using
filename_encryption=off or directory_name_encryption=false on case
insensitive remotes. The documentation has been updated to warn about
potential problems when using these combinations.
This commit is contained in:
Ole Frost 2023-01-11 13:42:43 +01:00 committed by Nick Craig-Wood
parent 1cafc12e8c
commit 02d6d28ec4
2 changed files with 3 additions and 1 deletions

View File

@ -235,7 +235,7 @@ func NewFs(ctx context.Context, name, rpath string, m configmap.Mapper) (fs.Fs,
// the features here are ones we could support, and they are
// ANDed with the ones from wrappedFs
f.features = (&fs.Features{
CaseInsensitive: cipher.NameEncryptionMode() == NameEncryptionOff,
CaseInsensitive: !cipher.dirNameEncrypt || cipher.NameEncryptionMode() == NameEncryptionOff,
DuplicateFiles: true,
ReadMimeType: false, // MimeTypes not supported with crypt
WriteMimeType: false,

View File

@ -455,6 +455,7 @@ Properties:
- "off"
- Don't encrypt the file names.
- Adds a ".bin" extension only.
- May cause problems on [case insensitive](/overview/#case-insensitive) [storage systems](/overview/#features) like OneDrive, Dropbox, Windows, OSX and SMB.
#### --crypt-directory-name-encryption
@ -473,6 +474,7 @@ Properties:
- Encrypt directory names.
- "false"
- Don't encrypt directory names, leave them intact.
- May cause problems on [case insensitive](/overview/#case-insensitive) [storage systems](/overview/#features) like OneDrive, Dropbox, Windows, OSX and SMB.
#### --crypt-password