diff options
author | Matthew Xie <mattx@google.com> | 2013-05-22 10:38:44 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-05-22 10:38:44 -0700 |
commit | 5cb9a02b0322c18b48eb9ce261502c3b830c113c (patch) | |
tree | 6a4bb7fcd9b15e2ace4b2bc4cbb1f258bdb29aa6 /init | |
parent | a9e08d3ed60a12f58fc5fdf89f74b4f215ce066f (diff) | |
parent | 7e72349865db83d62f98eec8bca4b170712fe0e0 (diff) | |
download | system_core-5cb9a02b0322c18b48eb9ce261502c3b830c113c.zip system_core-5cb9a02b0322c18b48eb9ce261502c3b830c113c.tar.gz system_core-5cb9a02b0322c18b48eb9ce261502c3b830c113c.tar.bz2 |
am 7e723498: Merge "Add permission for bluetooth app in non-primary users" into jb-mr2-dev
* commit '7e72349865db83d62f98eec8bca4b170712fe0e0':
Add permission for bluetooth app in non-primary users
Diffstat (limited to 'init')
-rwxr-xr-x | init/property_service.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/init/property_service.c b/init/property_service.c index c1be2e0..d7740c3 100755 --- a/init/property_service.c +++ b/init/property_service.c @@ -27,6 +27,7 @@ #include <cutils/misc.h> #include <cutils/sockets.h> +#include <cutils/multiuser.h> #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ #include <sys/_system_properties.h> @@ -270,12 +271,19 @@ static int check_control_perms(const char *name, unsigned int uid, unsigned int static int check_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx) { int i; + unsigned int app_id; + if(!strncmp(name, "ro.", 3)) name +=3; if (uid == 0) return check_mac_perms(name, sctx); + app_id = multiuser_get_app_id(uid); + if (app_id == AID_BLUETOOTH) { + uid = app_id; + } + for (i = 0; property_perms[i].prefix; i++) { if (strncmp(property_perms[i].prefix, name, strlen(property_perms[i].prefix)) == 0) { |