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

Fix "fuse: failed to exec fusermount: Permission denied" #18

Closed
wants to merge 2 commits into from
Closed

Fix "fuse: failed to exec fusermount: Permission denied" #18

wants to merge 2 commits into from

Conversation

danpla
Copy link

@danpla danpla commented Oct 19, 2023

See #15

Comment on lines 17 to 27
+static const char *fuse_mount_prog(void)
+{
+ // Check if the FUSERMOUNT_PROG environment variable is set and if so, use it
+ const char *prog = getenv("FUSERMOUNT_PROG");
+ if (prog) {
+ if (access(prog, X_OK) == 0)
+ return prog;
+ }
+ if (prog && access(prog, X_OK) == 0)
+ return prog;
+
+ // Check if there is a binary "fusermount3"
+ prog = findBinaryInFusermountDir("fusermount3");
+ prog = FUSERMOUNT_DIR "/fusermount3";
+ if (access(prog, X_OK) == 0)
+ return prog;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this function can be evaluated several times (once in exec_fusermount and the second time for its argv), it should probably always either return a pointer to a static buffer (filled only once), or allocate the string on the heap (we can assign the returned pointer to a static variable so that the function is called only once).

An alternative is to just use argv[0] in exec_fusermount instead of calling fuse_mount_prog the second time (or probably do the opposite: fill argv[0] with fuse_mount_prog right inside exec_fusermount).

@danpla danpla marked this pull request as draft October 19, 2023 17:03
@danpla danpla marked this pull request as ready for review October 19, 2023 17:05
@probonopd
Copy link
Member

probonopd commented Oct 28, 2023

Thanks for your work on this, I am currently short on time so I am extra grateful that you are looking into a fix.

Please test this runtime:
https://github.com/AppImage/type2-runtime/suites/17595899099/artifacts/1013844809

You can use it (after unzipping) with https://github.com/AppImage/appimagetool by using the --runtime-file option.

@probonopd
Copy link
Member

Had we ever merged this? Don't think so, because I was waiting feedback.
I think we should reopen this?

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