mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-05 16:46:35 -05:00
Unix: require confirmation before overwriting containers (#1861)
This commit is contained in:
1 parent
9d9fda208d
commit
4edad72bcc
1 file changed
+17
@@ -687,6 +687,23 @@ namespace VeraCrypt
|
|||||||
} while (options->Path.IsEmpty());
|
} while (options->Path.IsEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Normal file-hosted volumes replace their destination. Require explicit
|
||||||
|
// overwrite authorization, matching the graphical creation wizard.
|
||||||
|
if (options->Type == VolumeType::Normal
|
||||||
|
&& !options->Path.IsDevice()
|
||||||
|
&& FilesystemPath (wstring (options->Path)).IsFile()
|
||||||
|
&& !CmdLine->ArgForce)
|
||||||
|
{
|
||||||
|
wxString confirmMsg = wxString::Format (
|
||||||
|
LangString["OVERWRITEPROMPT"], wstring (options->Path).c_str());
|
||||||
|
|
||||||
|
if (Preferences.NonInteractive)
|
||||||
|
throw_err (confirmMsg);
|
||||||
|
|
||||||
|
if (!AskYesNo (confirmMsg, false, true))
|
||||||
|
throw UserAbort (SRC_POS);
|
||||||
|
}
|
||||||
|
|
||||||
if (options->Path.IsDevice())
|
if (options->Path.IsDevice())
|
||||||
{
|
{
|
||||||
foreach_ref (const HostDevice &drive, Core->GetHostDevices())
|
foreach_ref (const HostDevice &drive, Core->GetHostDevices())
|
||||||
|
|||||||
Reference in new issue
Block a user