summaryrefslogtreecommitdiffstats
path: root/fixPermissions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fixPermissions.cpp')
-rw-r--r--fixPermissions.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/fixPermissions.cpp b/fixPermissions.cpp
index fa5ef5640..40ac516b0 100644
--- a/fixPermissions.cpp
+++ b/fixPermissions.cpp
@@ -45,8 +45,10 @@ using namespace rapidxml;
int fixPermissions::restorecon(string entry, struct stat *sb) {
char *oldcontext, *newcontext;
struct selabel_handle *sehandle;
-
- sehandle = selinux_android_file_context_handle();
+ struct selinux_opt selinux_options[] = {
+ { SELABEL_OPT_PATH, "/file_contexts" }
+ };
+ sehandle = selabel_open(SELABEL_CTX_FILE, selinux_options, 1);
if (lgetfilecon(entry.c_str(), &oldcontext) < 0) {
LOGINFO("Couldn't get selinux context for %s\n", entry.c_str());
return -1;