Skip to content

gocryptfs: fuse -> fuse3 - #526670

Closed
prusnak wants to merge 1 commit into
NixOS:masterfrom
prusnak:gocryptfs-fuse3
Closed

prusnak wants to merge 1 commit into
NixOS:masterfrom
prusnak:gocryptfs-fuse3

Conversation

@prusnak

@prusnak prusnak commented Jun 1, 2026 •

Copy link
Copy Markdown
Member

Part of #526161

Things done

@nixpkgs-ci
nixpkgs-ci Bot requested a review from flokli June 1, 2026 09:20
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". labels Jun 1, 2026
@flokli

flokli commented Jun 1, 2026

Copy link
Copy Markdown
Member

I'm still not convinced this actually doesn't break fstab usage, the code seems to poke at the fusermount binary (not fusermount3).

If everything is already handled in the library code as suggested in your comment on #526161:

seems that gocryptfs prefers fusermount3 to fusermount since 2021 (via go-fuse dependency)

... we wouldn't need to do anything with $PATH at all?

Can you add a VM test? Creating a gocryptfs, then switching to a specialization that has that mountpoint in /etc/fstab?

@prusnak

prusnak commented Jun 1, 2026 •

Copy link
Copy Markdown
Member Author

Here is the go-fuse change in 2021 which checks fusermount3 binary first, then fusermount hanwen/go-fuse@934a183

Not sure if the wrapper is still needed and I unfortunately have no time to test now (i don't use gocryptfs atm)

@flokli

flokli commented Jun 1, 2026

Copy link
Copy Markdown
Member

Here is the go-fuse change in 2021 which checks fusermount3 binary first, then fusermount hanwen/go-fuse@934a183

Here's code in gocryptfs asking fusermount -V for its version string: https://github.com/rfjakob/gocryptfs/blob/1a03e993cf898bd66125d88dcd682dc056a398d6/mount.go#L528-L545

Not sure if the wrapper is still needed and I unfortunately have no time to test now (i don't use gocryptfs atm)

Yeah, let's leave this open for the time being. Maybe someone will beat you or me towards testing it out.

@prusnak

prusnak commented Jun 1, 2026 •

Copy link
Copy Markdown
Member Author

Here's code in gocryptfs asking fusermount -V for its version string: https://github.com/rfjakob/gocryptfs/blob/1a03e993cf898bd66125d88dcd682dc056a398d6/mount.go#L528-L545

Yes, but that is only to determine whether fusermount is v2 or v3 and it is only called from here where the nonempty param is added (not supported in v3):

https://github.com/rfjakob/gocryptfs/blob/1a03e993cf898bd66125d88dcd682dc056a398d6/mount.go#L425-L429

I guess some distros package fusermount3 as fusermount and this check handles it in order not to pass nonempty param to fusermount3 disguised as fusermount.

@aktaboot

aktaboot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

I have tested both with and without the wrapper and both seem to work flawlessly
did not test the fstab usecase

@flokli

flokli commented Jun 1, 2026

Copy link
Copy Markdown
Member

I have tested both with and without the wrapper and both seem to work flawlessly did not test the fstab usecase

The fstab testcase is what needs to be tested.

@aktaboot

aktaboot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

I just successfully tested the fstab usecase locally aswell!

@flokli

flokli commented Jun 1, 2026

Copy link
Copy Markdown
Member

I just successfully tested the fstab usecase locally aswell!

And it works with and without the wrapper?

@aktaboot

aktaboot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

testing without the wrapper, bash seems to fail to find gocryptfs, I wouldn't know why

@aktaboot

aktaboot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

okay the unwrapped works with fsType = "fuse./run/current-system/sw/bin/gocryptfs", but not with "fuse.gocryptfs"

@flokli

flokli commented Jun 1, 2026

Copy link
Copy Markdown
Member

okay the unwrapped works with fsType = "fuse./run/current-system/sw/bin/gocryptfs", but not with "fuse.gocryptfs"

Yeah. I figured;-) Maybe we can patch that path in. But this definitely needs a proper VM test to ensure it won't regress.

@aktaboot

aktaboot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

added a VM test here: #526791 :) 👀

@flokli

flokli commented Jun 3, 2026

Copy link
Copy Markdown
Member

I have an updated version of this which doesn't break fstab mounts, will push later today

@flokli flokli mentioned this pull request Jun 3, 2026
3 of 14 tasks
@flokli

flokli commented Jun 3, 2026

Copy link
Copy Markdown
Member

Superseded by #527732.

@flokli flokli closed this Jun 3, 2026
@prusnak
prusnak deleted the gocryptfs-fuse3 branch June 3, 2026 21:14
pull Bot pushed a commit to oati/nixpkgs that referenced this pull request Jun 5, 2026
Part of NixOS#526161.

The previous approach prefixed $PATH to make a fusermount available, but
this would be gone if we'd just replace it to fuse3, as NixOS#526670
attempted (which would break mounting via fstab).

Instead, patch the source to try our suid wrapper (which is always
preferred so mounting as non-root still works), and then fallback to a
fusermount from $PATH (to work on non-NixOS distros)

Ideally this would also try fusermount3, but whether to do that is
probably something for upstream to decide, and other distros probably
also provide a symlink for compatibility reasons.

Closes NixOS#526670.
RemuSalminen pushed a commit to RemuSalminen/nixpkgs that referenced this pull request Jun 7, 2026
Part of NixOS#526161.

The previous approach prefixed $PATH to make a fusermount available, but
this would be gone if we'd just replace it to fuse3, as NixOS#526670
attempted (which would break mounting via fstab).

Instead, patch the source to try our suid wrapper (which is always
preferred so mounting as non-root still works), and then fallback to a
fusermount from $PATH (to work on non-NixOS distros)

Ideally this would also try fusermount3, but whether to do that is
probably something for upstream to decide, and other distros probably
also provide a symlink for compatibility reasons.

Closes NixOS#526670.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants