summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Volume.cpp32
1 files changed, 10 insertions, 22 deletions
diff --git a/Volume.cpp b/Volume.cpp
index a71000e..0be2e81 100644
--- a/Volume.cpp
+++ b/Volume.cpp
@@ -608,41 +608,29 @@ int Volume::unmountVol(bool force, bool revert) {
usleep(1000 * 1000); // Give the framework some time to react
/*
- * First move the mountpoint back to our internal staging point
- * so nobody else can muck with it while we work.
+ * Remove the bindmount we were using to keep a reference to
+ * the previously obscured directory.
*/
- if (doMoveMount(getMountpoint(), SEC_STGDIR, force)) {
- SLOGE("Failed to move mount %s => %s (%s)", getMountpoint(), SEC_STGDIR, strerror(errno));
- setState(Volume::State_Mounted);
- return -1;
+ if (doUnmount(Volume::SEC_ASECDIR_EXT, force)) {
+ SLOGE("Failed to remove bindmount on %s (%s)", SEC_ASECDIR_EXT, strerror(errno));
+ goto fail_remount_tmpfs;
}
- protectFromAutorunStupidity();
-
/*
* Unmount the tmpfs which was obscuring the asec image directory
* from non root users
*/
-
- if (doUnmount(Volume::SEC_STG_SECIMGDIR, force)) {
- SLOGE("Failed to unmount tmpfs on %s (%s)", SEC_STG_SECIMGDIR, strerror(errno));
+ char secure_dir[PATH_MAX];
+ snprintf(secure_dir, PATH_MAX, "%s/.android_secure", getMountpoint());
+ if (doUnmount(secure_dir, force)) {
+ SLOGE("Failed to unmount tmpfs on %s (%s)", secure_dir, strerror(errno));
goto fail_republish;
}
/*
- * Remove the bindmount we were using to keep a reference to
- * the previously obscured directory.
- */
-
- if (doUnmount(Volume::SEC_ASECDIR_EXT, force)) {
- SLOGE("Failed to remove bindmount on %s (%s)", SEC_ASECDIR_EXT, strerror(errno));
- goto fail_remount_tmpfs;
- }
-
- /*
* Finally, unmount the actual block device from the staging dir
*/
- if (doUnmount(Volume::SEC_STGDIR, force)) {
+ if (doUnmount(getMountpoint(), force)) {
SLOGE("Failed to unmount %s (%s)", SEC_STGDIR, strerror(errno));
goto fail_recreate_bindmount;
}