Package: mouseemu
Version: 0.15-5
Severity: important
Tags: patch
Hi,
2.6.19-rcX cares about more fields in uinput_user_dev. Since we pass in
random values for e.g. ff_ in uinput this results in a completely dead
keyboard since the uinput device never gets fully initialized. Obvious
fix attached, please apply.
The second patch fixes the wrong detection of write failures. Write
returns negative values on errors (and we aren't too happy with 0
either), with this patch we would have seen -EINVAL due to the
uninitialized uinput_user_dev.
I didn't make this release critical since etch is supposed to ship with
2.6.18, but it would be nice if it would work on newer kernels too.
Cheers,
-- Guido
-- System Information:
Debian Release: 4.0
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: powerpc (ppc)
Shell: /bin/sh linked to /bin/dash
Kernel: Linux 2.6.19-rc6-dirty
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Versions of packages mouseemu depends on:
ii libc6 2.3.6.ds1-8 GNU C Library: Shared libraries
ii procps 1:3.2.7-3 /proc file system utilities
mouseemu recommends no packages.
-- no debconf information
#! /bin/sh /usr/share/dpatch/dpatch-run
## write_error.dpatch by <[EMAIL PROTECTED]>
##
## Intialize all fields in uinput_user_dev, otherwise strange things
## like dead keyboard, etc. might happen
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Don't kill ourselves if not forking into the background
diff --git a/mouseemu.c b/mouseemu.c
index 6decb59..9c5b332 100644
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -365,6 +365,7 @@ int uinput_setup(void)
struct uinput_user_dev device;
int i;
+ memset(&device, 0, sizeof(struct uinput_user_dev));
/*setup keyboard device */
if(ui_keyb_fd > 0) {
#! /bin/sh /usr/share/dpatch/dpatch-run
## write_error.dpatch by <[EMAIL PROTECTED]>
##
## Fix write error detection
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Don't kill ourselves if not forking into the background
@DPATCH@
--- a/mouseemu.c.orig 2006-11-18 17:36:47.000000000 +0100
+++ b/mouseemu.c 2006-11-18 17:47:11.000000000 +0100
@@ -88,7 +88,7 @@
static void passthrough(int fd, struct input_event event)
{
- if (write(fd, &event, sizeof(event)) < sizeof(event))
+ if (write(fd, &event, sizeof(event)) <= 0)
perror("passthrough error");
}