summaryrefslogtreecommitdiff
path: root/dix/devices.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2009-09-15 19:29:34 -0400
committerEamon Walsh <ewalsh@tycho.nsa.gov>2009-10-14 19:19:19 -0400
commit8502c06e19a4c00bf1311f54f9a365ee9e026e97 (patch)
tree5b0bafb13e45ba65097ff4fedbc5b7745840c325 /dix/devices.c
parent0493935691e925ae137af7636fa15befa76c8b45 (diff)
xace: Fake return values on denials in input polling requests.
Instead of returning BadAccess when "read" permission is denied on a device, falsify the device state (buttons down, keys pressed). This is nicer to applications, but may still have undesired side effects. The long-term solution is not to use these requests in event-driven code! Requests affected: QueryPointer, QueryKeymap, XiQueryDevice. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Diffstat (limited to 'dix/devices.c')
-rw-r--r--dix/devices.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dix/devices.c b/dix/devices.c
index e86e606c0..6a7907399 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2221,12 +2221,15 @@ ProcQueryKeymap(ClientPtr client)
rep.length = 2;
rc = XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess);
- if (rc != Success)
+ if (rc != Success && rc != BadAccess)
return rc;
for (i = 0; i<32; i++)
rep.map[i] = down[i];
+ if (rc == BadAccess)
+ memset(rep.map, 0, 32);
+
WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep);
return Success;