summaryrefslogtreecommitdiffstats
path: root/partition.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-01-10 16:43:00 +0100
committerDees_Troy <dees_troy@teamw.in>2013-01-10 16:43:00 +0100
commitc8bafa1cc16f32014a819c3614d222066f7e7555 (patch)
tree4aba1faa6e6acce3ac8763c9c753129367c95e42 /partition.cpp
parentIncrease char array sizes to allow for null char for strcpy (diff)
downloadandroid_bootable_recovery-c8bafa1cc16f32014a819c3614d222066f7e7555.tar
android_bootable_recovery-c8bafa1cc16f32014a819c3614d222066f7e7555.tar.gz
android_bootable_recovery-c8bafa1cc16f32014a819c3614d222066f7e7555.tar.bz2
android_bootable_recovery-c8bafa1cc16f32014a819c3614d222066f7e7555.tar.lz
android_bootable_recovery-c8bafa1cc16f32014a819c3614d222066f7e7555.tar.xz
android_bootable_recovery-c8bafa1cc16f32014a819c3614d222066f7e7555.tar.zst
android_bootable_recovery-c8bafa1cc16f32014a819c3614d222066f7e7555.zip
Diffstat (limited to 'partition.cpp')
-rw-r--r--partition.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/partition.cpp b/partition.cpp
index 44b00ab4c..f2386d7a8 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -705,7 +705,7 @@ bool TWPartition::Mount(bool Display_Error) {
return false;
} else {
#ifdef TW_INCLUDE_CRYPTO_SAMSUNG
- if (EcryptFS_Password.size() > 0) {
+ if (EcryptFS_Password.size() > 0 && PartitionManager.Mount_By_Path("/data", false)) {
if (mount_ecryptfs_drive(EcryptFS_Password.c_str(), Mount_Point.c_str(), Mount_Point.c_str(), 0) != 0) {
if (Display_Error)
LOGE("Unable to mount ecryptfs for '%s'\n", Mount_Point.c_str());
@@ -735,6 +735,19 @@ bool TWPartition::UnMount(bool Display_Error) {
if (never_unmount_system == 1 && Mount_Point == "/system")
return true; // Never unmount system if you're not supposed to unmount it
+#ifdef TW_INCLUDE_CRYPTO_SAMSUNG
+ if (EcryptFS_Password.size() > 0) {
+ if (unmount_ecryptfs_drive(Mount_Point.c_str()) != 0) {
+ if (Display_Error)
+ LOGE("Unable to unmount ecryptfs for '%s'\n", Mount_Point.c_str());
+ else
+ LOGI("Unable to unmount ecryptfs for '%s'\n", Mount_Point.c_str());
+ } else {
+ LOGI("Successfully unmounted ecryptfs for '%s'\n", Mount_Point.c_str());
+ }
+ }
+#endif
+
if (!Symlink_Mount_Point.empty())
umount(Symlink_Mount_Point.c_str());