1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2026-06-15 09:06:08 -05:00

Linux: allow mounting NTFS volumes with ntfs3 (#1695)

* Linux: allow mounting volumes with ntfs3

* Linux: add ntfs3 preference for NTFS mounts

* Linux: wrap ntfs3 preference help text

* Add Linux ntfs3 mount preference

* Remove Russian translation changes from ntfs3 PR

* XML Translations: Add English fallback entries for ntfs3 preference

---------

Co-authored-by: Mounir IDRASSI <mounir.idrassi@amcrypto.jp>
This commit is contained in:
Mammoth
2026-04-29 04:11:22 +03:00
committed by GitHub
parent 1b6f2690db
commit 771acf5951
55 changed files with 223 additions and 4 deletions
+34 -1
View File
@@ -566,6 +566,29 @@ namespace VeraCrypt
return GetMountedFilesystems (DevicePath(), mountPoint).size() == 0;
}
#ifdef TC_LINUX
string CoreUnix::DetectFilesystemType (const DevicePath &devicePath) const
{
list <string> args;
args.push_back ("-p");
args.push_back ("-o");
args.push_back ("value");
args.push_back ("-s");
args.push_back ("TYPE");
args.push_back ("--");
args.push_back (devicePath);
try
{
return StringConverter::ToLower (StringConverter::Trim (Process::Execute ("blkid", args, 2000)));
}
catch (...)
{
return string();
}
}
#endif
void CoreUnix::MountFilesystem (const DevicePath &devicePath, const DirectoryPath &mountPoint, const string &filesystemType, bool readOnly, const string &systemMountOptions) const
{
if (GetMountedFilesystems (DevicePath(), mountPoint).size() > 0)
@@ -914,8 +937,18 @@ namespace VeraCrypt
if (!options.NoFilesystem && options.MountPoint && !options.MountPoint->IsEmpty())
{
wstring filesystemType = options.FilesystemType;
#ifdef TC_LINUX
if (options.MountNtfsWithNtfs3 && filesystemType.empty()
&& DetectFilesystemType (loopDev) == "ntfs")
{
filesystemType = L"ntfs3";
}
#endif
MountFilesystem (loopDev, *options.MountPoint,
StringConverter::ToSingle (options.FilesystemType),
StringConverter::ToSingle (filesystemType),
options.Protection == VolumeProtection::ReadOnly,
StringConverter::ToSingle (options.FilesystemOptions));
}