gocryptfs icon indicating copy to clipboard operation
gocryptfs copied to clipboard

Feature Request: Propagate File Locks to the Backing Files

Open guedressel opened this issue 7 years ago • 17 comments

Does gocryptfs do file locking through the fuse layer?

So if a mounted & decrypted file gets a lock by a process using it, will the underlying encrypted source file also have a lock?

guedressel avatar Sep 27 '16 07:09 guedressel

No, unfortunately file locking requests are currently thrown away by the go-fuse library. This is mentioned in the go-fuse README as a TODO, so there are good chances of getting it merged.

rfjakob avatar Sep 28 '16 21:09 rfjakob

Ok to close I guess?

rfjakob avatar Oct 05 '16 21:10 rfjakob

Well - actually it's postponed, not closed. To keep record on the go-fuse progress I created an issue there: hanwen/go-fuse#134

guedressel avatar Oct 06 '16 06:10 guedressel

hanwen/go-fuse#134 got closed!

guedressel avatar Apr 20 '17 06:04 guedressel

Nice!

rfjakob avatar Apr 29 '17 22:04 rfjakob

Unfortunately, the Flock implementation in go-fuse does not seem to be working yet: https://github.com/hanwen/go-fuse/pull/153#issuecomment-298732540

rfjakob avatar May 02 '17 19:05 rfjakob

Just curious: What is your use case for this? I'm afraid this is going to take a while to land in go-fuse.

rfjakob avatar May 05 '17 22:05 rfjakob

This isn't my ticket originally, but my own use case is locking files on a NFS store multiple systems are accessing via gocryptfs.

charles-dyfis-net avatar May 05 '17 22:05 charles-dyfis-net

My use case is to have the underlying encrypted backing files being synced across multiple computers with sync tools (syncany, dropbox, ...). If an unencrypted file is in use / has a lock it's underlying encrypted file might still be overwritten by such a tool if it can't see the lock.

guedressel avatar Oct 24 '17 12:10 guedressel

https://github.com/hanwen/go-fuse/pull/220 seems fixed flock, could you have a look at it? Thanks!

invis-z avatar Sep 02 '18 00:09 invis-z

Indeed, I'll take a look in september!

rfjakob avatar Sep 02 '18 12:09 rfjakob

Any news on these? If I understand correctly it prevents gocryptfs to be used with cloud sync tools.

kototama avatar Apr 04 '19 09:04 kototama

No news here, but this is not related to cloud sync tools.

Dropbox, nextcloud etc work fine

rfjakob avatar Apr 04 '19 11:04 rfjakob

(tbh, i doubt that dropbox etc even look at file locks)

rfjakob avatar Apr 04 '19 11:04 rfjakob

Oh ok, I misunderstood the issue in that case. Thanks for the quick answer.

kototama avatar Apr 04 '19 11:04 kototama

Out of topic but I don't know where to ask: so will gocryptfs avoid corruption when two cloud sync clients modify the same file on two computers at the same time?

kototama avatar Apr 04 '19 14:04 kototama

What usually happens is that the cloud sync client creates a file like

my file (copy 1).txt

rfjakob avatar Apr 04 '19 20:04 rfjakob