lib.pm.dpkg: Pass context to run_sudo()
_run() forwards the execution context to run_cmd() when sudo is not requested, but calls run_sudo(cmd) without the context in the sudo case. run_sudo() then falls back to a fresh local context, so sudoed dpkg and dpkg-query commands run on the local machine instead of on the given context, e.g. Distro._delete() on a remote host. Pass the context and non-interactive stdin to run_sudo() as well. 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
8f52639d14
commit
ebe187788a
1 changed files with 1 additions and 1 deletions
|
|
@ -29,7 +29,7 @@ async def _run(
|
|||
cmd: list[str], sudo: bool = False, ec: ExecContext | None = None
|
||||
) -> str:
|
||||
return (
|
||||
await run_sudo(cmd)
|
||||
await run_sudo(cmd, ec = ec, cmd_input = InputMode.NonInteractive)
|
||||
if sudo else await run_cmd(cmd, ec = ec, cmd_input = InputMode.NonInteractive)
|
||||
).stdout_str
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue