VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
-0/+0
AgeCommit message (Collapse)AuthorFilesLines
2014-11-08Set correctly the minimum required version in volumes header (this value ↵Mounir IDRASSI1-2/+2
must always follow the current program version). This solves also the hidden volume issue.
2014-11-08Increment VeraCrypt version to 1.0bVeraCrypt_1.0bMounir IDRASSI6-20/+20
2014-11-08restore TrueCrypt reference in license headerMounir IDRASSI1-1/+1
2014-11-08Only position legacy flag if the first release of VeraCrypt is detectedMounir IDRASSI1-1/+1
2014-11-08Update RIPEMD160 implementation in Windows Bootloaded to benefit from the ↵Mounir IDRASSI2-4/+3
compiler 32-bit integer
2014-11-08Update Readme file to remove TrueCrypt references and to describe VeraCrypt ↵Mounir IDRASSI1-24/+35
specific signing and packaging batch file.
2014-11-08remove tutorial prompt from installation wizardVeraCrypt_1.0aMounir IDRASSI1-2/+2
2014-11-08Reduce excessive iterations count while on the same time keep very high securityMounir IDRASSI1-4/+4
2014-11-08Concert bitmaps to supported formatMounir IDRASSI12-0/+0
2014-11-08Modify all graphicsMounir IDRASSI10-0/+0
2014-11-08Rename wizard bitmap fileMounir IDRASSI1-0/+0
2014-11-08Rename bitmap and icon file to remove TrueCrypt referenceMounir IDRASSI6-0/+0
2014-11-08Add original TrueCrypt 7.1a sourcesMounir IDRASSI252-0/+96916
namespace VeraCrypt { void FilesystemPath::Delete () const { throw_sys_sub_if (remove (string (*this).c_str()) == -1, Path); } UserId FilesystemPath::GetOwner () const { struct stat statData; throw_sys_if (stat (StringConverter::ToSingle (Path).c_str(), &statData) == -1); UserId owner; owner.SystemId = statData.st_uid; return owner; } FilesystemPathType::Enum FilesystemPath::GetType () const { // Strip trailing directory separator wstring path = Path; size_t pos = path.find_last_not_of (L'/'); if (path.size() > 2 && pos != path.size() - 1) path = path.substr (0, pos + 1); struct stat statData; throw_sys_sub_if (stat (StringConverter::ToSingle (path).c_str(), &statData) != 0, Path); if (S_ISREG (statData.st_mode)) return FilesystemPathType::File; if (S_ISDIR (statData.st_mode)) return FilesystemPathType::Directory; if (S_ISCHR (statData.st_mode)) return FilesystemPathType::CharacterDevice; if (S_ISBLK (statData.st_mode)) return FilesystemPathType::BlockDevice; if (S_ISLNK (statData.st_mode)) return FilesystemPathType::SymbolickLink; return FilesystemPathType::Unknown; } FilesystemPath FilesystemPath::ToBaseName () const { wstring path = Path; size_t pos = path.find_last_of (L'/'); if (pos == string::npos) return Path; return Path.substr (pos + 1); } FilesystemPath FilesystemPath::ToHostDriveOfPartition () const { DevicePath path; #ifdef TC_LINUX path = StringConverter::StripTrailingNumber (StringConverter::ToSingle (Path)); // If simply removing trailing number didn't produce a valid drive name, try to use sysfs to get the right one if (!path.IsDevice()) { struct stat st; if(stat (StringConverter::ToSingle (Path).c_str (), &st) == 0) { const long maxPathLength = pathconf ("/", _PC_PATH_MAX); if(maxPathLength != -1) { string linkPathName ("/sys/dev/block/"); linkPathName += StringConverter::ToSingle (major (st.st_rdev)) + string (":") + StringConverter::ToSingle (minor (st.st_rdev)); vector<char> linkTargetPath(maxPathLength+1); if(readlink(linkPathName.c_str (), linkTargetPath.data(), linkTargetPath.size()) != -1) { const string targetPathStr (linkTargetPath.data()); const size_t lastSlashPos = targetPathStr.find_last_of ('/'); const size_t secondLastSlashPos = targetPathStr.find_last_of ('/', lastSlashPos-1); path = string ("/dev/") + targetPathStr.substr (secondLastSlashPos+1, lastSlashPos-secondLastSlashPos-1); } } } } #elif defined (TC_MACOSX) string pathStr = StringConverter::StripTrailingNumber (StringConverter::ToSingle (Path)); path = pathStr.substr (0, pathStr.size() - 1); #elif defined (TC_FREEBSD) string pathStr = StringConverter::ToSingle (Path); size_t p = pathStr.rfind ("s"); 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) path = StringConverter::StripTrailingNumber (StringConverter::ToSingle (Path)) + "0"; #else throw NotImplemented (SRC_POS); #endif if (!path.IsDevice()) throw PartitionDeviceRequired (SRC_POS); return path; } }