summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-09-21 07:16:13 +0100
committerAdam Jackson <ajax@redhat.com>2015-10-26 12:19:58 -0400
commit616239c15d03f5b527288965f7eee0edebdcf20f (patch)
treee6b521e411e4a8ff26bd07bec6cdc83cf978bfe0
parent87151fefb06dc96fac79e93a3151300bd8037f3d (diff)
downloadxserver-616239c15d03f5b527288965f7eee0edebdcf20f.tar.gz
Xext/xselinux: Warning fixes
There's a 'const char *' adventure here that I'm mostly ignoring; some client information gets const poisoned. Worked around by adding a couple of casts. Ick. Added an _X_ATTRIBUTE_PRINTF to SELinuxLog. Ignore a couple of unused return values. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 9af111fe045d82192bacc722940e1d92a8ba4cbd)
-rw-r--r--Xext/xselinux_hooks.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c
index 48219a9e0..e69bfe7ae 100644
--- a/Xext/xselinux_hooks.c
+++ b/Xext/xselinux_hooks.c
@@ -147,7 +147,7 @@ SELinuxLabelClient(ClientPtr client)
strncpy(subj->command, cmdname, COMMAND_LEN - 1);
if (!cached)
- free(cmdname); /* const char * */
+ free((void *) cmdname); /* const char * */
}
finish:
@@ -295,6 +295,9 @@ SELinuxAudit(void *auditdata,
}
static int
+SELinuxLog(int type, const char *fmt, ...) _X_ATTRIBUTE_PRINTF(2, 3);
+
+static int
SELinuxLog(int type, const char *fmt, ...)
{
va_list ap;
@@ -316,6 +319,7 @@ SELinuxLog(int type, const char *fmt, ...)
va_start(ap, fmt);
vsnprintf(buf, MAX_AUDIT_MESSAGE_LENGTH, fmt, ap);
rc = audit_log_user_avc_message(audit_fd, aut, buf, NULL, NULL, NULL, 0);
+ (void) rc;
va_end(ap);
LogMessageVerb(X_WARNING, 0, "%s", buf);
return 0;
@@ -476,7 +480,7 @@ SELinuxExtension(CallbackListPtr *pcbl, void *unused, void *calldata)
}
/* Perform the security check */
- auditdata.extension = rec->ext->name;
+ auditdata.extension = (char *) rec->ext->name;
rc = SELinuxDoCheck(subj, obj, SECCLASS_X_EXTENSION, rec->access_mode,
&auditdata);
if (rc != Success)