mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-05-17 10:01:31 +00:00
Linux/FUSE: honor inodes and map unknown errors to EIO
Enable use_ino for Linux FUSE mounts so stable inode numbers returned by getattr and readdir are reported to userspace. For FUSE3, set fuse_config.use_ino from init; for FUSE2, pass -o use_ino because there is no fuse_config init hook. Also map otherwise unhandled FUSE exceptions to EIO instead of EINTR, since these failures are not signal interruptions and should not encourage retry loops.
This commit is contained in:
@@ -150,6 +150,8 @@ namespace VeraCrypt
|
||||
cfg->set_gid = 1;
|
||||
cfg->uid = FuseService::GetUserId();
|
||||
cfg->gid = FuseService::GetGroupId();
|
||||
|
||||
cfg->use_ino = 1;
|
||||
}
|
||||
|
||||
return fuse_service_init_common ();
|
||||
@@ -582,12 +584,12 @@ namespace VeraCrypt
|
||||
catch (std::exception &e)
|
||||
{
|
||||
SystemLog::WriteException (e);
|
||||
return -EINTR;
|
||||
return -EIO;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SystemLog::WriteException (UnknownException (SRC_POS));
|
||||
return -EINTR;
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,6 +679,12 @@ namespace VeraCrypt
|
||||
args.push_back ("allow_other");
|
||||
}
|
||||
|
||||
#if defined(TC_LINUX) && !defined(VC_FUSE3)
|
||||
// FUSE2 has no fuse_config init hook; pass the mount option instead.
|
||||
args.push_back ("-o");
|
||||
args.push_back ("use_ino");
|
||||
#endif
|
||||
|
||||
ExecFunctor execFunctor (openVolume, slotNumber);
|
||||
Process::Execute ("fuse", args, -1, &execFunctor);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user