diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2024-12-25 11:29:32 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2024-12-25 11:29:32 +0100 |
commit | ca331b8b349cf1a42e6219d8733ae581199961fc (patch) | |
tree | b04dce61a60a793c5b519b5cbb9754bb7b4c6c4e /src/Main/UserInterface.cpp | |
parent | 341411e935621ee74e816cf83a149ce9cf1e6f9e (diff) | |
download | VeraCrypt-ca331b8b349cf1a42e6219d8733ae581199961fc.tar.gz VeraCrypt-ca331b8b349cf1a42e6219d8733ae581199961fc.zip |
Linux/macOS: Simplify sudo session detection logic and extend it to macOS
This update simplifies the logic for detecting active sudo sessions by checking the exit code of the sudo -n -l command, which reliably returns 0 if a session is active.
Additionally, this approach is now applicable to recent macOS versions, as they no longer have the sudo bug that previously prevented us from using this method.
Diffstat (limited to 'src/Main/UserInterface.cpp')
-rw-r--r-- | src/Main/UserInterface.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp index 81093d08..4bb8bcda 100644 --- a/src/Main/UserInterface.cpp +++ b/src/Main/UserInterface.cpp @@ -570,9 +570,7 @@ namespace VeraCrypt Core->SetAdminPasswordCallback (shared_ptr <GetStringFunctor> (new AdminPasswordRequestHandler)); } -#if defined(TC_LINUX ) || defined (TC_FREEBSD) Core->ForceUseDummySudoPassword (CmdLine->ArgUseDummySudoPassword); -#endif Core->WarningEvent.Connect (EventConnector <UserInterface> (this, &UserInterface::OnWarning)); Core->VolumeMountedEvent.Connect (EventConnector <UserInterface> (this, &UserInterface::OnVolumeMounted)); |