summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stucki <mundaun@gmx.ch>2015-02-13 14:10:47 +0100
committerSteve Kondik <steve@cyngn.com>2015-03-22 03:35:01 -0700
commitab1172cb3127d992339bb81f56f18ba1c084b068 (patch)
tree42f562183b7d3cbaa25f57b277377ffb92e8a8c0
parenta4edb44146d7bc7025f250dcb282d547f2ad613f (diff)
downloadandroid_system_vold-ab1172cb3127d992339bb81f56f18ba1c084b068.tar.gz
android_system_vold-ab1172cb3127d992339bb81f56f18ba1c084b068.tar.bz2
android_system_vold-ab1172cb3127d992339bb81f56f18ba1c084b068.zip
Fix Ext4 sdcard permissions on mount
Fix ownership of sdcards the same way as for F2FS. Change-Id: Ia34ad91444951e62f6d17374f480dcbdfa34cca3
-rw-r--r--Ext4.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Ext4.cpp b/Ext4.cpp
index 0c6c32e..dd8fe98 100644
--- a/Ext4.cpp
+++ b/Ext4.cpp
@@ -73,6 +73,12 @@ int Ext4::doMount(const char *fsPath, const char *mountPoint, bool ro, bool remo
rc = mount(fsPath, mountPoint, "ext4", flags, data);
+ if (sdcard && rc == 0) {
+ // Write access workaround
+ chown(mountPoint, AID_MEDIA_RW, AID_MEDIA_RW);
+ chmod(mountPoint, 0755);
+ }
+
if (rc && errno == EROFS) {
SLOGE("%s appears to be a read only filesystem - retrying mount RO", fsPath);
flags |= MS_RDONLY;