am f7e7ee96: am 2d1e5e96: Merge "Extend the maximum number of partitions from 4 to 32"
* commit 'f7e7ee969d9f286315ff153cb979e29e08cee9f4':
Extend the maximum number of partitions from 4 to 32
diff --git a/cryptfs.c b/cryptfs.c
index e1c177d..b66f1ac 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -1179,11 +1179,14 @@
snprintf(lockid, sizeof(lockid), "enablecrypto%d", (int) getpid());
acquire_wake_lock(PARTIAL_WAKE_LOCK, lockid);
- /* Get the sdcard mount point */
- sd_mnt_point = getenv("EXTERNAL_STORAGE");
- if (! sd_mnt_point) {
- sd_mnt_point = "/mnt/sdcard";
- }
+ /* Get the sdcard mount point */
+ sd_mnt_point = getenv("MULTIUSER_EXTERNAL_STORAGE");
+ if (!sd_mnt_point) {
+ sd_mnt_point = getenv("EXTERNAL_STORAGE");
+ }
+ if (!sd_mnt_point) {
+ sd_mnt_point = "/mnt/sdcard";
+ }
num_vols=vold_getNumDirectVolumes();
vol_list = malloc(sizeof(struct volume_info) * num_vols);
@@ -1365,12 +1368,12 @@
} else {
char value[PROPERTY_VALUE_MAX];
- property_get("ro.vold.wipe_on_cyrypt_fail", value, "0");
+ property_get("ro.vold.wipe_on_crypt_fail", value, "0");
if (!strcmp(value, "1")) {
/* 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);