summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/system_properties/contexts_split.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/libc/system_properties/contexts_split.cpp b/libc/system_properties/contexts_split.cpp
index b8afa29fc..92baedd38 100644
--- a/libc/system_properties/contexts_split.cpp
+++ b/libc/system_properties/contexts_split.cpp
@@ -274,12 +274,22 @@ bool ContextsSplit::InitializeProperties() {
// Don't check for failure here, so we always have a sane list of properties.
// E.g. In case of recovery, the vendor partition will not have mounted and we
// still need the system / platform properties to function.
- InitializePropertiesFromFile("/vendor/etc/selinux/nonplat_property_contexts");
+ if (access("/vendor/etc/selinux/vendor_property_contexts", R_OK) != -1) {
+ InitializePropertiesFromFile("/vendor/etc/selinux/vendor_property_contexts");
+ } else {
+ // Fallback to nonplat_* if vendor_* doesn't exist.
+ InitializePropertiesFromFile("/vendor/etc/selinux/nonplat_property_contexts");
+ }
} else {
if (!InitializePropertiesFromFile("/plat_property_contexts")) {
return false;
}
- InitializePropertiesFromFile("/nonplat_property_contexts");
+ if (access("/vendor_property_contexts", R_OK) != -1) {
+ InitializePropertiesFromFile("/vendor_property_contexts");
+ } else {
+ // Fallback to nonplat_* if vendor_* doesn't exist.
+ InitializePropertiesFromFile("/nonplat_property_contexts");
+ }
}
return true;