Show strerror for security_getenforce().
Patch by Colin Waters.
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
diff --git a/libselinux/src/avc.c b/libselinux/src/avc.c
index 5c8def0..e9e3529 100644
--- a/libselinux/src/avc.c
+++ b/libselinux/src/avc.c
@@ -215,8 +215,9 @@
rc = security_getenforce();
if (rc < 0) {
avc_log(SELINUX_ERROR,
- "%s: could not determine enforcing mode\n",
- avc_prefix);
+ "%s: could not determine enforcing mode: %s\n",
+ avc_prefix,
+ strerror(errno));
goto out;
}
avc_enforcing = rc;