* commit '6fb92bd84bea3c5efadd891f1853fef7c811e79d': SELinux changes to check policy versions during a reload.
This commit is contained in:
commit
4f04439f0e
1 changed files with 5 additions and 8 deletions
13
init/init.c
13
init/init.c
|
|
@ -841,24 +841,21 @@ static int bootchart_init_action(int nargs, char **args)
|
||||||
|
|
||||||
static const struct selinux_opt seopts_prop[] = {
|
static const struct selinux_opt seopts_prop[] = {
|
||||||
{ SELABEL_OPT_PATH, "/property_contexts" },
|
{ SELABEL_OPT_PATH, "/property_contexts" },
|
||||||
|
{ SELABEL_OPT_PATH, "/data/security/current/property_contexts" },
|
||||||
{ 0, NULL }
|
{ 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct selabel_handle* selinux_android_prop_context_handle(void)
|
struct selabel_handle* selinux_android_prop_context_handle(void)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int policy_index = selinux_android_use_data_policy() ? 1 : 0;
|
||||||
struct selabel_handle* sehandle = NULL;
|
struct selabel_handle* sehandle = selabel_open(SELABEL_CTX_ANDROID_PROP,
|
||||||
while ((sehandle == NULL) && seopts_prop[i].value) {
|
&seopts_prop[policy_index], 1);
|
||||||
sehandle = selabel_open(SELABEL_CTX_ANDROID_PROP, &seopts_prop[i], 1);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!sehandle) {
|
if (!sehandle) {
|
||||||
ERROR("SELinux: Could not load property_contexts: %s\n",
|
ERROR("SELinux: Could not load property_contexts: %s\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return NULL;
|
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;
|
return sehandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue