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

OpenBSD: add FFS volume formatting support

Expose FFS as the native OpenBSD filesystem option for volume creation and accept FFS/UFS on the command line, mapping mounts to the OpenBSD ffs filesystem type.

Run newfs through the elevated core service on vnd raw devices, then temporarily mount the new filesystem to transfer root directory ownership back to the invoking user.

Keep the non-interactive creation default as FAT on OpenBSD so existing unattended scripts do not start requiring elevation.
This commit is contained in:
Mounir IDRASSI
2026-07-05 07:55:39 +09:00
parent ede12bf81c
commit 48f8d87418
13 changed files with 471 additions and 25 deletions
+29
View File
@@ -245,6 +245,32 @@ namespace VeraCrypt
}
#endif
#ifdef TC_OPENBSD
// ExecuteOpenBSDFFSFormatterRequest
void ExecuteOpenBSDFFSFormatterRequest::Deserialize (shared_ptr <Stream> stream)
{
CoreServiceRequest::Deserialize (stream);
Serializer sr (stream);
Device = sr.DeserializeWString ("Device");
sr.Deserialize ("OwnerGroupId", OwnerGroupId);
sr.Deserialize ("OwnerUserId", OwnerUserId);
}
bool ExecuteOpenBSDFFSFormatterRequest::RequiresElevation () const
{
return !Core->HasAdminPrivileges();
}
void ExecuteOpenBSDFFSFormatterRequest::Serialize (shared_ptr <Stream> stream) const
{
CoreServiceRequest::Serialize (stream);
Serializer sr (stream);
sr.Serialize ("Device", wstring (Device));
sr.Serialize ("OwnerGroupId", OwnerGroupId);
sr.Serialize ("OwnerUserId", OwnerUserId);
}
#endif
// MountVolumeRequest
void MountVolumeRequest::Deserialize (shared_ptr <Stream> stream)
{
@@ -322,6 +348,9 @@ namespace VeraCrypt
TC_SERIALIZER_FACTORY_ADD_CLASS (ExitRequest);
#ifdef TC_MACOSX
TC_SERIALIZER_FACTORY_ADD_CLASS (ExecuteMacOSXAPFSFormatterRequest);
#endif
#ifdef TC_OPENBSD
TC_SERIALIZER_FACTORY_ADD_CLASS (ExecuteOpenBSDFFSFormatterRequest);
#endif
TC_SERIALIZER_FACTORY_ADD_CLASS (GetDeviceSectorSizeRequest);
TC_SERIALIZER_FACTORY_ADD_CLASS (GetDeviceSizeRequest);