summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Haines <richard_c_haines@btinternet.com>2015-08-24 15:39:13 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-24 15:39:13 +0000
commit3dd723a9cf1f9249e357af6703c2b23cb6d8d5c5 (patch)
tree9bef3f305fcd1c2a083098e5c4b4cd7a2beb62e7
parent2cef6676a4a25857fbcd560a2280f545bb11476b (diff)
parent91b7d911c51f972f127972bc5c529310387fba8b (diff)
downloadlibselinux-3dd723a9cf1f9249e357af6703c2b23cb6d8d5c5.tar.gz
am 91b7d911: Set SELABEL_OPT_BASEONLY to stop additional file checks
* commit '91b7d911c51f972f127972bc5c529310387fba8b': Set SELABEL_OPT_BASEONLY to stop additional file checks
-rw-r--r--src/android.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/android.c b/src/android.c
index 975906b..8f66a5a 100644
--- a/src/android.c
+++ b/src/android.c
@@ -1383,10 +1383,17 @@ int selinux_android_restorecon_pkgdir(const char *pkgdir,
struct selabel_handle* selinux_android_file_context_handle(void)
{
+ char *path = NULL;
struct selabel_handle *sehandle;
+ struct selinux_opt fc_opts[] = {
+ { SELABEL_OPT_PATH, path },
+ { SELABEL_OPT_BASEONLY, (char *)1 }
+ };
set_policy_index();
- sehandle = selabel_open(SELABEL_CTX_FILE, &seopts[policy_index], 1);
+ fc_opts[0].value = seopts[policy_index].value;
+
+ sehandle = selabel_open(SELABEL_CTX_FILE, fc_opts, 2);
if (!sehandle) {
selinux_log(SELINUX_ERROR, "%s: Error getting file context handle (%s)\n",
@@ -1398,7 +1405,7 @@ struct selabel_handle* selinux_android_file_context_handle(void)
return NULL;
}
selinux_log(SELINUX_INFO, "SELinux: Loaded file_contexts contexts from %s.\n",
- seopts[policy_index].value);
+ fc_opts[0].value);
return sehandle;
}