mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-06 00:56:35 -05:00
CLI: preserve read-only mode with protection credentials
Apply the same read-only precedence as protect-hidden=yes when parsing hidden-volume passwords, keyfiles, and PIMs.
This commit is contained in:
1 file changed
+6
-3
@@ -572,13 +572,15 @@ namespace VeraCrypt
|
||||
if (parser.Found (L"protection-keyfiles", &str))
|
||||
{
|
||||
ArgMountOptions.ProtectionKeyfiles = ToKeyfileList (str);
|
||||
ArgMountOptions.Protection = VolumeProtection::HiddenVolumeReadOnly;
|
||||
if (ArgMountOptions.Protection != VolumeProtection::ReadOnly)
|
||||
ArgMountOptions.Protection = VolumeProtection::HiddenVolumeReadOnly;
|
||||
}
|
||||
|
||||
if (parser.Found (L"protection-password", &str))
|
||||
{
|
||||
ArgMountOptions.ProtectionPassword = ToUTF8Password (str.c_str(), -1, ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize);
|
||||
ArgMountOptions.Protection = VolumeProtection::HiddenVolumeReadOnly;
|
||||
if (ArgMountOptions.Protection != VolumeProtection::ReadOnly)
|
||||
ArgMountOptions.Protection = VolumeProtection::HiddenVolumeReadOnly;
|
||||
}
|
||||
|
||||
if (parser.Found (L"protection-pim", &str))
|
||||
@@ -595,7 +597,8 @@ namespace VeraCrypt
|
||||
throw_err (LangString["PARAMETER_INCORRECT"] + L": " + str);
|
||||
}
|
||||
ArgMountOptions.ProtectionPim = pim;
|
||||
ArgMountOptions.Protection = VolumeProtection::HiddenVolumeReadOnly;
|
||||
if (ArgMountOptions.Protection != VolumeProtection::ReadOnly)
|
||||
ArgMountOptions.Protection = VolumeProtection::HiddenVolumeReadOnly;
|
||||
}
|
||||
|
||||
if (parser.Found (L"protection-hash", &str))
|
||||
|
||||
Reference in new issue
Block a user