aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-10-02 10:56:04 +0930
committerPeter Hutterer <peter.hutterer@redhat.com>2008-10-02 12:09:13 +0930
commit125e2b8ce23b8ceea250ae52ba69cd14af5592f9 (patch)
tree2eceb228111223b3a96082dc75f47db917a63776
parentRemove useless initialization of rc. (diff)
downloadxf86-input-evdev-125e2b8ce23b8ceea250ae52ba69cd14af5592f9.tar.gz
xf86-input-evdev-125e2b8ce23b8ceea250ae52ba69cd14af5592f9.tar.bz2
xf86-input-evdev-125e2b8ce23b8ceea250ae52ba69cd14af5592f9.zip
Close fd on DEVICE_OFF. (LP #276887)
Leaving the fd open means we still get keyboard events after VT switching away. Coming back, some of these events are replayed on the application that has the current focus. Reproduceable: 1. open terminal, focus. 2. VT switch away 3. type something, preferably a password 4. VT switch back, trigger a mouse event 5. Observe the X server guessing your password. Closing the fd on DEVICE_OFF fixes this. Reopen is handled by the reopen code introduced with commit 9930477cbeb4acfd070ae70894d13ffabfc347b8 Author: Peter Hutterer <peter.hutterer@redhat.com> Date: Tue Aug 26 14:33:40 2008 +0930 Attempt to re-open devices on read errors. Launchpad Bug 276887 <https://bugs.edge.launchpad.net/ubuntu/+source/xorg-server/+bug/276887>
-rw-r--r--src/evdev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c
index b678a0e..149f95d 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1016,6 +1016,8 @@ EvdevProc(DeviceIntPtr device, int what)
xf86Msg(X_WARNING, "%s: Release failed (%s)\n", pInfo->name,
strerror(errno));
xf86RemoveEnabledDevice(pInfo);
+ close(pInfo->fd);
+ pInfo->fd = -1;
}
if (pEvdev->flags & EVDEV_INITIALIZED)
EvdevMBEmuFinalize(pInfo);