VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main')
-rw-r--r--src/Main/CommandLineInterface.cpp10
-rw-r--r--src/Main/CommandLineInterface.h3
-rw-r--r--src/Main/UserInterface.cpp4
3 files changed, 16 insertions, 1 deletions
diff --git a/src/Main/CommandLineInterface.cpp b/src/Main/CommandLineInterface.cpp
index 0360921b..b5f18dd3 100644
--- a/src/Main/CommandLineInterface.cpp
+++ b/src/Main/CommandLineInterface.cpp
@@ -32,6 +32,9 @@ namespace VeraCrypt
ArgTrueCryptMode (false),
ArgDisableFileSizeCheck (false),
ArgUseLegacyPassword (false),
+#if defined(TC_LINUX ) || defined (TC_FREEBSD)
+ ArgUseDummySudoPassword (false),
+#endif
StartBackgroundTask (false)
{
wxCmdLineParser parser;
@@ -100,7 +103,9 @@ namespace VeraCrypt
parser.AddParam ( _("Mount point"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddSwitch (L"", L"no-size-check", _("Disable check of container size against disk free space."));
parser.AddSwitch (L"", L"legacy-password-maxlength", _("Use legacy maximum password length (64 UTF-8 bytes)"));
-
+#if defined(TC_LINUX ) || defined (TC_FREEBSD)
+ parser.AddSwitch (L"", L"use-dummy-sudo-password", _("Use dummy password in sudo to detect if it is already authenticated"));
+#endif
wxString str;
bool param1IsVolume = false;
bool param1IsMountedVolumeSpec = false;
@@ -339,6 +344,9 @@ namespace VeraCrypt
ArgTrueCryptMode = parser.Found (L"truecrypt");
ArgDisableFileSizeCheck = parser.Found (L"no-size-check");
ArgUseLegacyPassword = parser.Found (L"legacy-password-maxlength") || ArgTrueCryptMode;
+#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))
diff --git a/src/Main/CommandLineInterface.h b/src/Main/CommandLineInterface.h
index ef4836e6..00dabfd6 100644
--- a/src/Main/CommandLineInterface.h
+++ b/src/Main/CommandLineInterface.h
@@ -85,6 +85,9 @@ namespace VeraCrypt
shared_ptr<SecureBuffer> ArgTokenPin;
bool ArgDisableFileSizeCheck;
bool ArgUseLegacyPassword;
+#if defined(TC_LINUX ) || defined (TC_FREEBSD)
+ bool ArgUseDummySudoPassword;
+#endif
bool StartBackgroundTask;
UserPreferences Preferences;
diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp
index 7c29bbe0..c124d18a 100644
--- a/src/Main/UserInterface.cpp
+++ b/src/Main/UserInterface.cpp
@@ -534,6 +534,10 @@ 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));