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

Use ensure_last_os_error() with libfuse2 #218

Merged
merged 1 commit into from Aug 24, 2022

Conversation

str4d
Copy link
Contributor

@str4d str4d commented Aug 21, 2022

Under some conditions, fuse_mount_compat25 may return -1 to indicate
an error but does not set errno. io::Error::last_os_error() will then
be equivalent to Err(Success) which is somewhat surprising.

In particular, if the mount options auto_unmount,allow_{root,other}
are set but the user does not have user_allow_other set in their
fuse.conf, the fusermount binary will print an error message to
stderr but not set errno.

fusermount3 has the same behaviour, but this issue was mitigated for
the libfuse3 binding in #178 by mapping Err(Success) to
the slightly more useful Error(Other, "Unspecified Error"). This
commit applies the same fix to the libfuse2 binding.

@str4d
Copy link
Contributor Author

str4d commented Aug 22, 2022

The CI / ci (pre) step is failing because of an unrelated change to the license specifier in unicode-ident 1.0.3 (dtolnay/unicode-ident#9) to correctly note that anything generated from the Unicode Character Database needs to be used under Unicode-DFS-2016.

@cberner
Copy link
Owner

cberner commented Aug 23, 2022

I merged a fix for that. Could you rebase on master and force push your branch to restart the CI?

Under some conditions, `fuse_mount_compat25` may return -1 to indicate
an error but does not set errno. `io::Error::last_os_error()` will then
be equivalent to `Err(Success)` which is somewhat surprising.

In particular, if the mount options `auto_unmount,allow_{root,other}`
are set but the user does not have `user_allow_other` set in their
`fuse.conf`, the `fusermount` binary will print an error message to
stderr but not set errno.

`fusermount3` has the same behaviour, but this issue was mitigated for
the libfuse3 binding in cberner#178 by mapping `Err(Success)` to
the slightly more useful `Error(Other, "Unspecified Error")`. This
commit applies the same fix to the libfuse2 binding.
@str4d str4d force-pushed the fix-fuse2-success-os-error branch from c9725e0 to eaabe68 Compare August 24, 2022 00:24
@str4d
Copy link
Contributor Author

str4d commented Aug 24, 2022

Rebased on master to fix CI. It won't automatically restart though because I still count as a new contributor, so someone needs to check I didn't insert a cryptominer during the rebase 🙃

@cberner cberner merged commit 48783dc into cberner:master Aug 24, 2022
@cberner
Copy link
Owner

cberner commented Aug 24, 2022

Merged. Thanks!

@str4d str4d deleted the fix-fuse2-success-os-error branch August 24, 2022 09:06
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.

None yet

2 participants