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

Invalid mount attempt leaves behind empty directory/member #42

Closed
RaphaelWimmer opened this issue Jul 20, 2021 · 1 comment
Closed

Invalid mount attempt leaves behind empty directory/member #42

RaphaelWimmer opened this issue Jul 20, 2021 · 1 comment

Comments

@RaphaelWimmer
Copy link

Trying to mount a JSON file within the virtual filesystem fails (which is ok, I guess):

raphael@tukk ~/Downloads> ./ffs -i ffs1.json
raphael@tukk ~/Downloads> cat ffs1.json
{"option":"test"}
raphael@tukk ~/Downloads> cp ffs1.json ffs1/
raphael@tukk ~/Downloads> ls ffs1/
ffs1.json option
raphael@tukk ~/Downloads> ./ffs -i ffs1/ffs1.json
fusermount: bad mount point ffs1/ffs1: Permission denied
thread 'main' panicked at 'called Result::unwrap() on an Err
value: Os { code: 2, kind: NotFound, message: "No such file or
directory" }', src/main.rs:38:41
note: run with RUST_BACKTRACE=1 environment variable to display a
backtrace

This actually creates the subdirectory ffs1/ffs1 but does not mount anything there. Unmounting the filesystem results in an additional entry "ffs1: {}" in the json file. I'd suggest that a failed command should not leave behind any new files/members.

mgree added a commit that referenced this issue Jul 21, 2021
@RaphaelWimmer reports in #42 an issue with nested mounts (which are just disallowed by FUSE and macFUSE), which we were handling poorly.

The solution is to check that mount2 worked correctly and report messages.
@mgree
Copy link
Owner

mgree commented Jul 21, 2021

Thanks for this report! I patterned my test off of your example, so it should be good. Can you download a dev build and comment/re-open this if it's not fixed?

@mgree mgree closed this as completed Jul 21, 2021
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

No branches or pull requests

2 participants