Expand description
Authentication helpers (sudo elevation) shared by all front-ends. Sudo/root authentication helpers shared by the TUI password prompt and the GUI authentication dialog.
This module contains no UI framework code — front-ends own their own widgets/state and call into these functions to perform the actual authentication.
Functions§
- authenticate_
sudo - Attempt to authenticate as root using
sudo -S -vwith the given password piped over stdin. ReturnsOk(true)if authentication succeeded,Ok(false)if the password was rejected, andErrifsudocould not be invoked at all. - cache_
sudo_ password - Cache a validated sudo password for later privileged commands to reuse.
- cached_
sudo_ password - Return a clone of the cached sudo password, if one is set.
- clear_
cached_ sudo_ password - Clear any cached sudo password (call once a run finishes, the dialog is cancelled, or the app is closing).