aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2017-02-15 14:18:35 +0000
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-03-21 10:33:30 +0100
commit6bc37b980515995b0944632e5a062246683f1d97 (patch)
tree964a6fb0d90261d1c725af70634520dfdeb00008 /nx-X11
parent0338cbc3f355cdb16da789f446dee2eb7773edba (diff)
downloadnx-libs-6bc37b980515995b0944632e5a062246683f1d97.tar.gz
nx-libs-6bc37b980515995b0944632e5a062246683f1d97.tar.bz2
nx-libs-6bc37b980515995b0944632e5a062246683f1d97.zip
AUDIT messages should contain uid for local accesses (X.org bug #1997)
commit fbfb35189ef6666707097704b43e052cb2f919ae Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Nov 1 15:11:48 2006 -0800 Bug #1997: AUDIT messages should contain uid for local accesses <https://bugs.freedesktop.org/show_bug.cgi?id=1997>
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/os/connection.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c
index 0a52214b0..151605cfb 100644
--- a/nx-X11/programs/Xserver/os/connection.c
+++ b/nx-X11/programs/Xserver/os/connection.c
@@ -534,6 +534,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
@@ -563,14 +566,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