diff options
Diffstat (limited to 'init/property_service.c')
| -rwxr-xr-x | init/property_service.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/init/property_service.c b/init/property_service.c index 86e35f1..88348bd 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> @@ -123,7 +124,7 @@ static int init_workspace(workspace *w, size_t size) /* dev is a tmpfs that we can use to carve a shared workspace * out of, so let's do that... */ - fd = open("/dev/__properties__", O_RDWR | O_CREAT | O_NOFOLLOW, 0600); + fd = open(PROP_FILENAME, O_RDWR | O_CREAT | O_NOFOLLOW, 0644); if (fd < 0) return -1; @@ -136,12 +137,10 @@ static int init_workspace(workspace *w, size_t size) close(fd); - fd = open("/dev/__properties__", O_RDONLY | O_NOFOLLOW); + fd = open(PROP_FILENAME, O_RDONLY | O_NOFOLLOW); if (fd < 0) return -1; - unlink("/dev/__properties__"); - w->data = data; w->size = size; w->fd = fd; @@ -245,12 +244,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) { |
