-
Notifications
You must be signed in to change notification settings - Fork 20
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
Conversation
+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; |
There was a problem hiding this comment.
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
).
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: You can use it (after unzipping) with https://github.com/AppImage/appimagetool by using the |
Had we ever merged this? Don't think so, because I was waiting feedback. |
See #15