mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
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.
This commit is contained in:
@@ -32,9 +32,7 @@ namespace VeraCrypt
|
||||
ArgAllowScreencapture (false),
|
||||
ArgDisableFileSizeCheck (false),
|
||||
ArgUseLegacyPassword (false),
|
||||
#if defined(TC_LINUX ) || defined (TC_FREEBSD)
|
||||
ArgUseDummySudoPassword (false),
|
||||
#endif
|
||||
StartBackgroundTask (false)
|
||||
{
|
||||
wxCmdLineParser parser;
|
||||
@@ -376,9 +374,7 @@ namespace VeraCrypt
|
||||
|
||||
ArgDisableFileSizeCheck = parser.Found (L"no-size-check");
|
||||
ArgUseLegacyPassword = parser.Found (L"legacy-password-maxlength");
|
||||
#if defined(TC_LINUX ) || defined (TC_FREEBSD)
|
||||
ArgUseDummySudoPassword = parser.Found (L"use-dummy-sudo-password");
|
||||
#endif
|
||||
|
||||
#if !defined(TC_WINDOWS) && !defined(TC_MACOSX)
|
||||
if (parser.Found (L"fs-options", &str))
|
||||
|
||||
Reference in New Issue
Block a user