VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Platform/Unix/FilesystemPath.cpp
diff options
context:
space:
mode:
authorMrLightningBolt <MrLightningBolt@users.noreply.github.com>2021-07-14 04:48:13 -0700
committerGitHub <noreply@github.com>2021-07-14 13:48:13 +0200
commit7c3355a2d1e22c8b03569edeb31111b181316685 (patch)
tree4850b0d928865830be328c3f9214866126706ee3 /src/Platform/Unix/FilesystemPath.cpp
parentc8830a04b4adc3048b76c658fa1084e749f188da (diff)
downloadVeraCrypt-7c3355a2d1e22c8b03569edeb31111b181316685.tar.gz
VeraCrypt-7c3355a2d1e22c8b03569edeb31111b181316685.zip
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.
Diffstat (limited to 'src/Platform/Unix/FilesystemPath.cpp')
-rw-r--r--src/Platform/Unix/FilesystemPath.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Platform/Unix/FilesystemPath.cpp b/src/Platform/Unix/FilesystemPath.cpp
index e6841d0f..1230c2aa 100644
--- a/src/Platform/Unix/FilesystemPath.cpp
+++ b/src/Platform/Unix/FilesystemPath.cpp
@@ -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)