summaryrefslogtreecommitdiffstats
path: root/fixPermissions.cpp
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2014-09-16 21:05:51 +0200
committerDees Troy <dees_troy@teamw.in>2014-10-07 20:35:18 +0200
commitae95d1a9f570ade934f6cb2ad9845da5e60bf5f2 (patch)
tree877f0df2f02c82b16d8e07ddd3a2d9c9ef326fa1 /fixPermissions.cpp
parentAttempt to automatically identify data/media devices (diff)
downloadandroid_bootable_recovery-ae95d1a9f570ade934f6cb2ad9845da5e60bf5f2.tar
android_bootable_recovery-ae95d1a9f570ade934f6cb2ad9845da5e60bf5f2.tar.gz
android_bootable_recovery-ae95d1a9f570ade934f6cb2ad9845da5e60bf5f2.tar.bz2
android_bootable_recovery-ae95d1a9f570ade934f6cb2ad9845da5e60bf5f2.tar.lz
android_bootable_recovery-ae95d1a9f570ade934f6cb2ad9845da5e60bf5f2.tar.xz
android_bootable_recovery-ae95d1a9f570ade934f6cb2ad9845da5e60bf5f2.tar.zst
android_bootable_recovery-ae95d1a9f570ade934f6cb2ad9845da5e60bf5f2.zip
Diffstat (limited to '')
-rw-r--r--fixPermissions.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/fixPermissions.cpp b/fixPermissions.cpp
index b98a8c7f5..5d57b47a4 100644
--- a/fixPermissions.cpp
+++ b/fixPermissions.cpp
@@ -71,6 +71,10 @@ int fixPermissions::restorecon(string entry, struct stat *sb) {
int fixPermissions::fixDataDataContexts(void) {
string dir = "/data/data/";
sehandle = selabel_open(SELABEL_CTX_FILE, selinux_options, 1);
+ if (!sehandle) {
+ LOGINFO("Unable to open /file_contexts\n");
+ return 0;
+ }
if (TWFunc::Path_Exists(dir)) {
fixContextsRecursively(dir, 0);
}
@@ -112,7 +116,10 @@ int fixPermissions::fixDataInternalContexts(void) {
struct stat sb;
string dir, androiddir;
sehandle = selabel_open(SELABEL_CTX_FILE, selinux_options, 1);
-
+ if (!sehandle) {
+ LOGINFO("Unable to open /file_contexts\n");
+ return 0;
+ }
if (TWFunc::Path_Exists("/data/media/0"))
dir = "/data/media/0";
else