Merge "Remove special case handling of "ro." properties permissions" am: b45f8179be
am: 44e06f5f00
* commit '44e06f5f00c3e0412c85ee5f515ccd0f83abbbc2':
Remove special case handling of "ro." properties permissions
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 806608e..5c1ae79 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -113,18 +113,6 @@
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 @@
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",