Unix: require confirmation before overwriting containers (#1861)

This commit is contained in:
felix authored and GitHub committed 2026-10-06 00:09:52 +09:00
1 parent 9d9fda208d
commit 4edad72bcc
1 file changed
+17
+17
View File
@@ -687,6 +687,23 @@ namespace VeraCrypt
} 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())
{
foreach_ref (const HostDevice &drive, Core->GetHostDevices())