sdcardfs: fix external storage exporting incorrect uid
authoralvin_liang <alvin_liang@htc.com>
Sun, 14 May 2017 12:30:30 +0000 (12:30 +0000)
committerStricted <info@stricted.net>
Thu, 11 Oct 2018 16:03:18 +0000 (18:03 +0200)
Symptom: App cannot write into per-app folder
Root Cause: sdcardfs exports incorrect uid
Solution: fix uid
Project: All
Note:
Test done by RD: passed

fs/sdcardfs/main.c

index db681fb2411e9d8a74c047199a8bca24d873c639..3666aef3e0f0e14b2be0166f27897bbbcb35c94f 100644 (file)
@@ -272,9 +272,9 @@ static int sdcardfs_read_super(struct super_block *sb, const char *dev_name,
                snprintf(sb_info->obbpath_s, PATH_MAX, "%s/obb", dev_name);
                /*err =  prepare_dir(sb_info->obbpath_s,
                                        sb_info->options.fs_low_uid,
-                                       sb_info->options.fs_low_gid, 00664);*/
+                                       sb_info->options.fs_low_gid, 00755);*/
        } else {
-               setup_derived_state(sb->s_root->d_inode, PERM_ROOT, sb_info->options.fs_low_uid, AID_ROOT, false, sb->s_root->d_inode);
+               setup_derived_state(sb->s_root->d_inode, PERM_ROOT, sb_info->options.fs_user_id, AID_ROOT, false, sb->s_root->d_inode);
                snprintf(sb_info->obbpath_s, PATH_MAX, "%s/Android/obb", dev_name);
        }
        fix_derived_permission(sb->s_root->d_inode);