lib.ExecApp: Add class #76

Closed
Jan Lindemann wants to merge 17 commits from jan/feature/20260822-lib-execapp-add-class into master AGit
Showing only changes of commit 6c4ac75596 - Show all commits

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 <jan@janware.com>
Jan Lindemann 2026-08-16 07:03:03 +02:00
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -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,