Skip to content

Add validation for VeraCrypt volume inputs#29

Merged
srichs merged 1 commit intomainfrom
codex/review-code-for-improvements
Feb 8, 2026
Merged

Add validation for VeraCrypt volume inputs#29
srichs merged 1 commit intomainfrom
codex/review-code-for-improvements

Conversation

@srichs
Copy link
Owner

@srichs srichs commented Feb 8, 2026

Motivation

  • Improve robustness and error messages when creating or mounting volumes by validating user-provided inputs before invoking the VeraCrypt CLI.
  • Prevent common errors such as non-positive sizes and missing parent directories for created volumes, and invalid mount points on non-Windows systems.

Description

  • Add @staticmethod _validate_size to ensure size is a positive integer and raise ValueError otherwise.
  • Add @staticmethod _validate_volume_parent_dir to ensure the parent directory of volume_path exists and raise VeraCryptError if it does not.
  • Validate non-Windows mount_point paths in mount_volume by calling _check_path when a mount point is provided.
  • Invoke _validate_size and _validate_volume_parent_dir in create_volume before building and running the create command.

Testing

  • No automated tests were run for this change.

Codex Task

@srichs srichs merged commit 30109c3 into main Feb 8, 2026
0 of 2 checks passed
@srichs srichs deleted the codex/review-code-for-improvements branch February 8, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant