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

Does not work with macFUSE 4.x #524

Closed
pos42 opened this issue Nov 17, 2020 · 14 comments
Closed

Does not work with macFUSE 4.x #524

pos42 opened this issue Nov 17, 2020 · 14 comments
Labels
macOS Apple macOS ("darwin") specific issue

Comments

@pos42
Copy link

pos42 commented Nov 17, 2020

Hi

Had rsync problems with gocryptfs 1.8.0 and macfuse 3.11.2 after upgrading to Mac OS Big Sur. read errors when running....
/usr/bin/rsync -avH -e "ssh" --delete --delete-excluded --exclude=._.DS_Store --exclude=.DS_Store /Users/sjoholmp/Volumes/gocryptfs-unencrypted sjoholmp@FQDN_HOST:/data/BACKUPS/

All worked before MacOS Big Sur though. Don't know why I upgraded so fast. Stupid me!

So I tried to update to macFUSE 4.0.2. My pcloud client that uses fuse happily uses 4.0.2, but not gocrypftfs...

peo-mac:bin sjoholmp$ gocryptfs -passfile /Users/sjoholmp/etc/gocryptfs_mount_password /Users/sjoholmp/Library/Mobile\ Documents/comappleCloudDocs/gocryptfs-encrypted /Users/sjoholmp/Volumes/gocryptfs-unencrypted
passfile: reading from file "/Users/sjoholmp/etc/gocryptfs_mount_password"
Decrypting master key
fuse.NewServer failed: fork/exec /Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs: no such file or directory
Maybe you should run: /Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse
peo-mac:bin sjoholmp$

Module seems to have been renamed....
peo-mac:bin sjoholmp$ ls -la /Library/Filesystems/
total 0
drwxr-xr-x 4 root wheel 128 Nov 17 10:26 .
drwxr-xr-x 71 root wheel 2272 Nov 16 21:19 ..
drwxr-xr-x 2 root wheel 64 Jan 1 2020 NetFSPlugins
drwxr-xr-x 3 root wheel 96 Nov 8 18:12 macfuse.fs
peo-mac:bin sjoholmp$

I can manually load by running "/Library/Filesystems/macfuse.fs/Contents/Resources/load_macfuse", but that still does not work when mounting gocryptfs.

But I probably miss something obvious :)

@rfjakob
Copy link
Owner

rfjakob commented Nov 20, 2020

Looks like go-fuse wants to open /dev/osxfuse. Can you check what

ls -l /dev/*fuse*

says on your system?

@llucps
Copy link

llucps commented Nov 28, 2020

Hi,

On my system:

crw-rw-rw- 1 root operator 37, 0 Nov 28 08:55 /dev/osxfuse0
crw-rw-rw- 1 root operator 37, 1 Nov 28 08:50 /dev/osxfuse1
crw-rw-rw- 1 root operator 37, 10 Nov 28 08:50 /dev/osxfuse10
crw-rw-rw- 1 root operator 37, 11 Nov 28 08:50 /dev/osxfuse11
crw-rw-rw- 1 root operator 37, 12 Nov 28 08:50 /dev/osxfuse12
crw-rw-rw- 1 root operator 37, 13 Nov 28 08:50 /dev/osxfuse13
crw-rw-rw- 1 root operator 37, 14 Nov 28 08:50 /dev/osxfuse14
crw-rw-rw- 1 root operator 37, 15 Nov 28 08:50 /dev/osxfuse15
crw-rw-rw- 1 root operator 37, 16 Nov 28 08:50 /dev/osxfuse16
crw-rw-rw- 1 root operator 37, 17 Nov 28 08:50 /dev/osxfuse17
crw-rw-rw- 1 root operator 37, 18 Nov 28 08:50 /dev/osxfuse18
crw-rw-rw- 1 root operator 37, 19 Nov 28 08:50 /dev/osxfuse19
crw-rw-rw- 1 root operator 37, 2 Nov 28 08:50 /dev/osxfuse2
crw-rw-rw- 1 root operator 37, 20 Nov 28 08:50 /dev/osxfuse20
crw-rw-rw- 1 root operator 37, 21 Nov 28 08:50 /dev/osxfuse21
crw-rw-rw- 1 root operator 37, 22 Nov 28 08:50 /dev/osxfuse22
crw-rw-rw- 1 root operator 37, 23 Nov 28 08:50 /dev/osxfuse23
crw-rw-rw- 1 root operator 37, 24 Nov 28 08:50 /dev/osxfuse24
crw-rw-rw- 1 root operator 37, 25 Nov 28 08:50 /dev/osxfuse25
crw-rw-rw- 1 root operator 37, 26 Nov 28 08:50 /dev/osxfuse26
crw-rw-rw- 1 root operator 37, 27 Nov 28 08:50 /dev/osxfuse27
crw-rw-rw- 1 root operator 37, 28 Nov 28 08:50 /dev/osxfuse28
crw-rw-rw- 1 root operator 37, 29 Nov 28 08:50 /dev/osxfuse29
crw-rw-rw- 1 root operator 37, 3 Nov 28 08:50 /dev/osxfuse3
crw-rw-rw- 1 root operator 37, 30 Nov 28 08:50 /dev/osxfuse30
crw-rw-rw- 1 root operator 37, 31 Nov 28 08:50 /dev/osxfuse31
crw-rw-rw- 1 root operator 37, 32 Nov 28 08:50 /dev/osxfuse32
crw-rw-rw- 1 root operator 37, 33 Nov 28 08:50 /dev/osxfuse33
crw-rw-rw- 1 root operator 37, 34 Nov 28 08:50 /dev/osxfuse34
crw-rw-rw- 1 root operator 37, 35 Nov 28 08:50 /dev/osxfuse35
crw-rw-rw- 1 root operator 37, 36 Nov 28 08:50 /dev/osxfuse36
crw-rw-rw- 1 root operator 37, 37 Nov 28 08:50 /dev/osxfuse37
crw-rw-rw- 1 root operator 37, 38 Nov 28 08:50 /dev/osxfuse38
crw-rw-rw- 1 root operator 37, 39 Nov 28 08:50 /dev/osxfuse39
crw-rw-rw- 1 root operator 37, 4 Nov 28 08:50 /dev/osxfuse4
crw-rw-rw- 1 root operator 37, 40 Nov 28 08:50 /dev/osxfuse40
crw-rw-rw- 1 root operator 37, 41 Nov 28 08:50 /dev/osxfuse41
crw-rw-rw- 1 root operator 37, 42 Nov 28 08:50 /dev/osxfuse42
crw-rw-rw- 1 root operator 37, 43 Nov 28 08:50 /dev/osxfuse43
crw-rw-rw- 1 root operator 37, 44 Nov 28 08:50 /dev/osxfuse44
crw-rw-rw- 1 root operator 37, 45 Nov 28 08:50 /dev/osxfuse45
crw-rw-rw- 1 root operator 37, 46 Nov 28 08:50 /dev/osxfuse46
crw-rw-rw- 1 root operator 37, 47 Nov 28 08:50 /dev/osxfuse47
crw-rw-rw- 1 root operator 37, 48 Nov 28 08:50 /dev/osxfuse48
crw-rw-rw- 1 root operator 37, 49 Nov 28 08:50 /dev/osxfuse49
crw-rw-rw- 1 root operator 37, 5 Nov 28 08:50 /dev/osxfuse5
crw-rw-rw- 1 root operator 37, 50 Nov 28 08:50 /dev/osxfuse50
crw-rw-rw- 1 root operator 37, 51 Nov 28 08:50 /dev/osxfuse51
crw-rw-rw- 1 root operator 37, 52 Nov 28 08:50 /dev/osxfuse52
crw-rw-rw- 1 root operator 37, 53 Nov 28 08:50 /dev/osxfuse53
crw-rw-rw- 1 root operator 37, 54 Nov 28 08:50 /dev/osxfuse54
crw-rw-rw- 1 root operator 37, 55 Nov 28 08:50 /dev/osxfuse55
crw-rw-rw- 1 root operator 37, 56 Nov 28 08:50 /dev/osxfuse56
crw-rw-rw- 1 root operator 37, 57 Nov 28 08:50 /dev/osxfuse57
crw-rw-rw- 1 root operator 37, 58 Nov 28 08:50 /dev/osxfuse58
crw-rw-rw- 1 root operator 37, 59 Nov 28 08:50 /dev/osxfuse59
crw-rw-rw- 1 root operator 37, 6 Nov 28 08:50 /dev/osxfuse6
crw-rw-rw- 1 root operator 37, 60 Nov 28 08:50 /dev/osxfuse60
crw-rw-rw- 1 root operator 37, 61 Nov 28 08:50 /dev/osxfuse61
crw-rw-rw- 1 root operator 37, 62 Nov 28 08:50 /dev/osxfuse62
crw-rw-rw- 1 root operator 37, 63 Nov 28 08:50 /dev/osxfuse63
crw-rw-rw- 1 root operator 37, 7 Nov 28 08:50 /dev/osxfuse7
crw-rw-rw- 1 root operator 37, 8 Nov 28 08:50 /dev/osxfuse8
crw-rw-rw- 1 root operator 37, 9 Nov 28 08:50 /dev/osxfuse9

@rfjakob
Copy link
Owner

rfjakob commented Nov 28, 2020

That should be plenty ;)

But: hanwen/go-fuse#379

Looks like go-fuse (the FUSE library that gocryptfs uses) does not support macfuse 4.0.0 at the moment ( hanwen/go-fuse#379 ).

Does osxfuse 3.x still work on the latest macos?

@llucps
Copy link

llucps commented Nov 28, 2020

Yes 3.x still works on Big Sur.. I've been using it since Big Sur was released with no problem.

I did try to upgrade to macFUSE 4.0 and that's when it's broken.

Let's hope go-fuse gets support for macfuse 4!

Thanks!

@rfjakob rfjakob changed the title macFUSE 4.0.2 Does not work with macFUSE 4.x Nov 28, 2020
@rfjakob rfjakob added the macOS Apple macOS ("darwin") specific issue label Nov 28, 2020
@rfjakob
Copy link
Owner

rfjakob commented Nov 28, 2020

I will leave this ticket open to warn users of macfuse 4.x, progress will be tracked at hanwen/go-fuse#379

@mike-kfed
Copy link

Given that macOS has deprecated kernel extensions (see here), and macfuse 4 is closed software lacking documentation it might be worth investing time how to use macOS 11 File Providers this seems to be their userspace fuse-style like offering that could be used for gocryptfs (the "your server" part being the local encrypted file storage).

@llucps
Copy link

llucps commented Dec 22, 2020

@rfjakob it's seems the macFuse 4 support for go-fuse is on the way 👍 that's good news thank you to everyone!

My only concern now is Homebrew has flagged Gocryptfs as deprecated, so effectively the formula will be removed and it will be no longer possible to install it via Homebrew.

Just wondering if you have any plans to provide binaries for macOS in the future, if not, is it complicated to compile?

Thanks!

@mschirrmeister
Copy link

@llucps Creating an official or personal Homebrew tap will be an alternative. I did that for cryfs, which is now deprecated as well.
I created a tap where I can install the new macFUSE and cryfs via Homebrew. If there is no binary, then the brew install command should compile it. But depending on what it is, it might take a long time.

If the code is ready, then compiling is not really complicated. With cryfs for example, the code needed a little bit patching, because of some renaming in osxfuse/macfuse.

@krim404
Copy link

krim404 commented Jan 4, 2021

@rfjakob macfuse 4 is now supported in go-fuse (hanwen/go-fuse@09a3c38).

Compiled it on my M1 mac - sadly i'm unable to run the test-suite (dependency errors with x64 binaries), but manual testing (init and mount) worked.
gocryptfs [unknown]; go-fuse v2.0.4-0.20210104155004-09a3c381714c; 2021-01-04 go1.16beta1 darwin/arm64

@ijoseph
Copy link

ijoseph commented Jan 31, 2021

Also getting some complaints with the test after compiling go-fuse: master (hanwen/go-fuse@8e0bbdb) on my Big Sur/ Apple Silicon / MacFuse 4.0.5 env:

❯ ./all.bash
go: downloading github.com/hanwen/go-fuse v1.0.0
go test: -i flag is deprecated
go: downloading golang.org/x/sys v0.0.0-20180830151530-49385e6e1522
go test: -i flag is deprecated
go test github.com/hanwen/go-fuse/fuse
fork/exec /var/folders/2v/gh8jsshx2fz2cr8mny4qfm480000gn/T/go-build1637109818/b001/fuse.test: exec format error
FAIL    github.com/hanwen/go-fuse/fuse  0.001s
FAIL 

but my manual test worked:

go run examples/hello/main.go hello /tmp/Test 

How would I go about linking this to gocryptfs?

@ijoseph
Copy link

ijoseph commented Jan 31, 2021

Figured out how to link gocryptfs to a local HEAD of go-fuse which has the patch.

For posterity, after (1) cloning gocryptfs, (2) cloning go-fuse to the directory shown below, and (3) building go-fuse (see my above post), I made this change in gocryptfs:

diff --git a/go.mod b/go.mod
index 05a019b..aac2677 100644
--- a/go.mod
+++ b/go.mod
@@ -17,3 +17,5 @@ require (
 	golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect
 	golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3
 )
+
+replace github.com/hanwen/go-fuse/v2 v2.0.4-0.20201104153454-be8e5f4a85fd => "/Users/ijoseph/Code/Clones/go-fuse/"
\ No newline at end of file
 

I'm not sure whether I had to fool build.bash by doing

mkdir vendor/github.com/hanwen/go-fuse

but I did anyway.

Then, looks good!

file ./gocryptfs
gocryptfs: Mach-O 64-bit executable arm64 

@ijoseph
Copy link

ijoseph commented Jan 31, 2021

So next steps is an author of go-fuse (@hanwen to decide whom?) making a new tag in go-fuse after that patch, then updating go.mod here in this repo with that new tag (so we don't have to do this hacky local linking).

@rfjakob
Copy link
Owner

rfjakob commented Jan 31, 2021

go.mod can reference git commits without tags, so I updated to latest go-fuse master. Thanks for testing!

@ijoseph
Copy link

ijoseph commented Jan 31, 2021

Ah, pseudo-versions — TIL. Neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS Apple macOS ("darwin") specific issue
Projects
None yet
Development

No branches or pull requests

7 participants