summaryrefslogtreecommitdiff
path: root/os/connection.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2006-11-01 15:11:48 -0800
committerAlan Coopersmith <alan.coopersmith@sun.com>2006-11-01 15:11:48 -0800
commitfbfb35189ef6666707097704b43e052cb2f919ae (patch)
tree8b94002d55fc5acf8e02eb35e262130279dcbd5f /os/connection.c
parent6fdfd9dad91d7b7aa292f8c4d268dd27c34de8d3 (diff)
Bug #1997: AUDIT messages should contain uid for local accesses
<https://bugs.freedesktop.org/show_bug.cgi?id=1997>
Diffstat (limited to 'os/connection.c')
-rw-r--r--os/connection.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/os/connection.c b/os/connection.c
index 571ba58ab..60f3b9f51 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -549,7 +549,9 @@ AuthAudit (ClientPtr client, Bool letin,
{
char addr[128];
char *out = addr;
-
+ int client_uid;
+ char client_uid_string[32];
+
if (!len)
strcpy(out, "local host");
else
@@ -585,14 +587,22 @@ AuthAudit (ClientPtr client, Bool letin,
default:
strcpy(out, "unknown address");
}
+
+ if (LocalClientCred(client, &client_uid, NULL) != -1) {
+ snprintf(client_uid_string, sizeof(client_uid_string),
+ " (uid %d)", client_uid);
+ } else {
+ client_uid_string[0] = '\0';
+ }
if (proto_n)
- AuditF("client %d %s from %s\n Auth name: %.*s ID: %d\n",
+ AuditF("client %d %s from %s%s\n Auth name: %.*s ID: %d\n",
client->index, letin ? "connected" : "rejected", addr,
- (int)proto_n, auth_proto, auth_id);
+ client_uid_string, (int)proto_n, auth_proto, auth_id);
else
- AuditF("client %d %s from %s\n",
- client->index, letin ? "connected" : "rejected", addr);
+ AuditF("client %d %s from %s%s\n",
+ client->index, letin ? "connected" : "rejected", addr,
+ client_uid_string);
}
XID