pub fn build_credential_warmup(
tool: PrivilegeTool,
password: &str,
) -> Option<String>Expand description
What: Build a credential warm-up command that caches the password.
Inputs:
tool: Resolved privilege tool.password: Cleartext password.
Output:
Some(cmd)for tools that support credential refresh (sudo).Nonefor tools that do not (doas).
Details:
- For sudo:
printf '%s\n' '<pass>' | sudo -S -v 2>/dev/null - Warms up the credential cache so subsequent sudo calls don’t re-prompt.