From 6c4ac7559693386c90a217a8757b0bcb6bde15af Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sun, 16 Aug 2026 07:03:03 +0200 Subject: [PATCH] lib.ec.ssh.Exec: Drop askpass newline __init_askpass() generates an askpass script whose echo statement embeds a newline inside the quoted password: echo -n "PASSWORD ". Bash happily spans the quote over the newline, and the script therefore prints the password followed by a trailing newline. run_askpass() returns that output verbatim, so the password passed on carries a newline and authentication fails. Write the script so it prints the password and nothing else. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2 Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/ec/ssh/Exec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/jw/pkg/lib/ec/ssh/Exec.py b/src/python/jw/pkg/lib/ec/ssh/Exec.py index 4e169551..ac405346 100644 --- a/src/python/jw/pkg/lib/ec/ssh/Exec.py +++ b/src/python/jw/pkg/lib/ec/ssh/Exec.py @@ -39,7 +39,7 @@ class Exec(Base): ) os.chmod(f.name, 0o0700) self.__askpass = f.name - f.write(f'#!/bin/bash\n\necho -n "{self.password}\n"') + f.write(f'#!/bin/bash\n\necho -n "{self.password}"\n') f.close() for key, val in { 'SSH_ASKPASS': self.__askpass,