From 48cf5d43c172dc8d70206d4772fae64ea95bc9c9 Mon Sep 17 00:00:00 2001 From: Pavel Isaev Date: Sat, 7 Nov 2026 19:30:07 +0300 Subject: [PATCH] Correct Flatpak import signature verification arguments --- adapters/flatpak-import.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/adapters/flatpak-import.sh b/adapters/flatpak-import.sh index 56e155a..9a5b748 100644 --- a/adapters/flatpak-import.sh +++ b/adapters/flatpak-import.sh @@ -16,9 +16,10 @@ trap 'rm -f "$config"' EXIT printf '[Installation "%s"]\nPath=%s\nDisplayName=Archipelago installation target\n' "$name" "$destination" > "$config" chmod 0600 "$config" # Namespace isolation makes this a local-media import, not a network fallback. -unshare --net /bin/bash -euo pipefail -s -- "$name" "$seed" <<'IMPORT' +unshare --net /bin/bash -euo pipefail -s -- "$name" "$seed" "$destination" <<'IMPORT' name=$1 seed=$2 +destination=$3 flatpak --installation="$name" remote-add flathub "$seed/flathub.flatpakrepo" flatpak --installation="$name" remote-modify --collection-id=org.flathub.Stable flathub flatpak --installation="$name" config --set languages '*' @@ -34,4 +35,11 @@ PY test "${#apps[@]}" -gt 0 flatpak --installation="$name" install --noninteractive --assumeyes --sideload-repo="$seed/.ostree/repo" flathub "${apps[@]}" for ref in "${apps[@]}"; do flatpak --installation="$name" info "$ref"; done +# Do not accept an import that retained commit bytes but lost detached signatures. +# This also covers auto-installed runtime extensions rather than apps alone. +mapfile -t imported < <(ostree --repo="$destination/repo" refs | grep -E '^flathub:(app|runtime)/') +test "${#imported[@]}" -gt 0 +for ref in "${imported[@]}"; do + ostree --repo="$destination/repo" show --gpg-verify-remote=flathub "$ref" >/dev/null +done IMPORT