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
diff --git a/CommandListener.cpp b/CommandListener.cpp
index dff4625..461103e 100644
--- a/CommandListener.cpp
+++ b/CommandListener.cpp
@@ -447,7 +447,7 @@
dumpArgs(argc, argv, 3);
if (argc != 5) {
cli->sendMsg(ResponseCode::CommandSyntaxError,
- "Usage: obb mount <filename> <key> <ownerUid>", false);
+ "Usage: obb mount <filename> <key> <ownerGid>", 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 @@
/**
* Mounts an image file <code>img</code>.
*/
-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 @@
}
}
- 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) {