diff options
author | Bowgo Tsai <bowgotsai@google.com> | 2018-02-01 23:03:49 +0800 |
---|---|---|
committer | Bowgo Tsai <bowgotsai@google.com> | 2018-02-01 23:32:24 +0800 |
commit | a9fc82fefe07307f3af2e18014dbc6bc3925504f (patch) | |
tree | 914faa845ce5620c7918314b50d2acb1d37bd31e /libc/system_properties/contexts_split.cpp | |
parent | b44bd827abf2b870ebf4a0f6b126098a46bf42ec (diff) |
Renames nonplat_property_contexts to vendor_property_contexts
Bug: 64240127
Test: build
Change-Id: Ifff956fa1a0557d7d10e1012b29d16f25bb80e8f
Diffstat (limited to 'libc/system_properties/contexts_split.cpp')
-rw-r--r-- | libc/system_properties/contexts_split.cpp | 14 |
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; |