From 52c2ccb6d25b94b96685efd4803226727710fbae Mon Sep 17 00:00:00 2001 From: San Mehat Date: Tue, 23 Feb 2010 18:26:13 -0800 Subject: [PATCH] vold: Make asec sdcard dir a hidden dir Signed-off-by: San Mehat --- Volume.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Volume.cpp b/Volume.cpp index cd91a9f..83c1c0e 100644 --- a/Volume.cpp +++ b/Volume.cpp @@ -61,7 +61,7 @@ const char *Volume::SEC_STGDIR = "/mnt/secure/staging"; * asec imagefiles. This path will be obscured before the mount is * exposed to non priviledged users. */ -const char *Volume::SEC_STG_SECIMGDIR = "/mnt/secure/staging/android_secure"; +const char *Volume::SEC_STG_SECIMGDIR = "/mnt/secure/staging/.android_secure"; /* * Path to where *only* root can access asec imagefiles @@ -328,6 +328,16 @@ int Volume::mountVol() { int Volume::createBindMounts() { unsigned long flags; + /* + * Rename old /android_secure -> /.android_secure + */ + if (!access("/mnt/secure/staging/android_secure", R_OK | X_OK) && + access(SEC_STG_SECIMGDIR, R_OK | X_OK)) { + if (rename("/mnt/secure/staging/android_secure", SEC_STG_SECIMGDIR)) { + LOGE("Failed to rename legacy asec dir (%s)", strerror(errno)); + } + } + /* * Ensure that /android_secure exists and is a directory */