Conversation
…sermount3 Distributions that run with NoNewPrivs replace the setuid fusermount3 with defused, which works without the setuid bit. AppImages failed to mount there because the runtime only accepted setuid root fusermount binaries. Now, if no setuid root fusermount is found on the PATH, the runtime falls back to a non-setuid fusermount that identifies itself as defused in its --version output, so AppImages work on such systems while setuid binaries are still preferred and arbitrary non-setuid binaries are still rejected.
d69f79d to
cc17f97
Compare
|
Build for testing: |
Haha, I like @thkukuk's enthusiasm, but defused is a pre-alpha project; as far as I know no distribution is using it. I wouldn't be surprised if another, different, non-setuid implementation of fusermount3 replaces defused, so I don't think that hard-coding the word |
Fixes #150
Distributions running with NoNewPrivs replace the setuid fusermount3 with defused, which works without the setuid bit. The runtime skipped it because it only accepted setuid root fusermount binaries, so AppImages could not be mounted on such systems.
As suggested in #150 (comment), the PATH is first searched for setuid root fusermount binaries exactly as before. Only if none is found, a second pass looks for a non-setuid executable fusermount whose
--versionoutput identifies it as defused (fusermount3 version: <ver> (defused)), and uses that one. Other non-setuid fusermount binaries are still rejected, andFUSERMOUNT_PROGcontinues to override the search.Tested the search functions in isolation with mock binaries: a plain non-setuid fusermount3 is skipped while a defused one is picked, a setuid root binary is preferred over defused even when it comes later in PATH, and non-executable entries are ignored. Not tested against a real defused installation.