diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-08-31 01:56:56 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-08-31 01:56:56 +0200 |
commit | 4470d11c39bca7c3d29f7dd596a8fa66f19d42bc (patch) | |
tree | d1899b3a02e915693a1d32e3c88bd007014e77a3 /src/Main/UserInterface.cpp | |
parent | 90f91945582b2020f236d666e16028159143c57f (diff) | |
parent | 9582d8fbcb57c0297aad3d4a05eac53f1c125cd3 (diff) | |
download | VeraCrypt-4470d11c39bca7c3d29f7dd596a8fa66f19d42bc.tar.gz VeraCrypt-4470d11c39bca7c3d29f7dd596a8fa66f19d42bc.zip |
Merge pull request #18 from LouisTakePILLz/master
Linux/MacOSX: Support supplying password to VeraCrypt via pipe (stdin)
Diffstat (limited to 'src/Main/UserInterface.cpp')
-rw-r--r-- | src/Main/UserInterface.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp index 68048663..070a49c1 100644 --- a/src/Main/UserInterface.cpp +++ b/src/Main/UserInterface.cpp @@ -889,11 +889,19 @@ namespace VeraCrypt { CommandLineInterface &cmdLine = *CmdLine; - switch (cmdLine.ArgCommand) - { - case CommandId::None: + if (cmdLine.ArgCommand == CommandId::None) return false; + if (Preferences.UseStandardInput) + { + wstring pwdInput; + wcin >> pwdInput; + + cmdLine.ArgPassword = make_shared<VolumePassword> (pwdInput); + } + + switch (cmdLine.ArgCommand) + { case CommandId::AutoMountDevices: case CommandId::AutoMountFavorites: case CommandId::AutoMountDevicesFavorites: |