summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2014-12-10 02:02:32 +0000
committerNick Kralevich <nnk@google.com>2014-12-10 02:02:32 +0000
commit59f64ec31ffa4ca75f39006c1ce30acf71d71407 (patch)
treec37de4ed030f8bc2917e362f25cbc92071637d9b
parent98069027bd90d2139d54affa1367dcd3317a1c11 (diff)
downloadsystem_core-59f64ec31ffa4ca75f39006c1ce30acf71d71407.zip
system_core-59f64ec31ffa4ca75f39006c1ce30acf71d71407.tar.gz
system_core-59f64ec31ffa4ca75f39006c1ce30acf71d71407.tar.bz2
Revert "Move property_context label handling to libselinux."
Emulator fails to boot. This reverts commit 98069027bd90d2139d54affa1367dcd3317a1c11. Bug: 18692152 Change-Id: If362e1311bc3f07e033ba81190c05608ada7c361
-rw-r--r--init/init.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c
index 7ddab80..2b82937 100644
--- a/init/init.c
+++ b/init/init.c
@@ -858,6 +858,26 @@ static int bootchart_init_action(int nargs, char **args)
}
#endif
+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 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[policy_index].value);
+ return sehandle;
+}
+
void selinux_init_all_handles(void)
{
sehandle = selinux_android_file_context_handle();