-
Notifications
You must be signed in to change notification settings - Fork 300
Feature: Allow shadowing cipherdir with mountpoint #718
It would be nice if gocryptfs allowed shadowing the cipherdir with its decrypted mountpoint, like ecryptfs.
I am not knowledgeable enough as to whether FUSE supports it or whether it's possible to do without superuser rights/a kernel module, so I'm just throwing the idea here.
Current behavior:
> gocryptfs /tmp/tmp.2CrICJxW7V/test /tmp/tmp.2CrICJxW7V/test
Mountpoint "/tmp/tmp.2CrICJxW7V/test" would shadow cipherdir "/tmp/tmp.2CrICJxW7V/test", this is not supported
All reactions
Replies: 2 comments 7 replies
Hi, this is theoretically possible, but isn't it just super confusing?
All reactions
I guess I just got used to the way ecryptfs allows it and it became convenient for me to not have to keep track of two separate directories.
All reactions
On the contrary, it makes a lot of sense (from an end-user perspective) to point gocryptfs at a directory in order decrypt it, or unlock it, without having to look in another place to view the decrypted content.
I wrote a wrapper script that just takes CIPHERDIR as an argument, renames it to .CIPHERDIR (hidden folder) and then mounts it on CIPHERDIR after recreating the folder. And does the reverse when CIPHERDIR is already a fuse.gocryptfs mountpoint. The resulting experience feels very natural.
Just like some apps or operating systems offer a "locked folder" for your most sensitive files, that you gain access to only after authenticating upon opening it; the "unlocking the vault" experience.
All reactions
-
👍 1
Doesn't this create the risk of a user saving unencrypted files into CIPHERDIR?
All reactions
For forward mode, since the CIPHERDIR is now the new mountpoint saving unencrypted files will encrypt the files to the .CIPHERDIR. After unmounting revert the changes we made initially that is remove the mountpoint (CIPHERDIR) and rename the .CIPHERDIR to CIPHERDIR
All reactions
I’m facing the same requirement of enabling a shadow mount for a cipher directory. I tried temporarily bypassing the shadow mount check mentioned above, but that resulted in numerous panics.
I’d like to better understand the complexity involved in properly supporting this feature.
All reactions
You'd just need to chdir into CIPHERDIR before mounting and then use relative paths everywhere
All reactions
Thanks for the reply, if I understand correctly do you mean something
- First cd CIPHERDIR
- Then run gocryptfs . ../CIPHERDIR
Please let me know if this a right approach or would this require changes in the codebase?
All reactions
This needs code changes (a lot of code changes)