pub fn build_password_pipe(
tool: PrivilegeTool,
password: &str,
command: &str,
) -> Option<String>Expand description
What: Build a command that pipes a password to the privilege tool via stdin.
Inputs:
tool: Resolved privilege tool.password: Cleartext password.command: The unprivileged command to wrap.
Output:
Some(cmd)for tools that support stdin password (sudo).Nonefor tools that do not (doas).
Details:
- Uses
shell_single_quotefor safe password escaping. - Only sudo supports
-S(read password from stdin).