Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"File name is too long". After setting "filenameLengthLimit": 100, Files with filename length between 55 and 130(the number is not exactly) cannot be copied. #1617

Closed
BoysFight opened this issue Apr 15, 2021 · 4 comments · Fixed by #1454
Assignees
Labels
misc:filesystem state:confirmed We are able to reproduce the reported behavior type:bug Something isn't working
Milestone

Comments

@BoysFight
Copy link

Description

After setting "filenameLengthLimit": 100, Files with filename length between 55 and 130(the number is not exactly) cannot be copied.
For example:
"Z38UFzlDexCLRYtb-olp9xl7oNxsd7YDGiaC4Hufte_N6Uh4-A.c9r" can be copied
"Z38UFzlDexCLRYtb-olp9xl7oNxsd7YDGiaC4Hufte_N6Uh4-AZ38UFzlDexCLRYtb-olp9xl7oNxsd7YDGiaC4Hufte_N6Uh4-AZ38UFzlDexCLRYtb-olp9xl7oNxsd7YDGiaC4Hufte_N6Uh4-A.c94" can be copied

"Z38UFzlDexCLRYtb-olp9xl7oNxsd7YDGiaC4Hufte_N6Uh4-AZ38UFzlDexCLRYtb-olp9xl7o.c9r" Can not be copied.

System Setup

  • Operating system and version: [Windows10]
  • Cryptomator version: [1.5.14]
  • Volume type: Dokany
  • {
    "id": "eP-cT97v1dT9",
    "path": "D:\\Documents\\tmptest",
    "displayName": "tmptest",
    "unlockAfterStartup": true,
    "revealAfterMount": true,
    "useCustomMountPath": false,
    "usesReadOnlyMode": false,
    "mountFlags": "",
    "filenameLengthLimit": 100,
    "actionAfterUnlock": "IGNORE"
    
    }

Steps to Reproduce

  1. Modify "filenameLengthLimit": 100 in %appdata%/Cryptomator/settings.json
  2. Copy a file of a specified length to the cryptomator.

Expected Behavior

All the files can be copied, and the length of generated file path is less than filenameLengthLimit.

Actual Behavior

ile of a specified length can not be copied.

Reproducibility

[Always]

Additional Information

[Any additional information, log files, screenshots, configuration, or data that might be necessary to reproduce the issue.]

@BoysFight BoysFight added the type:bug Something isn't working label Apr 15, 2021
@BoysFight
Copy link
Author

BoysFight commented Apr 16, 2021

It seems that when we getCiphertextFilePath() we are comparing with MAX_CIPHERTEXT_NAME_LENGTH, rather than the filenameLengthLimit setting by the user.
https://github.com/cryptomator/cryptofs/blob/70a809ca07aa5e7236ef9ec53595457c6c35d7af/src/main/java/org/cryptomator/cryptofs/CryptoPathMapper.java#L130

@infeo infeo added misc:filesystem state:to-be-confirmed We are trying to confirm the reported behavior labels Apr 16, 2021
@infeo infeo added state:confirmed We are able to reproduce the reported behavior and removed state:to-be-confirmed We are trying to confirm the reported behavior labels Apr 16, 2021
@overheadhunter
Copy link
Member

Your analysis is correct, however this isn't as easily fixable: Since max name limit is currently a setting stored on each machine individually, two machines may have different limits. This is usually not a problem, unless shortening of very long file names kicks in (currently hard coded at 220 char limit). This shortening threshold must remain the same within a vault, regardless of which machine accesses the vault. Otherwise, Cryptomator would be unable to deterministically derive a ciphertext name from a given cleartext name.

To fix this issue, we're currently working on vault format 8, which allows storing some information (such as the max name length) within the vault itself instead of with the application settings.

@BoysFight
Copy link
Author

@overheadhunter Thank you very much for your kindly reply. Is there any release plan for the new version with vault format 8 ?

@overheadhunter
Copy link
Member

First pre-release version hopefully within the next few weeks. But please manage your expectations:

While "very long names" used to work fine, they will now get rejected as well when hitting the length limit. I.e. more files get rejected with a "file name too long" error. That said, the behaviour will be more consistent:

  1. By decoupling the length limit from shortening, we removed this weird "gap" where only medium-length names cause errors and very long names work again.
  2. The length limit refers to cleartext names now. Which makes it easier for users to understand what files are affected.

This also allows further improvements (related to #1224):

  1. The per-device length limit can be re-evaluated (e.g. if the underlying file system changes)
  2. The shortening threshold can be reduced, allowing unlimited file name length on all devices

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
misc:filesystem state:confirmed We are able to reproduce the reported behavior type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants