From 30dbefdb1b6784db6bf23b70714481aeeb3db492 Mon Sep 17 00:00:00 2001 From: Mathieu Moran Date: Mon, 26 Oct 2026 17:58:06 -0400 Subject: [PATCH] proxmox: tolerate NUL-padded agent output and avoid false stage guards powershell.exe over the guest agent can return UTF-16LE, so Test-Path read as T\0r\0u\0e and every 'grep true' failed. Strip NULs in _qga_unwrap, and only treat an explicit False as proof that the role script is absent. --- session1/platforms/proxmox/backends/proxmox.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/session1/platforms/proxmox/backends/proxmox.sh b/session1/platforms/proxmox/backends/proxmox.sh index b7e51a3..2f14fc6 100644 --- a/session1/platforms/proxmox/backends/proxmox.sh +++ b/session1/platforms/proxmox/backends/proxmox.sh @@ -286,9 +286,11 @@ try: except Exception: print("could not parse guest agent output", file=sys.stderr) sys.exit(2) -sys.stdout.write(data.get("out", "")) -if data.get("err", "").strip(): - sys.stderr.write(data["err"]) +out = data.get("out", "").replace("\x00", "") +err = data.get("err", "").replace("\x00", "") +sys.stdout.write(out) +if err.strip(): + sys.stderr.write(err) sys.exit(int(data.get("exitcode", 0))) PY } @@ -320,8 +322,10 @@ backend_start() { local name=$1 remote=$2 # Fail in seconds, not after the one-hour marker wait, when the seed - # payload never reached the guest. - if ! backend_ps "$name" "Test-Path '${remote}'" 2>/dev/null | grep -qi true; then + # payload never reached the guest. Only an explicit False is conclusive. + local exists + exists=$(backend_ps "$name" "Test-Path '${remote}'" 2>/dev/null | tr -d '[:space:]') + if [[ $exists == False ]]; then fail "$name: ${remote} is missing — the seed payload was not copied" return 1 fi