Commit ae95d1a9 authored by Dees Troy's avatar Dees Troy
Browse files

Check sehandle before fixing permissions

Change-Id: I73ba5519bf650f0c7f0a683f311099ff13747155
parent 6277c797
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment