diff options
author | Sandeep Patil <sspatil@google.com> | 2017-05-17 11:33:37 -0700 |
---|---|---|
committer | Sandeep Patil <sspatil@google.com> | 2017-05-17 16:26:59 -0700 |
commit | 03ed4afec45c1c6ddaf6d3dc0abc31f3e9adc165 (patch) | |
tree | e73c7a912f49c1faf1685d49213ed4ce87cb8d08 | |
parent | bb67386c850c00e4c9081c61fa88e7554e3e779f (diff) | |
download | bionic-03ed4afec45c1c6ddaf6d3dc0abc31f3e9adc165.tar.gz |
properties: do not fail in the absence of vendor properties
/vendor is not mounted in recovery and so the property initialization
must not fail if the vendor property context is not found.
Bug: 38212419
Test: boot into recovery, mount system and run adb shell getprop
Change-Id: I9f7c2fe2b20da86194eff8e7bf94b2352e50bf27
Signed-off-by: Sandeep Patil <sspatil@google.com>
-rw-r--r-- | libc/bionic/system_properties.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libc/bionic/system_properties.cpp b/libc/bionic/system_properties.cpp index 09106ade8..68f45010d 100644 --- a/libc/bionic/system_properties.cpp +++ b/libc/bionic/system_properties.cpp @@ -1047,16 +1047,15 @@ static bool initialize_properties() { if (!initialize_properties_from_file("/system/etc/selinux/plat_property_contexts")) { return false; } - if (!initialize_properties_from_file("/vendor/etc/selinux/nonplat_property_contexts")) { - return false; - } + // 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. + initialize_properties_from_file("/vendor/etc/selinux/nonplat_property_contexts"); } else { if (!initialize_properties_from_file("/plat_property_contexts")) { return false; } - if (!initialize_properties_from_file("/nonplat_property_contexts")) { - return false; - } + initialize_properties_from_file("/nonplat_property_contexts"); } return true; |