aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Vander Stoep2017-06-14 17:30:39 -0500
committerJeffrey Vander Stoep2017-06-15 16:24:29 -0500
commite35926e1aff2e6b9b54656bd59c8178e295a1b7e (patch)
tree22147f867876adb8d6fa57daafffdb3eb82ff8d6 /recovery.cpp
parent539b08cfcf223cea2be6713c5357643d45e6b70d (diff)
downloadplatform-bootable-recovery-e35926e1aff2e6b9b54656bd59c8178e295a1b7e.tar.gz
platform-bootable-recovery-e35926e1aff2e6b9b54656bd59c8178e295a1b7e.tar.xz
platform-bootable-recovery-e35926e1aff2e6b9b54656bd59c8178e295a1b7e.zip
Fix "No file_contexts" warning
Fixed by Loading the file_contexts specified in libselinux, whereas previously recovery loaded /file_contexts which no longer exists. Bug: 62587423 Test: build and flash recovery on Angler. Warning is gone. Test: Wipe data and cache. Test: sideload OTA Change-Id: I11581c878b860ac5f412e6e8e7acde811f37870f (cherry picked from commit 2330dd8733ce0b207058e3003a3b1efebc022394)
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 30edaa57..c1a31b6a 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -54,6 +54,7 @@
54#include <healthd/BatteryMonitor.h> 54#include <healthd/BatteryMonitor.h>
55#include <private/android_logger.h> /* private pmsg functions */ 55#include <private/android_logger.h> /* private pmsg functions */
56#include <private/android_filesystem_config.h> /* for AID_SYSTEM */ 56#include <private/android_filesystem_config.h> /* for AID_SYSTEM */
57#include <selinux/android.h>
57#include <selinux/label.h> 58#include <selinux/label.h>
58#include <selinux/selinux.h> 59#include <selinux/selinux.h>
59#include <ziparchive/zip_archive.h> 60#include <ziparchive/zip_archive.h>
@@ -1481,12 +1482,8 @@ int main(int argc, char **argv) {
1481 ui->SetBackground(RecoveryUI::NONE); 1482 ui->SetBackground(RecoveryUI::NONE);
1482 if (show_text) ui->ShowText(true); 1483 if (show_text) ui->ShowText(true);
1483 1484
1484 struct selinux_opt seopts[] = { 1485 sehandle = selinux_android_file_context_handle();
1485 { SELABEL_OPT_PATH, "/file_contexts" } 1486 selinux_android_set_sehandle(sehandle);
1486 };
1487
1488 sehandle = selabel_open(SELABEL_CTX_FILE, seopts, 1);
1489
1490 if (!sehandle) { 1487 if (!sehandle) {
1491 ui->Print("Warning: No file_contexts\n"); 1488 ui->Print("Warning: No file_contexts\n");
1492 } 1489 }