mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-05 16:46:35 -05:00
macOS: block partitioned disk alias bypass
On macOS, the same whole disk can be addressed as both /dev/diskN and /dev/rdiskN. The GUI creation wizard only compared the selected path against the enumerated raw device path, so manually entering the block-device alias could bypass the existing DEVICE_PARTITIONS_ERR guard and allow formatting a disk that still had partitions. Add a shared macOS device-path comparison helper that normalizes paths to their raw-device form before comparison. Use it in the GUI wizard so /dev/diskN and /dev/rdiskN are treated as the same whole-disk target while partition paths remain distinct. Apply the same partitioned whole-device guard in the text/CLI creation path as well, including the macOS alias normalization, so command-line creation cannot format a partitioned top-level disk through an alternate device alias. Fixes #728
This commit is contained in:
3 files changed
+33
-1
No files matched your search
@@ -61,6 +61,11 @@ namespace VeraCrypt
|
||||
return deviceIdentifier;
|
||||
}
|
||||
|
||||
inline bool IsSameMacOSXDevicePath (const string &firstDeviceIdentifier, const string &secondDeviceIdentifier)
|
||||
{
|
||||
return GetMacOSXRawDevicePath (firstDeviceIdentifier) == GetMacOSXRawDevicePath (secondDeviceIdentifier);
|
||||
}
|
||||
|
||||
inline string GetMacOSXFormatterName (const string &fsFormatter)
|
||||
{
|
||||
size_t namePos = fsFormatter.find_last_of ('/');
|
||||
|
||||
Reference in new issue
Block a user