diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-02-01 23:22:07 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-02-01 23:22:07 +0000 |
commit | 12d96ed7f59d1e463df581ad6ec7ccfc87d9ef5d (patch) | |
tree | 914faa845ce5620c7918314b50d2acb1d37bd31e /libc/system_properties/contexts_split.cpp | |
parent | b44bd827abf2b870ebf4a0f6b126098a46bf42ec (diff) | |
parent | a9fc82fefe07307f3af2e18014dbc6bc3925504f (diff) |
Merge "Renames nonplat_property_contexts to vendor_property_contexts"
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; |