pub fn should_use_passwordless_sudo(settings: &Settings) -> boolExpand description
What: Check if passwordless sudo should be used based on settings and system availability.
Inputs:
settings: Reference to the application settings.
Output:
trueif passwordless sudo should be used,falseotherwise.
Details:
- First checks if
use_passwordless_sudois enabled in settings (safety barrier). - If not enabled, returns
falseimmediately without checking system availability. - If enabled, checks if passwordless sudo is actually available on the system.
- Returns
trueonly if both conditions are met. - Logs the decision for debugging purposes.
- Testing: Only when
PACSEA_INTEGRATION_TEST=1is set (test harness), the env varPACSEA_TEST_SUDO_PASSWORDLESSis honored. In production this override is disabled.