From a7b8de514de8ba8fb4e8366ecf52e52dae49acd3 Mon Sep 17 00:00:00 2001 From: Dees Troy Date: Mon, 3 Feb 2014 14:58:32 +0000 Subject: Fix SELinux function compatibility in older trees Change-Id: I3d8c23b51b3331d062099c1edb1833551cc6af91 --- fixPermissions.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fixPermissions.cpp') 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; -- cgit v1.2.3