Skip to content

AppImage helper: pipe the backend archive to the root script - #20

Merged
AdrianTM merged 1 commit into
MX-Linux:masterfrom
fehlix:appimage-helper-pipe
Nov 30, 2026
Merged

AdrianTM merged 1 commit into
MX-Linux:masterfrom
fehlix:appimage-helper-pipe

Conversation

@fehlix

@fehlix fehlix commented Nov 30, 2026

Copy link
Copy Markdown

The AppImage could not create a LiveUSB when started normally (FUSE mount + pkexec): "Error encountered in the LiveUSB creation process".

Cause: the helper opened backend.tar.gz before pkexec and passed it as stdin (setStandardInputFile). FUSE checks the reading process on every read, and the user's mount (no allow_other) refuses root even on a file descriptor the user opened. cat in the root script got "Permission denied", the archive was empty, set -eu stopped the script.

Reproduced with:

pkexec /bin/sh -c 'cat > /tmp/t.tgz; ls -l /tmp/t.tgz' < /tmp/.mount_XXX/usr/libexec/mx-live-usb-maker/backend.tar.gz
cat: -: Permission denied      (0 bytes; from an extracted AppImage: full size)

Not visible in the build check (helper exec live-usb-maker --help runs without pkexec), with --appimage-extract, or when started with sudo.

Fix: the helper reads the archive itself as the user and writes it to the script's stdin through a pipe. The rest is unchanged (root-owned work directory, sha256 check, extraction). Comment added at cat.

Tested: AppImage built with make-appimage.sh and started normally in a VM (FUSE mount + pkexec): LiveUSB written from an ISO and as a clone, both OK (before: "Error encountered" in both cases).

Root cannot read the user's FUSE mount of the AppImage, not even through a
file descriptor the user opened before pkexec: reading stdin failed with
"Permission denied", the script got an empty archive and live-usb-maker
never started ("Error encountered in the LiveUSB creation process").

The helper now reads backend.tar.gz itself as the user and writes it to the
script's stdin through a pipe. Copy to a root-owned directory, hash check
and extraction are unchanged.
@AdrianTM
AdrianTM merged commit 239fd4a into MX-Linux:master Nov 30, 2026
3 checks passed
@AdrianTM

Copy link
Copy Markdown

Thanks! I pulled and rebuilt the AppImage

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