OSDN Git Service

Remove /sdcard hack for shell users.
authorJeff Sharkey <jsharkey@android.com>
Wed, 5 Sep 2012 22:49:39 +0000 (15:49 -0700)
committerJeff Sharkey <jsharkey@android.com>
Thu, 6 Sep 2012 00:56:03 +0000 (17:56 -0700)
Using a /storage/sdcard0 symlink and a tmpfs staging area was used
to enable "/sdcard" paths for both zygote processes and the shell
user, but it breaks on devices with both emulated and physical
external storage.

Specifically, vold can't mount a physical sdcard onto the primary
storage symlink, and zygote can't re-bind-mount when secondary
storage is remounted after dropping privileges.

Bug: 70948587064600
Change-Id: Id91e3b3e521a3b3e1bb5358920adc66a0a43917f

vm/native/dalvik_system_Zygote.cpp

index 53b4b4c..a987e04 100644 (file)
@@ -275,23 +275,6 @@ static int mountExternalStorage(uid_t uid, u4 mountExternal) {
             return -1;
         }
 
-        // Give ourselves a tmpfs staging platform to work with, which obscures
-        // any existing shell-specific contents.  Create our mount target, then
-        // remount read-only.
-        if (mount("tmpfs", storage_base, "tmpfs", MS_NOSUID | MS_NODEV,
-                "uid=0,gid=1028,mode=0050") == -1) {
-            SLOGE("Failed to mount tmpfs to %s: %s", storage_base, strerror(errno));
-            return -1;
-        }
-        if (fs_prepare_dir(target, 0000, 0, 0) == -1) {
-            return -1;
-        }
-        if (mount("tmpfs", storage_base, NULL,
-                MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NODEV, NULL)) {
-            SLOGE("Failed to remount ro %s: %s", storage_base, strerror(errno));
-            return -1;
-        }
-
         if (mountExternal == MOUNT_EXTERNAL_MULTIUSER_ALL) {
             // External storage for all users
             if (mount(source_base, target, NULL, MS_BIND, NULL) == -1) {