From 5d7e8cd759bc2e784a146d1f7b9f70489614f43a Mon Sep 17 00:00:00 2001 From: Hibby Date: Sun, 26 Apr 2026 06:53:11 -0500 Subject: Run remote verification commands under bash --- build-helpers.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build-helpers.sh b/build-helpers.sh index 26de872..20a6a2b 100644 --- a/build-helpers.sh +++ b/build-helpers.sh @@ -553,8 +553,17 @@ verify_remote() { local remote_host="${REMOTE_TARGET%%:*}" local remote_path="${REMOTE_TARGET#*:}" local remote_path_q + local remote_file_script + local remote_link_script + local remote_file_command + local remote_link_command printf -v remote_path_q "%q" "${remote_path%/}" + remote_file_script="cd $remote_path_q && find . -type f -print | LC_ALL=C sort | while IFS= read -r file; do sha256sum \"\$file\"; done" + remote_link_script="cd $remote_path_q && find . -type l -print | LC_ALL=C sort | while IFS= read -r link; do printf \"%s -> %s\\n\" \"\$link\" \"\$(readlink \"\$link\")\"; done" + remote_file_command="'${remote_file_script//\'/\'\\\'\'}'" + remote_link_command="'${remote_link_script//\'/\'\\\'\'}'" + local local_files local remote_files local local_links @@ -571,7 +580,7 @@ verify_remote() { done ) > "$local_files" - if ! ssh "$remote_host" "cd $remote_path_q && find . -type f -print | LC_ALL=C sort | while IFS= read -r file; do sha256sum \"\$file\"; done" > "$remote_files"; then + if ! ssh "$remote_host" "bash -lc $remote_file_command" > "$remote_files"; then echo "❌ ERROR: Remote checksum collection failed" rm -f "$local_files" "$remote_files" "$local_links" "$remote_links" return 1 @@ -590,7 +599,7 @@ verify_remote() { done ) > "$local_links" - if ! ssh "$remote_host" "cd $remote_path_q && find . -type l -print | LC_ALL=C sort | while IFS= read -r link; do printf \"%s -> %s\\n\" \"\$link\" \"\$(readlink \"\$link\")\"; done" > "$remote_links"; then + if ! ssh "$remote_host" "bash -lc $remote_link_command" > "$remote_links"; then echo "❌ ERROR: Remote symlink collection failed" rm -f "$local_files" "$remote_files" "$local_links" "$remote_links" return 1 -- cgit v1.2.3