summaryrefslogtreecommitdiffstats
path: root/twrp.cpp
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2013-10-23 21:28:57 +0200
committerGerrit Code Review <gerrit2@build1>2013-10-23 21:28:57 +0200
commit14ca0259f9dbdd8cc9a02c6adfc394126b417ea5 (patch)
tree891df97429b1c72eeba6f7b2ac4c26a997ab88b4 /twrp.cpp
parentMerge "Remove trailing spaces on auto generated backup names" into android-4.3 (diff)
parentfix getting and setting contexts in selinux (diff)
downloadandroid_bootable_recovery-14ca0259f9dbdd8cc9a02c6adfc394126b417ea5.tar
android_bootable_recovery-14ca0259f9dbdd8cc9a02c6adfc394126b417ea5.tar.gz
android_bootable_recovery-14ca0259f9dbdd8cc9a02c6adfc394126b417ea5.tar.bz2
android_bootable_recovery-14ca0259f9dbdd8cc9a02c6adfc394126b417ea5.tar.lz
android_bootable_recovery-14ca0259f9dbdd8cc9a02c6adfc394126b417ea5.tar.xz
android_bootable_recovery-14ca0259f9dbdd8cc9a02c6adfc394126b417ea5.tar.zst
android_bootable_recovery-14ca0259f9dbdd8cc9a02c6adfc394126b417ea5.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