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>
This commit is contained in:
parent
d89afdc4a5
commit
6c4ac75596
1 changed files with 1 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue