Skip to content

Unix: require confirmation before overwriting containers - #1861

Open
felix314159 wants to merge 1 commit into
veracrypt:masterfrom
felix314159:master
Open

Unix: require confirmation before overwriting containers#1861
felix314159 wants to merge 1 commit into
veracrypt:masterfrom
felix314159:master

Conversation

@felix314159

Copy link
Copy Markdown

Overview

Before this PR --text --create replaced an existing file container without confirmation and without requiring --force. That should not be possible.

Reproduction

v=./src/Main/veracrypt
p=/tmp/existing.hc

$v --text --create "$p" --size=4M \
  --password='Original-Password-For-Test' --pim=0 --keyfiles='' \
  --hash=sha512 --encryption=aes --filesystem=none \
  --volume-type=normal --quick --random-source=/dev/urandom \
  --non-interactive

sha256sum "$p"

# Previously succeeded and changed the hash without --force.
$v --text --create "$p" --size=4M \
  --password='Replacement-Password-For-Test' --pim=0 --keyfiles='' \
  --hash=sha512 --encryption=aes --filesystem=none \
  --volume-type=normal --quick --random-source=/dev/urandom \
  --non-interactive

sha256sum "$p"

This change makes noninteractive creation reject an existing normal container unless --force is supplied. Interactive text mode now displays the existing overwrite warning and requests confirmation, matching the GUI.

I validated the fix with a text-mode Linux build, algorithm self-tests, and overwrite tests both with and without --force.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant