am f4cd1c6b
: DO NOT MERGE Mount secondary external storage writable by AID_MEDIA_RW rather than AID_SDCARD_RW
* commit 'f4cd1c6b1912d2481334152f7dec50067960a90c': DO NOT MERGE Mount secondary external storage writable by AID_MEDIA_RW rather than AID_SDCARD_RW
This commit is contained in:
commit
7877388b6c
1 changed files with 13 additions and 1 deletions
14
Volume.cpp
14
Volume.cpp
|
@ -33,6 +33,8 @@
|
||||||
|
|
||||||
#include <diskconfig/diskconfig.h>
|
#include <diskconfig/diskconfig.h>
|
||||||
|
|
||||||
|
#include <private/android_filesystem_config.h>
|
||||||
|
|
||||||
#define LOG_TAG "Vold"
|
#define LOG_TAG "Vold"
|
||||||
|
|
||||||
#include <cutils/log.h>
|
#include <cutils/log.h>
|
||||||
|
@ -336,8 +338,18 @@ int Volume::mountVol() {
|
||||||
* muck with it before exposing it to non priviledged users.
|
* muck with it before exposing it to non priviledged users.
|
||||||
*/
|
*/
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
int gid;
|
||||||
|
|
||||||
|
if (!strcmp(getMountpoint(), "/mnt/sdcard")) {
|
||||||
|
// Special case the primary SD card.
|
||||||
|
// For this we grant write access to the SDCARD_RW group.
|
||||||
|
gid = AID_SDCARD_RW;
|
||||||
|
} else {
|
||||||
|
// For secondary external storage we keep things locked up.
|
||||||
|
gid = AID_MEDIA_RW;
|
||||||
|
}
|
||||||
if (Fat::doMount(devicePath, "/mnt/secure/staging", false, false, false,
|
if (Fat::doMount(devicePath, "/mnt/secure/staging", false, false, false,
|
||||||
1000, 1015, 0702, true)) {
|
AID_SYSTEM, gid, 0702, true)) {
|
||||||
SLOGE("%s failed to mount via VFAT (%s)\n", devicePath, strerror(errno));
|
SLOGE("%s failed to mount via VFAT (%s)\n", devicePath, strerror(errno));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue