Linux/MacOSX: fix issue creating volumes using command line with a filesystem other than FAT.

This commit is contained in:
Mounir IDRASSI 2016-01-26 01:27:14 +01:00
parent 84ee7076d9
commit d53b48bdf0
2 changed files with 25 additions and 0 deletions

View File

@ -297,6 +297,27 @@ namespace VeraCrypt
if (str.IsSameAs (L"FAT", false))
ArgFilesystem = VolumeCreationOptions::FilesystemType::FAT;
#ifdef TC_LINUX
else if (str.IsSameAs (L"Ext2", false))
ArgFilesystem = VolumeCreationOptions::FilesystemType::Ext2;
else if (str.IsSameAs (L"Ext3", false))
ArgFilesystem = VolumeCreationOptions::FilesystemType::Ext3;
else if (str.IsSameAs (L"Ext4", false))
ArgFilesystem = VolumeCreationOptions::FilesystemType::Ext4;
else if (str.IsSameAs (L"NTFS", false))
ArgFilesystem = VolumeCreationOptions::FilesystemType::NTFS;
#elif defined (TC_MACOSX)
else if ( str.IsSameAs (L"HFS", false)
|| str.IsSameAs (L"HFS+", false)
|| str.IsSameAs (L"MacOsExt", false)
)
{
ArgFilesystem = VolumeCreationOptions::FilesystemType::MacOsExt;
}
#elif defined (TC_FREEBSD) || defined (TC_SOLARIS)
else if (str.IsSameAs (L"UFS", false))
ArgFilesystem = VolumeCreationOptions::FilesystemType::UFS;
#endif
else
ArgFilesystem = VolumeCreationOptions::FilesystemType::None;
}

View File

@ -883,6 +883,10 @@ namespace VeraCrypt
if (options->Filesystem == VolumeCreationOptions::FilesystemType::MacOsExt && options->Size >= 10 * BYTES_PER_MB)
args.push_back ("-J");
// Perform a quick NTFS formatting
if (options->Filesystem == VolumeCreationOptions::FilesystemType::NTFS)
args.push_back ("-f");
args.push_back (string (virtualDevice));
Process::Execute (fsFormatter, args);