summaryrefslogtreecommitdiffstats
path: root/twrp.cpp
diff options
context:
space:
mode:
authorbigbiff bigbiff <bigbiff@teamw.in>2013-10-12 02:28:00 +0200
committerDees Troy <dees_troy@teamw.in>2013-10-17 18:49:49 +0200
commitc49d7069039241ad02a8a710e9054d253abee3ad (patch)
tree40d9a8e023ad47e9a4032d23b160770e4fcaa12d /twrp.cpp
parentMerge "Ensure root folders get added in split archives" into twrp2.7 (diff)
downloadandroid_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar.gz
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar.bz2
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar.lz
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar.xz
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar.zst
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.zip
Diffstat (limited to 'twrp.cpp')
-rw-r--r--twrp.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/twrp.cpp b/twrp.cpp
index 765cad342..56ffedb90 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -104,10 +104,18 @@ int main(int argc, char **argv) {
gui_loadResources();
#ifdef HAVE_SELINUX
+ if (TWFunc::Path_Exists("/prebuilt_file_contexts")) {
+ if (TWFunc::Path_Exists("/file_contexts")) {
+ printf("Renaming regular /file_contexts -> /file_contexts.bak\n");
+ rename("/file_contexts", "/file_contexts.bak");
+ }
+ printf("Moving /prebuilt_file_contexts -> /file_contexts\n");
+ rename("/prebuilt_file_contexts", "/file_contexts");
+ }
struct selinux_opt selinux_options[] = {
{ SELABEL_OPT_PATH, "/file_contexts" }
};
- selinux_handle = selabel_open(SELABEL_CTX_FILE, selinux_options, 1);
+ selinux_handle = selabel_open(SELABEL_CTX_FILE, selinux_options, 1);
if (!selinux_handle)
printf("No file contexts for SELinux\n");
else