summaryrefslogtreecommitdiff
path: root/init/action_parser.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2018-10-26 08:40:55 -0700
committerTom Cherry <tomcherry@google.com>2018-10-26 08:50:45 -0700
commitfa79ae87f12d2709482375f56a1c13737a8513f3 (patch)
treec7f2ad9ea7d4d4024f9f7dd9e7be782e920cd236 /init/action_parser.cpp
parentdd85c74655400347aee5f6bfecd827a311f16ca4 (diff)
init: allow vendor init to action on any vendor or odm property
Partial revert of "init: if vendor_init can read a property, let it be a trigger too" (b35f827c97ceb24e33fb2514ff62c8636bc46f59). We made a mistake when we allowed vendor init to action on any vendor or odm property, since when a new SELinux label is created for a vendor property, vendor_init does not automatically get read permissions for it. Recently, we tried to use read permissions instead of the built-in list in init, but that broke due to the above mistaken. Since we have already launched with these permissions as is, we must restore them. Bug: 118457755 Test: no denials for vendor init actionable properties on crosshatch Change-Id: I7a9a560c9a54a177c6b83d28309e2f288f05d400
Diffstat (limited to 'init/action_parser.cpp')
-rw-r--r--init/action_parser.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/init/action_parser.cpp b/init/action_parser.cpp
index 2d497b386..4f8bd166a 100644
--- a/init/action_parser.cpp
+++ b/init/action_parser.cpp
@@ -40,6 +40,18 @@ bool IsActionableProperty(Subcontext* subcontext, const std::string& prop_name)
return true;
}
+ static constexpr const char* kPartnerPrefixes[] = {
+ "init.svc.vendor.", "ro.vendor.", "persist.vendor.",
+ "vendor.", "init.svc.odm.", "ro.odm.",
+ "persist.odm.", "odm.", "ro.boot.",
+ };
+
+ for (const auto& prefix : kPartnerPrefixes) {
+ if (android::base::StartsWith(prop_name, prefix)) {
+ return true;
+ }
+ }
+
return CanReadProperty(subcontext->context(), prop_name);
}