summaryrefslogtreecommitdiff
path: root/Xext/xselinux.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xext/xselinux.c')
-rw-r--r--Xext/xselinux.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index d7c73227d..f3a84571e 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -1376,15 +1376,20 @@ XSELinuxExtensionInit(INITARGS)
/* Setup SELinux stuff */
if (!is_selinux_enabled()) {
- ErrorF("XSELinux: Extension failed to load: SELinux not enabled\n");
+ ErrorF("XSELinux: SELinux not enabled, disabling SELinux support.\n");
return;
}
selinux_set_callback(SELINUX_CB_LOG, (union selinux_callback)SELinuxLog);
selinux_set_callback(SELINUX_CB_AUDIT, (union selinux_callback)SELinuxAudit);
- if (selinux_set_mapping(map) < 0)
+ if (selinux_set_mapping(map) < 0) {
+ if (errno == EINVAL) {
+ ErrorF("XSELinux: Invalid object class mapping, disabling SELinux support.\n");
+ return;
+ }
FatalError("XSELinux: Failed to set up security class mapping\n");
+ }
if (avc_open(NULL, 0) < 0)
FatalError("XSELinux: Couldn't initialize SELinux userspace AVC\n");