mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Make system devices work under FreeBSD (#777)
We query the kern.geom.conftxt sysctl for the GEOM configuration to find the partition offset. Technically speaking it would probably be better to link against libgeom but this is less overall intrusive. Also includes a small fix to find the parent device of an encrypted partition when it is a GPT partition rather than a BSD slice.
This commit is contained in:
@@ -107,8 +107,11 @@ namespace VeraCrypt
|
||||
|
||||
string pathStr = StringConverter::ToSingle (Path);
|
||||
size_t p = pathStr.rfind ("s");
|
||||
if (p == string::npos)
|
||||
throw PartitionDeviceRequired (SRC_POS);
|
||||
if (p == string::npos) {
|
||||
p = pathStr.rfind ("p");
|
||||
if (p == string::npos)
|
||||
throw PartitionDeviceRequired (SRC_POS);
|
||||
}
|
||||
path = pathStr.substr (0, p);
|
||||
|
||||
#elif defined (TC_SOLARIS)
|
||||
|
||||
Reference in New Issue
Block a user