diff options
Diffstat (limited to 'cryptfs.c')
-rw-r--r-- | cryptfs.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1214,6 +1214,13 @@ int cryptfs_enable(char *howarg, char *passwd) property_set("vold.decrypt", "trigger_shutdown_framework"); SLOGD("Just asked init to shut down class main\n"); + if (vold_unmountAllAsecs()) { + /* Just report the error. If any are left mounted, + * umounting /data below will fail and handle the error. + */ + SLOGE("Error unmounting internal asecs"); + } + property_get("ro.crypto.fuse_sdcard", fuse_sdcard, ""); if (!strcmp(fuse_sdcard, "true")) { /* This is a device using the fuse layer to emulate the sdcard semantics @@ -1363,7 +1370,7 @@ int cryptfs_enable(char *howarg, char *passwd) /* wipe data if encryption failed */ SLOGE("encryption failed - rebooting into recovery to wipe data\n"); mkdir("/cache/recovery", 0700); - int fd = open("/cache/recovery/command", O_RDWR|O_CREAT|O_TRUNC); + int fd = open("/cache/recovery/command", O_RDWR|O_CREAT|O_TRUNC, 0600); if (fd >= 0) { write(fd, "--wipe_data", strlen("--wipe_data") + 1); close(fd); |