From 6947904a76b69a1db20a3ddd30c0bcd281922fde Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Tue, 25 Sep 2012 16:14:57 -0700 Subject: Handle multi-user mountObb() requests. Mount OBB containers using shared app GID, so that an app can read the mount point across users. Bug: 7212801 Change-Id: Ia1be52df9854c259b20728111f3a2c9facf4beaa --- CommandListener.cpp | 2 +- VolumeManager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CommandListener.cpp b/CommandListener.cpp index dff4625..461103e 100644 --- a/CommandListener.cpp +++ b/CommandListener.cpp @@ -447,7 +447,7 @@ int CommandListener::ObbCmd::runCommand(SocketClient *cli, dumpArgs(argc, argv, 3); if (argc != 5) { cli->sendMsg(ResponseCode::CommandSyntaxError, - "Usage: obb mount ", false); + "Usage: obb mount ", false); return 0; } rc = vm->mountObb(argv[2], argv[3], atoi(argv[4])); diff --git a/VolumeManager.cpp b/VolumeManager.cpp index 0388010..ca5ec84 100644 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -1001,7 +1001,7 @@ Volume* VolumeManager::getVolumeForFile(const char *fileName) { /** * Mounts an image file img. */ -int VolumeManager::mountObb(const char *img, const char *key, int ownerUid) { +int VolumeManager::mountObb(const char *img, const char *key, int ownerGid) { char mountPoint[255]; char idHash[33]; @@ -1085,7 +1085,7 @@ int VolumeManager::mountObb(const char *img, const char *key, int ownerUid) { } } - if (Fat::doMount(dmDevice, mountPoint, true, false, true, ownerUid, 0, + if (Fat::doMount(dmDevice, mountPoint, true, false, true, 0, ownerGid, 0227, false)) { SLOGE("Image mount failed (%s)", strerror(errno)); if (cleanupDm) { -- cgit v1.1