Linux: fall back to FUSE when dmsetup is not installed (#1898)

Without dmsetup, MountVolumeNative fails with "dmsetup not found in
system directories" instead of using the FUSE path, so on systems that
do not ship device-mapper tools (for example OpenWrt) every mount and
the filesystem formatting step of --create need an explicit
--mount-options=nokernelcrypto. Treat a missing dmsetup like the other
cases where kernel crypto cannot be used.

Signed-off-by: Ville Takio <ville+git@takio.fi>
This commit is contained in:
Ville Takio authored and GitHub committed 2026-10-03 11:00:48 +09:00
1 parent 5c7f60dfcf
commit d24b82102a
1 file changed
+6
+6
View File
@@ -502,6 +502,12 @@ namespace VeraCrypt
if (!SystemInfo::IsVersionAtLeast (2, 6, xts ? 24 : 20)) if (!SystemInfo::IsVersionAtLeast (2, 6, xts ? 24 : 20))
throw NotApplicable (SRC_POS); throw NotApplicable (SRC_POS);
// Without dmsetup, kernel crypto cannot be used: fall back to FUSE
// instead of failing, as when nokernelcrypto was given.
string dmsetupError;
if (Process::FindSystemBinary ("dmsetup", dmsetupError).empty())
throw NotApplicable (SRC_POS);
// Load device mapper kernel module // Load device mapper kernel module
list <string> execArgs; list <string> execArgs;
foreach (const string &dmModule, StringConverter::Split ("dm_mod dm-mod dm")) foreach (const string &dmModule, StringConverter::Split ("dm_mod dm-mod dm"))