From 575f63db82378ee2e67caed026e4c19cb532a4e5 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Mon, 28 Oct 2024 23:17:55 -0400 Subject: [PATCH] jovian-stubs: Use proper quoting for jovian log spew Also make the output a bit more readable by keeping the basename of the called stub. (cherry picked from commit c83be91aba3e9e2594488b2791877917fdfd4d9c) --- pkgs/jovian-stubs/dmidecode | 6 +++--- pkgs/jovian-stubs/sudo | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/jovian-stubs/dmidecode b/pkgs/jovian-stubs/dmidecode index 46024322..8dd0e77f 100644 --- a/pkgs/jovian-stubs/dmidecode +++ b/pkgs/jovian-stubs/dmidecode @@ -1,11 +1,11 @@ #!/usr/bin/env bash ->&2 echo "[JOVIAN] $0: stub called with: $*" +>&2 printf "[JOVIAN] %s: stub called with: %s\n" "${0##*/}" "$(printf "%q " "$@")" if [ "$*" == "-t 11" ]; then - >&2 echo "[JOVIAN] $0: replying with cached data" + >&2 echo "[JOVIAN] ${0##*/}: replying with cached data" cat /run/jovian/dmidecode-11.txt exit 0 fi ->&2 echo "[JOVIAN] $0: don't know how to handle $*" +>&2 printf "[JOVIAN] %s: don't know how to handle: %s\n" "${0##*/}" "$(printf "%q " "$@")" exit 1 diff --git a/pkgs/jovian-stubs/sudo b/pkgs/jovian-stubs/sudo index 66082251..3609dc3e 100644 --- a/pkgs/jovian-stubs/sudo +++ b/pkgs/jovian-stubs/sudo @@ -1,5 +1,5 @@ #!/usr/bin/env bash ->&2 echo "[JOVIAN] $0: stub called with: $*" +>&2 printf "[JOVIAN] %s: stub called with: %s\n" "${0##*/}" "$(printf "%q " "$@")" declare -a final @@ -15,4 +15,6 @@ for value in "$@"; do fi done +>&2 printf "[JOVIAN] %s: parsed command: %s\n" "${0##*/}" "$(printf "%q " "${final[@]}")" + exec "${final[@]}"