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

Unable to add vault: Emojis in path to masterkey file lead to error #1153

Closed
sschindel opened this issue Apr 26, 2020 · 9 comments · Fixed by #1809
Closed

Unable to add vault: Emojis in path to masterkey file lead to error #1153

sschindel opened this issue Apr 26, 2020 · 9 comments · Fixed by #1809
Labels
misc:filesystem os:linux os:mac state:confirmed We are able to reproduce the reported behavior type:upstream-bug Something isn't working in upstream
Milestone

Comments

@sschindel
Copy link

sschindel commented Apr 26, 2020

Description

I cannot open vaults where the name contains some unicode symbol. This does not happen with the Android App, but with the Desktop App - at least under Linux (more specifically Debian 10). This here is the crash when opening an already existing vault:

java.nio.file.NoSuchFileException: /home/sts/�: Not a vault directory
	at org.cryptomator.common.vaults.VaultListManager.add(VaultListManager.java:55)
	at org.cryptomator.ui.addvaultwizard.ChooseExistingVaultController.chooseFileAndNext(ChooseExistingVaultController.java:82)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
	at jdk.internal.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
	at com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
	at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1784)
	at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1670)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Node.fireEvent(Node.java:8885)
	at javafx.scene.control.Button.fire(Button.java:203)
	at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:206)
	at com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Scene$MouseHandler.process(Scene.java:3890)
	at javafx.scene.Scene.processMouseEvent(Scene.java:1885)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2618)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
	at com.sun.glass.ui.View.handleMouseEvent(View.java:556)
	at com.sun.glass.ui.View.notifyMouse(View.java:942)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Unknown Source)

System Setup

  • Operating system and version: Debian 10
  • Cryptomator version: 1.5.1
  • Drive: FUSE

Steps to Reproduce

  1. Create a vault with some name
  2. Rename the folder to some unicode symbol
  3. Load this vault in Cryptomator

Expected Behavior

Cryptomator should open the vault.

Actual Behavior

Cryptomator does not open the vault.

Reproducibility

Always

Additional Information

@infeo
Copy link
Member

infeo commented May 4, 2020

What are the error causing characters?

I cannot reproduce this on Debian 10 VM with Cryptomator 1.5.3 using the αβγδ as the vault name.

@infeo infeo added the state:awaiting-response We need further input from the issue author label May 4, 2020
@sschindel
Copy link
Author

Hmm, you are right, it seems to work with some characters (and with others not).

An example of a folder / vault name that does not work is "💩" (Unicode U+1F4A9).

@no-response no-response bot removed the state:awaiting-response We need further input from the issue author label May 7, 2020
@infeo
Copy link
Member

infeo commented May 8, 2020

Ah, ok. I didn't go that far in the unicode table.

Seems like the development of android and desktop diverged a little here: In the desktop applications it is not possible to create a vault with non-letter/-number characters.

Currently emojis (and sortof) cannot be displayed properly and are recognized as white spaces when you entering them in the vault name text box during creation on linux machines (well at least ubunut or debian). Therefore and for the time being, i would say these should not be allowed as vault names.

@overheadhunter, @SailReal What do you think? Depending on the choice this issue should be transferred to cryptomator/cryptomator-android.

@overheadhunter
Copy link
Member

I don't think this is necessarily about vault names, as multi-byte characters can also occur in the path leading to the vault. So even if forbidding such characters during vault creation, the issue would remain.

@infeo
Copy link
Member

infeo commented Jun 9, 2020

Today i experimented a little bit with this issue again. My test environment was a ubuntu-18.04.4 VM.
Our upstream libraries seem to work with unicode characters from the higher planes (like 💩 ).

I tried the fuse-nio-adapter where such a character was either in the mount path or the root path, and additionally tried it with cryptofs as the backened file system. Both worked without a problem.

Additionally i checked with the javafx-helloworld example, if and to what grade the used input fields support unicode characters. Even thou they are wrongly displayed, internally they are stored correctly.

Collecting it all together, it seems to work except that the desktop app of Cryptomator does not accept them. (at least for Ubuntu 18.04.4)

@infeo infeo modified the milestones: 1.5.7, 1.5.x Aug 11, 2020
@infeo infeo added the state:confirmed We are able to reproduce the reported behavior label Nov 5, 2020
@infeo
Copy link
Member

infeo commented Nov 5, 2020

Due to upcoming 1.59 release i tested this again with Debian 10.04. I can reproduce the issue with certain unicode characters, but not with all. For example, if the path contains a folder named 💩, it fails. With the unicode codepoint 😅 it works.

The reason for this is, that the created Java File object contains the wrong path due to an encoding error: /home/user/💩/vault results in a file object with the path /home/user/ð���.

@infeo infeo added type:upstream-bug Something isn't working in upstream and removed type:bug Something isn't working labels Nov 6, 2020
@infeo
Copy link
Member

infeo commented Nov 6, 2020

Addiotional observation: The more "troublecausing" code points are used, the shorter the actual, correct path in the file objet gets. (emojis result in 4 instead of 1 character, hence from the last path element masterkey.cryptomator 3 characters are removed). So we cannot even fix this if we want to, because when at least 8 such unicode characters are used in the path, the parent directory name will also be truncated.

@infeo
Copy link
Member

infeo commented Dec 18, 2020

Upstream bug in the JDK: https://bugs.openjdk.java.net/browse/JDK-8210199

@infeo infeo changed the title Unicode vault name (Linux) => Crash Unable to add vault: Emojis in path to masterkey file lead to error Dec 18, 2020
@infeo infeo added the os:mac label Dec 18, 2020
@infeo infeo removed this from the 1.5.x milestone Jun 8, 2021
@infeo
Copy link
Member

infeo commented Jun 8, 2021

Upstream bug is fixed, problem will be fixed with updating to JDK 17

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

Successfully merging a pull request may close this issue.

3 participants