Remove special case handling of "ro." properties permissions

Currently, properties that begin with "ro." are special cased to skip
over the "ro." part of the prefix before matching with entries in
property_contexts.  This is not strictly needed however and it is
causing complications with the separated prop files work from Bug
21852512, so it is now removed.

Bug 26425619

Change-Id: I3cd14fa2176f96b3931e5f6a50c4a7bcd3af3da6
This commit is contained in:
Tom Cherry 2016-01-11 13:04:19 -08:00
parent cd60e4bdd6
commit c787cf291a

View file

@ -113,18 +113,6 @@ static int check_control_mac_perms(const char *name, char *sctx, struct ucred *c
return check_mac_perms(ctl_name, sctx, cr);
}
/*
* Checks permissions for setting system properties.
* Returns 1 if uid allowed, 0 otherwise.
*/
static int check_perms(const char *name, char *sctx, struct ucred *cr)
{
if(!strncmp(name, "ro.", 3))
name +=3;
return check_mac_perms(name, sctx, cr);
}
std::string property_get(const char* name) {
char value[PROP_VALUE_MAX] = {0};
__system_property_get(name, value);
@ -312,7 +300,7 @@ static void handle_property_set_fd()
msg.name + 4, msg.value, cr.uid, cr.gid, cr.pid);
}
} else {
if (check_perms(msg.name, source_ctx, &cr)) {
if (check_mac_perms(msg.name, source_ctx, &cr)) {
property_set((char*) msg.name, (char*) msg.value);
} else {
ERROR("sys_prop: permission denied uid:%d name:%s\n",