summaryrefslogtreecommitdiff
path: root/sdcard
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2014-05-30 23:48:00 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-30 23:48:00 +0000
commit40f321ab4965e38f0a50955f816a0de718deec99 (patch)
tree39ffdf8d44519069b120b62add42ef4feccdda78 /sdcard
parent70b53c4057094f48167b3d00954d7917e16cd5cf (diff)
parent2e7d80d10acf95076dfb1f2727455432091de65f (diff)
am 2e7d80d1: Per-app media directories on external storage.
* commit '2e7d80d10acf95076dfb1f2727455432091de65f': Per-app media directories on external storage.
Diffstat (limited to 'sdcard')
-rw-r--r--sdcard/sdcard.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sdcard/sdcard.c b/sdcard/sdcard.c
index 7baad6395..3a164ed62 100644
--- a/sdcard/sdcard.c
+++ b/sdcard/sdcard.c
@@ -139,6 +139,8 @@ typedef enum {
PERM_ANDROID_DATA,
/* This node is "/Android/obb" */
PERM_ANDROID_OBB,
+ /* This node is "/Android/media" */
+ PERM_ANDROID_MEDIA,
/* This node is "/Android/user" */
PERM_ANDROID_USER,
} perm_t;
@@ -475,6 +477,10 @@ static void derive_permissions_locked(struct fuse* fuse, struct node *parent,
/* Single OBB directory is always shared */
node->graft_path = fuse->obbpath;
node->graft_pathlen = strlen(fuse->obbpath);
+ } else if (!strcasecmp(node->name, "media")) {
+ /* App-specific directories inside; let anyone traverse */
+ node->perm = PERM_ANDROID_MEDIA;
+ node->mode = 0771;
} else if (!strcasecmp(node->name, "user")) {
/* User directories must only be accessible to system, protected
* by sdcard_all. Zygote will bind mount the appropriate user-
@@ -486,6 +492,7 @@ static void derive_permissions_locked(struct fuse* fuse, struct node *parent,
break;
case PERM_ANDROID_DATA:
case PERM_ANDROID_OBB:
+ case PERM_ANDROID_MEDIA:
appid = (appid_t) (uintptr_t) hashmapGet(fuse->package_to_appid, node->name);
if (appid != 0) {
node->uid = multiuser_get_uid(parent->userid, appid);