service_manager.c: remove is_selinux_enabled calls
SELinux is always enabled. No need to check for it.
Test: Device boots and service manager works without errors.
Change-Id: I12be7336e7c31a5f5796ea1383f3dc934eb3c97c
diff --git a/cmds/servicemanager/service_manager.c b/cmds/servicemanager/service_manager.c
index 68e3ceb..ea41558 100644
--- a/cmds/servicemanager/service_manager.c
+++ b/cmds/servicemanager/service_manager.c
@@ -60,7 +60,6 @@
return 1;
}
-static int selinux_enabled;
static char *service_manager_context;
static struct selabel_handle* sehandle;
@@ -89,10 +88,6 @@
static bool check_mac_perms_from_getcon(pid_t spid, uid_t uid, const char *perm)
{
- if (selinux_enabled <= 0) {
- return true;
- }
-
return check_mac_perms(spid, uid, service_manager_context, perm, NULL);
}
@@ -101,10 +96,6 @@
bool allowed;
char *tctx = NULL;
- if (selinux_enabled <= 0) {
- return true;
- }
-
if (!sehandle) {
ALOGE("SELinux: Failed to find sehandle. Aborting service_manager.\n");
abort();
@@ -384,20 +375,17 @@
return -1;
}
- selinux_enabled = is_selinux_enabled();
sehandle = selinux_android_service_context_handle();
selinux_status_open(true);
- if (selinux_enabled > 0) {
- if (sehandle == NULL) {
- ALOGE("SELinux: Failed to acquire sehandle. Aborting.\n");
- abort();
- }
+ if (sehandle == NULL) {
+ ALOGE("SELinux: Failed to acquire sehandle. Aborting.\n");
+ abort();
+ }
- if (getcon(&service_manager_context) != 0) {
- ALOGE("SELinux: Failed to acquire service_manager context. Aborting.\n");
- abort();
- }
+ if (getcon(&service_manager_context) != 0) {
+ ALOGE("SELinux: Failed to acquire service_manager context. Aborting.\n");
+ abort();
}
union selinux_callback cb;