diff options
author | Jeff Sharkey | 2017-04-17 15:45:16 -0500 |
---|---|---|
committer | Jeff Sharkey | 2017-04-17 15:59:51 -0500 |
commit | bd2ecd8e6dbcc03c7664a3f07d3297509fc0b162 (patch) | |
tree | f91fc1d0e607f419e192f263b2e78801efacd485 /libcutils/multiuser.c | |
parent | 29ab67b0c142d7ceeccc73d532206ff54b4631bc (diff) | |
download | platform-system-core-bd2ecd8e6dbcc03c7664a3f07d3297509fc0b162.tar.gz platform-system-core-bd2ecd8e6dbcc03c7664a3f07d3297509fc0b162.tar.xz platform-system-core-bd2ecd8e6dbcc03c7664a3f07d3297509fc0b162.zip |
Allocate a GID range for external cache files.
We can't reuse the GID range for internal cache files, otherwise
we don't have a way to tease apart the difference when deciding if
it's safe to move apps.
Test: builds, boots
Bug: 37193650
Change-Id: I22c4e575cd557636e74c5c73035adb1d4dcbb7f7
Diffstat (limited to 'libcutils/multiuser.c')
-rw-r--r-- | libcutils/multiuser.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libcutils/multiuser.c b/libcutils/multiuser.c index 08d4d6c2e..61403f4f1 100644 --- a/libcutils/multiuser.c +++ b/libcutils/multiuser.c | |||
@@ -45,6 +45,14 @@ gid_t multiuser_get_ext_gid(userid_t user_id, appid_t app_id) { | |||
45 | } | 45 | } |
46 | } | 46 | } |
47 | 47 | ||
48 | gid_t multiuser_get_ext_cache_gid(userid_t user_id, appid_t app_id) { | ||
49 | if (app_id >= AID_APP_START && app_id <= AID_APP_END) { | ||
50 | return multiuser_get_uid(user_id, (app_id - AID_APP_START) + AID_EXT_CACHE_GID_START); | ||
51 | } else { | ||
52 | return -1; | ||
53 | } | ||
54 | } | ||
55 | |||
48 | gid_t multiuser_get_shared_gid(userid_t user_id, appid_t app_id) { | 56 | gid_t multiuser_get_shared_gid(userid_t user_id, appid_t app_id) { |
49 | if (app_id >= AID_APP_START && app_id <= AID_APP_END) { | 57 | if (app_id >= AID_APP_START && app_id <= AID_APP_END) { |
50 | return multiuser_get_uid(user_id, (app_id - AID_APP_START) + AID_SHARED_GID_START); | 58 | return multiuser_get_uid(user_id, (app_id - AID_APP_START) + AID_SHARED_GID_START); |