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

Starting with fuse 3.0 the nonempty option has been removed. #440

Closed
wants to merge 2 commits into from

Conversation

juddmon
Copy link

@juddmon juddmon commented Dec 9, 2019

I ran into this problem in Ubuntu 20.04 beta.

The code for libfuse >= 3.0 had the nonempty mount option removed from fusermount because the standard mount option does not have this option. This caused gocryptfs to fail when this option is used (fuse doesn't allow that option). Not using it will not work either if the mountpoint is not empty because the check "isEmptyDir" failed.

http://fuse.996288.n3.nabble.com/ANNOUNCE-libfuse-3-0-0-has-been-released-td14403.html

This caused gocryptfs to fail when this option is used and not using it will not work if the mountpoint is not empty either because the check failed.
http://fuse.996288.n3.nabble.com/ANNOUNCE-libfuse-3-0-0-has-been-released-td14403.html
rfjakob added a commit that referenced this pull request Dec 28, 2019
fusermount3 (i.e. fusermount from libfuse 3.x) has dropped
the `nonempty` option.

Detect fusermount3 and don't add `nonempty` in this case.

Fixes #440
@rfjakob
Copy link
Owner

rfjakob commented Dec 28, 2019

Hi! Thanks for the patch! The version parsing logic looks a little scary to me, I tried to have a simpler solution. Can you try 6eee5f2 and see if it fixes your problem?

Also, gocryptfs will keep the -nonempty option, as I think it is useful. Mounting over non-empty directories should still be rejected by default, also on libfuse3.

@juddmon
Copy link
Author

juddmon commented Dec 28, 2019

Hi! Thanks for the patch! The version parsing logic looks a little scary to me, I tried to have a simpler solution. Can you try 6eee5f2 and see if it fixes your problem?

Also, gocryptfs will keep the -nonempty option, as I think it is useful. Mounting over non-empty directories should still be rejected by default, also on libfuse3.

Mounting over non-empty directories is allowed by default in libfuse 3.0 to match the behavior of mount.

There is a changelog entry for libfuse3.0 that explains why the -nonempty option breaks with libfuse3.
http://fuse.996288.n3.nabble.com/ANNOUNCE-libfuse-3-0-0-has-been-released-td14403.html

The -o nonempty mount point has been removed, mounting over
non-empty directories is now always allowed. This brings the
behavior of FUSE file systems in-line with the behavior of the
regular mount command.

File systems that do not want to allow mounting to non-empty
directories should perform this check themselves before handing
control to libfuse.
Here is the error I get with this commit:

Password: 
Decrypting master key
/usr/bin/fusermount: unknown option 'nonempty'
fuse.NewServer failed: fusermount exited with code 256

This is on Ubuntu 20.04. I am happy to keep testing for you until we get this right. My PR worked, but I do agree that I wasn't real happy with the version checking and was hoping you knew a better way.

@juddmon
Copy link
Author

juddmon commented Dec 28, 2019

I did not copy the binary built from 6eee5f2 to /usr/bin/gocryptfs. After I did this it works and I am happy with it. Thanks for accepting part of my patch and help!

@rfjakob rfjakob closed this in db43bfc Dec 28, 2019
@rfjakob
Copy link
Owner

rfjakob commented Dec 28, 2019

Thanks for testing! Merged to master.

Mounting over non-empty directories should still be rejected by default, also on libfuse3.

Sorry, that was unclear! gocryptfs will keep rejecting nonempty directories per default, also when using libfuse3. This is checked inside gocryptfs by the isEmptyDir() function and does not depend on libfuse behavoir.

@juddmon
Copy link
Author

juddmon commented Dec 28, 2019

Mounting over non-empty directories should still be rejected by default, also on libfuse3.

Sorry, that was unclear! gocryptfs will keep rejecting nonempty directories per default, also when using libfuse3. This is checked inside gocryptfs by the isEmptyDir() function and does not depend on libfuse behavoir.
Yea, that wording threw me off for a bit and made me re-explain, but I eventually knew what you meant. Will I get a little credit in the git log or anywhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants