summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2014-05-31 11:38:44 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-31 11:38:44 +0000
commitab1816a6c0dad525b2f26188bed96d1da6df293b (patch)
treea1a8d8b50ad724c461e70cc59c7f29d9a9d91f19 /init
parent40f321ab4965e38f0a50955f816a0de718deec99 (diff)
parent4f04439f0eab481d1b7938e78d8ee316dda4d641 (diff)
downloadsystem_core-ab1816a6c0dad525b2f26188bed96d1da6df293b.zip
system_core-ab1816a6c0dad525b2f26188bed96d1da6df293b.tar.gz
system_core-ab1816a6c0dad525b2f26188bed96d1da6df293b.tar.bz2
am 4f04439f: am 6fb92bd8: am 252b0e2b: Merge "SELinux changes to check policy versions during a reload."
* commit '4f04439f0eab481d1b7938e78d8ee316dda4d641': SELinux changes to check policy versions during a reload.
Diffstat (limited to 'init')
-rw-r--r--init/init.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/init/init.c b/init/init.c
index 1538aa6..7ba25dc 100644
--- a/init/init.c
+++ b/init/init.c
@@ -841,24 +841,21 @@ static int bootchart_init_action(int nargs, char **args)
static const struct selinux_opt seopts_prop[] = {
{ SELABEL_OPT_PATH, "/property_contexts" },
+ { SELABEL_OPT_PATH, "/data/security/current/property_contexts" },
{ 0, NULL }
};
struct selabel_handle* selinux_android_prop_context_handle(void)
{
- int i = 0;
- struct selabel_handle* sehandle = NULL;
- while ((sehandle == NULL) && seopts_prop[i].value) {
- sehandle = selabel_open(SELABEL_CTX_ANDROID_PROP, &seopts_prop[i], 1);
- i++;
- }
-
+ int policy_index = selinux_android_use_data_policy() ? 1 : 0;
+ struct selabel_handle* sehandle = selabel_open(SELABEL_CTX_ANDROID_PROP,
+ &seopts_prop[policy_index], 1);
if (!sehandle) {
ERROR("SELinux: Could not load property_contexts: %s\n",
strerror(errno));
return NULL;
}
- INFO("SELinux: Loaded property contexts from %s\n", seopts_prop[i - 1].value);
+ INFO("SELinux: Loaded property contexts from %s\n", seopts_prop[policy_index].value);
return sehandle;
}