Hello community,
here is the log from the commit of package xf86-input-vmmouse for
openSUSE:Factory checked in at 2015-07-14 17:20:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xf86-input-vmmouse (Old)
and /work/SRC/openSUSE:Factory/.xf86-input-vmmouse.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xf86-input-vmmouse"
Changes:
--------
--- /work/SRC/openSUSE:Factory/xf86-input-vmmouse/xf86-input-vmmouse.changes
2015-03-23 12:13:25.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.xf86-input-vmmouse.new/xf86-input-vmmouse.changes
2015-07-14 17:20:24.000000000 +0200
@@ -1,0 +2,17 @@
+Fri Jun 26 12:49:24 UTC 2015 - [email protected]
+
+- xf86-input-vmmouse 13.1.0:
+ This release is intended for general distro inclusion, Testing
+ has been performed on various linux distros, FreeBSD 10.1 and
+ Solaris 11.2.
+ This release contains a number of build fixes and also changes
+ to deal with improved vmmouse port security and backoff if a
+ vmmouse kernel module is encountered. An additional dependency
+ on libudev is introduced on linux.
+- supersedes the following patches:
+ * U_Don-t-de-reference-pMse-if-it-hasn-t-been-initialise.patch
+ * U_Free-the-vmmouse-data-on-UnInit.patch
+ * u_Revert-Remove-call-to-iopl-.-It-s-not-portable-and-i.patch
+ * u_vmmouse_client.h-Include-xorg-server.h-before-xf86_O.patch
+
+-------------------------------------------------------------------
Old:
----
U_Don-t-de-reference-pMse-if-it-hasn-t-been-initialise.patch
U_Free-the-vmmouse-data-on-UnInit.patch
u_Revert-Remove-call-to-iopl-.-It-s-not-portable-and-i.patch
u_vmmouse_client.h-Include-xorg-server.h-before-xf86_O.patch
xf86-input-vmmouse-13.0.0.tar.bz2
New:
----
xf86-input-vmmouse-13.1.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xf86-input-vmmouse.spec ++++++
--- /var/tmp/diff_new_pack.y2rrI0/_old 2015-07-14 17:20:25.000000000 +0200
+++ /var/tmp/diff_new_pack.y2rrI0/_new 2015-07-14 17:20:25.000000000 +0200
@@ -23,22 +23,19 @@
%endif
Name: xf86-input-vmmouse
-Version: 13.0.0
+Version: 13.1.0
Release: 0
Summary: VMware Mouse input driver for the Xorg X server
License: MIT
Group: System/X11/Servers/XF86_4
Url: http://xorg.freedesktop.org/
Source0:
http://xorg.freedesktop.org/releases/individual/driver/%{name}-%{version}.tar.bz2
-Patch1: u_Revert-Remove-call-to-iopl-.-It-s-not-portable-and-i.patch
Patch2: u_Don-t-access-hardware-register-while-switched-away.patch
-Patch3: U_Free-the-vmmouse-data-on-UnInit.patch
-Patch4: u_vmmouse_client.h-Include-xorg-server.h-before-xf86_O.patch
-Patch5: U_Don-t-de-reference-pMse-if-it-hasn-t-been-initialise.patch
BuildRequires: pkg-config
# For directory ownership
BuildRequires: udev
BuildRequires: pkgconfig(inputproto)
+BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(randrproto)
BuildRequires: pkgconfig(xorg-macros) >= 1.8
BuildRequires: pkgconfig(xorg-server) >= 1.0.1
@@ -58,11 +55,7 @@
%prep
%setup -q
-%patch1 -p1
%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
%build
%configure --with-xorg-conf-dir=/etc/X11/xorg.conf.d
--with-udev-rules-dir=%{_udevrulesdir}
++++++ xf86-input-vmmouse-13.0.0.tar.bz2 -> xf86-input-vmmouse-13.1.0.tar.bz2
++++++
++++ 4580 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/ChangeLog new/xf86-input-vmmouse-13.1.0/ChangeLog
--- old/xf86-input-vmmouse-13.0.0/ChangeLog 2013-01-15 21:08:43.000000000
+0100
+++ new/xf86-input-vmmouse-13.1.0/ChangeLog 2015-06-25 12:29:04.000000000
+0200
@@ -1,3 +1,269 @@
+commit bbe41fae444e58c98db64db20114418ec78b99d6
+Author: Thomas Hellstrom <[email protected]>
+Date: Thu Jun 25 03:20:34 2015 -0700
+
+ Bump version number for release
+
+ Signed-off-by: Thomas Hellstrom <[email protected]>
+ Reviewed-by: Trivial.
+
+commit d2040bd52d2dde08ce729dedabb350d3476e294a
+Author: Thomas Hellstrom <[email protected]>
+Date: Wed Apr 8 23:26:34 2015 -0700
+
+ vmmouse: Bump version number for release
+
+ Signed-off-by: Thomas Hellstrom <[email protected]>
+
+commit 5b7d9cf15ae44361a3de506916f769d8dfec61d1
+Author: Thomas Hellstrom <[email protected]>
+Date: Wed Apr 8 18:25:41 2015 +0200
+
+ vmmouse: Fix vmmouse_detect build on BSD
+
+ Tested with FreeBSD, but changes affect also OpenBSD and NetBSD to fix
+ compiling and linking with the relevant system libraries.
+
+ Signed-off-by: Thomas Hellstrom <[email protected]>
+ Reviewed-by: Brian Paul <[email protected]>
+ Acked-by: Sinclair Yeh <[email protected]>
+
+commit c8ec00f537a640db049a1afb44a31c2199859085
+Author: Thomas Hellstrom <[email protected]>
+Date: Thu Jan 15 10:59:46 2015 +0100
+
+ vmmouse: Add support for the access restrict command
+
+ The access restrict command, if implemented, restricts vmmouse port
+ access to the indicated level.
+
+ Signed-off-by: Thomas Hellstrom <[email protected]>
+ Reviewed-by: Michael Banack <[email protected]>
+
+commit d5c1493b5fe0871f4f2823125f0d49f8e1edcda7
+Author: Thomas Hellstrom <[email protected]>
+Date: Thu Jan 15 10:14:30 2015 +0100
+
+ vmmouse: Run vmmouse_detect as an io privileged process
+
+ Many distros already include patches to do this in various more or less
+ hackish ways. Since VMware now is about to restrict access to the VMmouse
+ backdoor, let's try to support it officially.
+
+ Signed-off-by: Thomas Hellstrom <[email protected]>
+ Acked-by: Sinclair Yeh <[email protected]>
+
+commit 1cbbc03c4b37d57760c57bd2e0b0f89d744a5795
+Author: Stefan Dirsch <[email protected]>
+Date: Tue Oct 7 11:32:01 2014 +0200
+
+ vmmouse_client.h: Include xorg-server.h before xf86_OSproc.h
+
+ xf86_OSproc.h cannot be included without first including xorg-server.h.
+
+ Without this the build fails on systems with the latest glibc,
+ throwing this error:
+
+ In file included from /usr/include/string.h:634:0,
+ from /usr/include/xorg/os.h:53,
+ from /usr/include/xorg/misc.h:115,
+ from /usr/include/xorg/window.h:50,
+ from /usr/include/xorg/globals.h:7,
+ from /usr/include/xorg/opaque.h:34,
+ from /usr/include/xorg/xf86_OSproc.h:127,
+ from vmmouse_client.h:42,
+ from vmmouse_client.c:38:
+ /usr/include/xorg/os.h:579:1: error: expected identifier or '(' before
'__extension__'
+ strndup(const char *str, size_t n);
+
+ This is caused by HAVE_STRNDUP not being set (it is set from
xorg-server.h),
+ causing os.h to redefine it.
+
+ Signed-off-by: Stefan Dirsch <[email protected]>
+ Reviewed-by: Daniel Stone <[email protected]>
+ Acked-by: Thomas Hellstrom <[email protected]>
+
+commit 576e8123d9f9f01ef6041cdfb96ca811197d05d2
+Author: Thomas Hellstrom <[email protected]>
+Date: Wed Oct 1 21:04:30 2014 +0200
+
+ Back off if we detect a vmmouse kernel driver v3
+
+ If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg
+ evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect
+ utility doesn't detect a vmmouse if a kernel driver is active.
+
+ v2: Change the vmmouse kernel device name, fix comment.
+ v3: Fix up libudev error handling.
+
+ Signed-off-by: Thomas Hellstrom <[email protected]>
+ Reviewed-by: Sinclair Yeh <[email protected]>
+
+commit de58228aaf226baac21f4bb31712f7257b221370
+Author: Loïc Yhuel <[email protected]>
+Date: Sat Jul 12 07:29:24 2014 +0200
+
+ Fix wheel button labels
+
+ Wheel is using buttons 4/5, but btn_labels array is 0-based.
+ It matches mouse and evdev drivers, and fixes wheel in Qt5.3.
+
+ Signed-off-by: Peter Hutterer <[email protected]>
+
+commit 336f8633837abe4a1e5ba84b53ac8b9dac5d29a2
+Author: Jeremy Huddleston Sequoia <[email protected]>
+Date: Thu Nov 28 11:59:53 2013 -0800
+
+ Always include config.h first
+
+ This fixes some build warnings about CSRG_BASED being redefined due to
+ incorrect header include ordering.
+
+ Signed-off-by: Jeremy Huddleston Sequoia <[email protected]>
+
+commit 05492b038e7773aa8f90449387cde89e10bc614c
+Author: Gaetan Nadon <[email protected]>
+Date: Mon Sep 30 13:56:53 2013 -0400
+
+ tools: make install fails when user has no write permission in /lib
+
+ The location of the udevdir is obtained from pkg-config. This is generally
+ /lib/udev. Most people run their build scripts as non-root and do not want
to
+ overwrite or add files on their workstation system.
+
+ This was not the behaviour in release 12.8.0. The code in configure.ac set
+ udevdir based on common installation prefixes /usr or /usr/local for which
+ the user would probably have root permission anyway. Other prefixes would
+ be assigned a udevdir value under the given $prefix.
+
+ The patch proposes the default location $libdir/udev/rules.d and no longer
+ seeking it's value from pkg-config, just like what was done for hal.
+
+ The expectation is that the xorg source tree can be built from top to
bottom
+ out of the box without tweaks or workarounds. A developer need to
+ manually install a rule under development and run an admin command for it
to
+ take effect. Unlike binaries or libraries, there is no "path" style
+ variable to append a rule in development from a different location.
+
+ Reviewed-by: Jakob Bornecrantz <[email protected]>
+ Signed-off-by: Gaetan Nadon <[email protected]>
+ Signed-off-by: Peter Hutterer <[email protected]>
+ Signed-off-by: Jakob Bornecrantz <[email protected]>
+
+commit 740f2cbcc0781109a6c898685b5200bdb55acac8
+Author: Peter Hutterer <[email protected]>
+Date: Mon Oct 21 14:09:04 2013 +1000
+
+ Drop AM_MAINTAINER_MODE
+
+ Long writeup:
+ http://blogs.gnome.org/desrt/2011/09/08/am_maintainer_mode-is-not-cool/
+
+ Reviewed-by: Jakob Bornecrantz <[email protected]>
+ Signed-off-by: Jakob Bornecrantz <[email protected]>
+ Signed-off-by: Peter Hutterer <[email protected]>
+
+commit 9a815289f9df5577f5fdf4c2463b614a93819b7d
+Author: Peter Hutterer <[email protected]>
+Date: Mon Feb 11 15:27:26 2013 +1000
+
+ Don't de-reference pMse if it hasn't been initialised yet
+
+ If the device fails PreInit, UnInit is still called by pMse may be NULL.
+ Dereferencing it is a bad idea.
+
+ Reviewed-by: Jakob Bornecrantz <[email protected]>
+ Signed-off-by: Jakob Bornecrantz <[email protected]>
+ Signed-off-by: Peter Hutterer <[email protected]>
+
+commit 3d5b85d62c11a9f816dbcc041cb2ac2150af666d
+Author: Peter Hutterer <[email protected]>
+Date: Wed Jan 30 10:54:11 2013 +1000
+
+ Handle DEVICE_ABORT on ABI 19.1
+
+ Called on server abort, so let's just do the absolute minimum.
+
+ Reviewed-by: Jakob Bornecrantz <[email protected]>
+ Signed-off-by: Peter Hutterer <[email protected]>
+ Signed-off-by: Jakob Bornecrantz <[email protected]>
+
+commit eb23b149c176d1c735b4c658b33ce6686e47618b
+Author: Gaetan Nadon <[email protected]>
+Date: Sun Sep 22 18:09:27 2013 -0400
+
+ "make dist" fails when workstation has no udev package
+
+ Unable to create a tar file for the vmmouse package or run distcheck for
that
+ matter. In tools, when the dev package is not installed, the makefile code
+ under HAS_UDEV_RULES_DIR is commented out. That leaves $(udev_DATA) empty
+ which causes EXTRA_DIST to be missing a file.
+
+ The solution is to spell out the file name. The name can never change as
the
+ content of the tarball must be the same for everyone creating a tar file
from
+ git, regardless of their workstation configuration.
+
+ Reviewed-by: Peter Hutterer <[email protected]>
+ Signed-off-by: Gaetan Nadon <[email protected]>
+
+commit 60a6e4ec6068f7b3f237ca0a044cd31d3bcf1aeb
+Author: Gaetan Nadon <[email protected]>
+Date: Sun Sep 22 17:07:14 2013 -0400
+
+ Autoconf: Fix deprecated use of AC_OUTPUT
+
+ Use AC_CONFIG_FILES (once or more) and then AC_OUTPUT.
+
+ Reviewed-by: Peter Hutterer <[email protected]>
+ Signed-off-by: Gaetan Nadon <[email protected]>
+
+commit 64df5e5fdef9c34bad4edf90ee5f489a5c519405
+Author: Gaetan Nadon <[email protected]>
+Date: Sun Sep 22 16:58:27 2013 -0400
+
+ Autoconf: minimum level required is 2.60
+
+ The minimum for all X.Org modules.
+
+ Reviewed-by: Peter Hutterer <[email protected]>
+ Signed-off-by: Gaetan Nadon <[email protected]>
+
+commit c37d1dcf76eb9c9df7c69fe6d4d082350553a1a0
+Author: Gaetan Nadon <[email protected]>
+Date: Sun Sep 22 16:55:42 2013 -0400
+
+ Autoconf: replace deprecated AC_HELP_STRING with AS_HELP_STRING
+
+ Just a macro name change.
+
+ Reviewed-by: Peter Hutterer <[email protected]>
+ Signed-off-by: Gaetan Nadon <[email protected]>
+
+commit d695372a7f8c54c0297c4dbd3513175417eade40
+Author: Gaetan Nadon <[email protected]>
+Date: Sun Sep 22 16:50:58 2013 -0400
+
+ Autoconf: remove AC_PROG_CC which overrides AC_PROG_CC_C99 from util-macros
+
+ All other X.Org modules and mainly the server are using C99 compiler.
+ Currently the compiler gets initialized twice, once to C99 from
+ util-macros and once to C89 from configure.ac.
+
+ Reviewed-by: Peter Hutterer <[email protected]>
+ Signed-off-by: Gaetan Nadon <[email protected]>
+
+commit 8cb6254ad3068537e74faaf80b9e346e525ea92d
+Author: Peter Hutterer <[email protected]>
+Date: Fri Feb 1 11:52:53 2013 +1000
+
+ Free the vmmouse data on UnInit
+
+ xf86DeleteInput() will free pInfo->private, but not the one hanging off
+ that.
+
+ Signed-off-by: Peter Hutterer <[email protected]>
+ Tested-by: Zack Rusin <[email protected]>
+
commit a2e4aa9d2002dad6e976d9e4d3f129ad3127be81
Author: Zack Rusin <[email protected]>
Date: Tue Jan 15 12:03:28 2013 -0800
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/config.h.in
new/xf86-input-vmmouse-13.1.0/config.h.in
--- old/xf86-input-vmmouse-13.0.0/config.h.in 2013-01-15 21:08:22.000000000
+0100
+++ new/xf86-input-vmmouse-13.1.0/config.h.in 2015-06-25 12:27:50.000000000
+0200
@@ -14,6 +14,21 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `ioperm' function. */
+#undef HAVE_IOPERM
+
+/* Define to 1 if you have the `iopl' function. */
+#undef HAVE_IOPL
+
+/* Define to 1 if you have the `amd64' library (-lamd64). */
+#undef HAVE_LIBAMD64
+
+/* Define to 1 if you have the `i386' library (-li386). */
+#undef HAVE_LIBI386
+
+/* Has libudev installed */
+#undef HAVE_LIBUDEV
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
@@ -84,5 +99,23 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* BSD AMD64 iopl */
+#undef USE_AMD64_IOPL
+
+/* BSD /dev/io */
+#undef USE_DEV_IO
+
+/* BSD i386 iopl */
+#undef USE_I386_IOPL
+
/* Version number of package */
#undef VERSION
+
+/* Building for BSD flavour */
+#undef VMMOUSE_OS_BSD
+
+/* Building for iopl / ioperm capable OS */
+#undef VMMOUSE_OS_GENERIC
+
+/* Building for Solaris flavour */
+#undef VMMOUSE_OS_SOLARIS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/configure.ac
new/xf86-input-vmmouse-13.1.0/configure.ac
--- old/xf86-input-vmmouse-13.0.0/configure.ac 2013-01-15 21:01:01.000000000
+0100
+++ new/xf86-input-vmmouse-13.1.0/configure.ac 2015-06-25 12:26:44.000000000
+0200
@@ -20,9 +20,9 @@
#
# Process this file with autoconf to produce a configure script
-AC_PREREQ(2.57)
+AC_PREREQ(2.60)
AC_INIT([xf86-input-vmmouse],
- [13.0.0],
+ [13.1.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-input-vmmouse)
@@ -32,7 +32,10 @@
AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
+# XORG_DEFAULT_OPTIONS below forces C99. Solaris GCC doesn't like that.
+AC_PROG_CC
+AC_PROG_CC_C89
+save_solaris_cc=$CC
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
@@ -46,12 +49,11 @@
# Checks for programs.
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
-AC_PROG_CC
AH_TOP([#include "xorg-server.h"])
AC_ARG_WITH(xorg-module-dir,
- AC_HELP_STRING([--with-xorg-module-dir=DIR],
+ AS_HELP_STRING([--with-xorg-module-dir=DIR],
[Default xorg module directory
[[default=$libdir/xorg/modules]]]),
[moduledir="$withval"],
[moduledir="$libdir/xorg/modules"])
@@ -59,7 +61,7 @@
AC_SUBST(inputdir)
AC_ARG_WITH(xorg-conf-dir,
- AC_HELP_STRING([--with-xorg-conf-dir=DIR],
+ AS_HELP_STRING([--with-xorg-conf-dir=DIR],
[Default xorg.conf.d directory [[default=from
$PKG_CONFIG xorg-server]]]),
[XORG_CONF_DIR="$withval"],
[XORG_CONF_DIR="`$PKG_CONFIG --variable=sysconfigdir
xorg-server`"])
@@ -67,7 +69,7 @@
AM_CONDITIONAL(HAS_XORG_CONF_DIR, [test "x$XORG_CONF_DIR" != "x" && test
"x$XORG_CONF_DIR" != "xno"])
AC_ARG_WITH(hal-bin-dir,
- AC_HELP_STRING([--with-hal-bin-dir=DIR],
+ AS_HELP_STRING([--with-hal-bin-dir=DIR],
[Directory where HAL binaries where installed
[[default=$bindir]]]),
[halbindir="$withval"],
[halbindir="$bindir"])
@@ -75,7 +77,7 @@
AC_SUBST(HAL_BIN_DIR)
AC_ARG_WITH(hal-callouts-dir,
- AC_HELP_STRING([--with-hal-callouts-dir=DIR],
+ AS_HELP_STRING([--with-hal-callouts-dir=DIR],
[Directory where HAL expects its callout scripts to
be located
[[default=$libdir/hal]]]),
[halcalloutsdir="$withval"],
@@ -84,7 +86,7 @@
AC_SUBST(HAL_CALLOUTS_DIR)
AC_ARG_WITH(hal-fdi-dir,
- AC_HELP_STRING([--with-hal-fdi-dir=DIR],
+ AS_HELP_STRING([--with-hal-fdi-dir=DIR],
[Directory where HAL expects its fdi files to be
located
[[default=$datadir/hal/fdi/policy/20thirdparty]]]),
[halfdidir="$withval"],
@@ -92,17 +94,14 @@
HAL_FDI_DIR=${halfdidir}
AC_SUBST(HAL_FDI_DIR)
-
-PKG_CHECK_MODULES(UDEV, udev,
- [UDEV_RULES_DIR="`$PKG_CONFIG --variable=udevdir
udev`/rules.d"],
- [UDEV_RULES_DIR=no])
-
+# Udev location for rules directory
AC_ARG_WITH(udev-rules-dir,
- AC_HELP_STRING([--with-udev-rules-dir=DIR],
- [Default udev rules.d directory
- [[default=($prefix)/lib/udev/rules.d on Linux, none
otherwise]]]),
- [UDEV_RULES_DIR="$withval"],
- [])
+ AS_HELP_STRING([--with-udev-rules-dir=DIR],
+ [Directory where udev expects its rules files
+ [[default=$libdir/udev/rules.d]]]),
+ [udevdir="$withval"],
+ [udevdir="$libdir/udev/rules.d"])
+UDEV_RULES_DIR=${udevdir}
AC_SUBST(UDEV_RULES_DIR)
AM_CONDITIONAL(HAS_UDEV_RULES_DIR, [test "x$UDEV_RULES_DIR" != "xno"])
@@ -111,6 +110,75 @@
XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
# Checks for pkg-config packages
+libudev_check=yes
+AC_ARG_WITH([libudev],
+ [AS_HELP_STRING([--without-libudev],
+ [Use to build without libudev on linux])],
+ [if test x$withval = xno; then libudev_check=no; fi]
+ [])
+
+case $host_os in
+ linux*)
+ if test $libudev_check != no; then
+ PKG_CHECK_MODULES(LIBUDEV, [libudev],
+ [AC_DEFINE([HAVE_LIBUDEV], 1,
+ [Has libudev installed])],
+ []);
+ fi
+ AC_CHECK_FUNCS(ioperm iopl,[],
+ [AC_MSG_ERROR
+ ([cannot determine how to elevate io permissions)]],[1])
+ AC_DEFINE(VMMOUSE_OS_GENERIC, 1,
+ [Building for iopl / ioperm capable OS])
+ ;;
+ *bsd*)
+ AC_DEFINE(VMMOUSE_OS_BSD, 1, [Building for BSD flavour])
+ ;;
+ solaris*)
+ if test "x$GCC" == "xyes"; then
+ CC="$save_solaris_cc -fms-extensions"
+ fi
+ AC_DEFINE(VMMOUSE_OS_SOLARIS, 1, [Building for Solaris flavour])
+ ;;
+ *)
+ AC_CHECK_FUNCS(ioperm iopl,[],
+ [AC_MSG_ERROR
+ ([cannot determine how to elevate io permissions)]],[1])
+ AC_DEFINE(VMMOUSE_OS_GENERIC, 1)
+ ;;
+esac
+
+case $host_cpu in
+ i*86)
+ case $host_os in
+ *freebsd*) AC_DEFINE(USE_DEV_IO) ;;
+ *netbsd*) AC_DEFINE(USE_I386_IOPL)
+ use_i386_iopl=yes ;;
+ *openbsd*) AC_DEFINE(USE_I386_IOPL)
+ use_i386_iopl=yes ;;
+ esac
+ ;;
+ x86_64*|amd64*)
+ case $host_os in
+ *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
+ *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl])
+ use_i386_iopl=yes ;;
+ *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl])
+ use_amd64_iopl=yes ;;
+ esac
+ ;;
+esac
+
+if test x$use_i386_iopl = xyes; then
+ AC_CHECK_LIB(i386, i386_iopl,[],
+ [AC_MSG_ERROR([cannot find library for i386_iopl])])
+fi
+
+if test x$use_amd64_iopl = xyes; then
+ AC_CHECK_LIB(amd64, amd64_iopl,[],
+ [AC_MSG_ERROR([cannot find library for amd64_iopl])])
+fi
+
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES)
PKG_CHECK_EXISTS([xorg-server >= 1.1.0],
@@ -137,4 +205,11 @@
# Checks for header files.
AC_HEADER_STDC
-AC_OUTPUT([Makefile shared/Makefile src/Makefile tools/Makefile fdi/Makefile
man/Makefile])
+AC_CONFIG_FILES([Makefile
+ shared/Makefile
+ src/Makefile
+ tools/Makefile
+ fdi/Makefile
+ man/Makefile])
+
+AC_OUTPUT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/shared/vmmouse_client.c
new/xf86-input-vmmouse-13.1.0/shared/vmmouse_client.c
--- old/xf86-input-vmmouse-13.0.0/shared/vmmouse_client.c 2013-01-15
19:36:50.000000000 +0100
+++ new/xf86-input-vmmouse-13.1.0/shared/vmmouse_client.c 2015-04-08
16:24:05.000000000 +0200
@@ -35,6 +35,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "vmmouse_client.h"
#include "vmmouse_proto.h"
@@ -188,6 +192,13 @@
}
/*
+ * Restrict access to the VMMouse backdoor handler.
+ */
+ vmpc.in.vEbx = VMMOUSE_RESTRICT_IOPL;
+ vmpc.in.command = VMMOUSE_PROTO_CMD_ABSPOINTER_RESTRICT;
+ VMMouseProto_SendCmd(&vmpc);
+
+ /*
* To quote Jeremy, "Go Go Go!"
*/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/shared/vmmouse_client.h
new/xf86-input-vmmouse-13.1.0/shared/vmmouse_client.h
--- old/xf86-input-vmmouse-13.0.0/shared/vmmouse_client.h 2013-01-15
19:36:50.000000000 +0100
+++ new/xf86-input-vmmouse-13.1.0/shared/vmmouse_client.h 2014-10-08
12:09:05.000000000 +0200
@@ -39,6 +39,7 @@
#ifndef _VMMOUSE_CLIENT_H_
#define _VMMOUSE_CLIENT_H_
+#include "xorg-server.h"
#include "xf86_OSproc.h"
/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/shared/vmmouse_defs.h
new/xf86-input-vmmouse-13.1.0/shared/vmmouse_defs.h
--- old/xf86-input-vmmouse-13.0.0/shared/vmmouse_defs.h 2013-01-15
19:36:50.000000000 +0100
+++ new/xf86-input-vmmouse-13.1.0/shared/vmmouse_defs.h 2015-01-15
10:24:43.000000000 +0100
@@ -69,4 +69,11 @@
#define VMMOUSE_RIGHT_BUTTON 0x10
#define VMMOUSE_MIDDLE_BUTTON 0x08
+/*
+ * VMMouse Restrict command
+ */
+#define VMMOUSE_RESTRICT_ANY 0x00
+#define VMMOUSE_RESTRICT_CPL0 0x01
+#define VMMOUSE_RESTRICT_IOPL 0x02
+
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/shared/vmmouse_proto.c
new/xf86-input-vmmouse-13.1.0/shared/vmmouse_proto.c
--- old/xf86-input-vmmouse-13.0.0/shared/vmmouse_proto.c 2013-01-15
19:36:50.000000000 +0100
+++ new/xf86-input-vmmouse-13.1.0/shared/vmmouse_proto.c 2014-10-08
09:41:22.000000000 +0200
@@ -33,6 +33,10 @@
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "vmmouse_proto.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/shared/vmmouse_proto.h
new/xf86-input-vmmouse-13.1.0/shared/vmmouse_proto.h
--- old/xf86-input-vmmouse-13.0.0/shared/vmmouse_proto.h 2013-01-15
19:36:50.000000000 +0100
+++ new/xf86-input-vmmouse-13.1.0/shared/vmmouse_proto.h 2015-01-15
10:39:59.000000000 +0100
@@ -36,11 +36,6 @@
#ifndef _VMMOUSE_PROTO_H_
#define _VMMOUSE_PROTO_H_
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <stdint.h>
#ifdef HAVE_XORG_SERVER_1_1_0
@@ -69,6 +64,7 @@
#define VMMOUSE_PROTO_CMD_ABSPOINTER_DATA 39
#define VMMOUSE_PROTO_CMD_ABSPOINTER_STATUS 40
#define VMMOUSE_PROTO_CMD_ABSPOINTER_COMMAND 41
+#define VMMOUSE_PROTO_CMD_ABSPOINTER_RESTRICT 86
#define DECLARE_REG32_STRUCT(_r) \
union { \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/src/vmmouse.c
new/xf86-input-vmmouse-13.1.0/src/vmmouse.c
--- old/xf86-input-vmmouse-13.0.0/src/vmmouse.c 2013-01-15 19:36:50.000000000
+0100
+++ new/xf86-input-vmmouse-13.1.0/src/vmmouse.c 2014-10-08 09:41:22.000000000
+0200
@@ -807,7 +807,16 @@
static void
VMMouseUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
{
+ MouseDevPtr pMse = pInfo->private;
+
xf86Msg(X_INFO, "VMWARE(0): VMMouseUnInit\n");
+
+ if (pMse) {
+ VMMousePrivPtr mPriv = (VMMousePrivPtr)pMse->mousePriv;
+ free(mPriv);
+ }
+
+ xf86DeleteInput(pInfo, flags);
}
@@ -859,10 +868,10 @@
btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
- btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
- btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
- btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT);
- btn_labels[7] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT);
+ btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
+ btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
+ btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT);
+ btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT);
/* other buttons are unknown */
#ifdef ABS_VALUATOR_AXES
@@ -1010,6 +1019,15 @@
usleep(300000);
break;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) * 100 +
GET_ABI_MINOR(ABI_XINPUT_VERSION) >= 1901
+ case DEVICE_ABORT:
+ if (pInfo->fd != -1) {
+ VMMousePrivPtr mPriv = (VMMousePrivPtr)pMse->mousePriv;
+ if( mPriv->vmmouseAvailable )
+ VMMouseClient_Disable();
+ break;
+ }
+#endif
}
return Success;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/tools/Makefile.am
new/xf86-input-vmmouse-13.1.0/tools/Makefile.am
--- old/xf86-input-vmmouse-13.0.0/tools/Makefile.am 2013-01-15
19:36:50.000000000 +0100
+++ new/xf86-input-vmmouse-13.1.0/tools/Makefile.am 2014-10-30
10:53:27.000000000 +0100
@@ -22,8 +22,11 @@
AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS)
-@DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c
-@DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib@[email protected]
+@DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c vmmouse_iopl.c
+@DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib@[email protected] \
+ @LIBUDEV_LIBS@
+@DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@
+
calloutsdir=$(HAL_CALLOUTS_DIR)
callouts_SCRIPTS = hal-probe-vmmouse
@@ -53,4 +56,4 @@
endif # HAS_UDEV_RULES_DIR
-EXTRA_DIST = $(udev_DATA).in hal-probe-vmmouse.in
+EXTRA_DIST = 69-xorg-vmmouse.rules.in hal-probe-vmmouse.in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/tools/vmmouse_detect.c
new/xf86-input-vmmouse-13.1.0/tools/vmmouse_detect.c
--- old/xf86-input-vmmouse-13.0.0/tools/vmmouse_detect.c 2013-01-15
19:36:50.000000000 +0100
+++ new/xf86-input-vmmouse-13.1.0/tools/vmmouse_detect.c 2015-04-08
18:00:29.000000000 +0200
@@ -26,13 +26,15 @@
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <signal.h>
#include "vmmouse_client.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+extern int vmmouse_uses_kernel_driver(void);
void
segvCB(int sig)
@@ -46,6 +48,9 @@
int
main(void)
{
+ if (vmmouse_uses_kernel_driver())
+ return 1;
+
/*
* If the vmmouse test is not run in a VMware virtual machine, it
* will segfault instead of successfully accessing the port.
@@ -53,6 +58,7 @@
signal(SIGSEGV, segvCB);
#if defined __i386__ || defined __x86_64__
+ (void) xf86EnableIO();
if (VMMouseClient_Enable()) {
VMMouseClient_Disable();
return 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/tools/vmmouse_iopl.c
new/xf86-input-vmmouse-13.1.0/tools/vmmouse_iopl.c
--- old/xf86-input-vmmouse-13.0.0/tools/vmmouse_iopl.c 1970-01-01
01:00:00.000000000 +0100
+++ new/xf86-input-vmmouse-13.1.0/tools/vmmouse_iopl.c 2015-04-09
08:04:46.000000000 +0200
@@ -0,0 +1,239 @@
+/*
+ * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1992 by David Dawes <[email protected]>
+ * Copyright 1992 by Jim Tsillas <[email protected]>
+ * Copyright 1992 by Rich Murphey <[email protected]>
+ * Copyright 1992 by Robert Baron <[email protected]>
+ * Copyright 1992 by Orest Zborowski <[email protected]>
+ * Copyright 1993 by Vrije Universiteit, The Netherlands
+ * Copyright 1993 by David Wexelblat <[email protected]>
+ * Copyright 1994, 1996 by Holger Veit <[email protected]>
+ * Copyright 1997 by Takis Psarogiannakopoulos <[email protected]>
+ * Copyright 1994-2003 by The XFree86 Project, Inc
+ * Copyright 1999 by David Holland <[email protected]>
+ * Copyright 2015 by VMware Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of the above listed copyright holders
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holders make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <stdbool.h>
+
+#if defined(VMMOUSE_OS_BSD)
+#include <sys/types.h>
+#ifdef USE_I386_IOPL
+#include <machine/sysarch.h>
+/***************************************************************************/
+/* I/O Permissions section */
+/***************************************************************************/
+static bool ExtendedEnabled = false;
+
+bool
+xf86EnableIO()
+{
+ if (ExtendedEnabled)
+ return true;
+
+ if (i386_iopl(1) < 0)
+ return false;
+
+ ExtendedEnabled = true;
+ return true;
+}
+
+void
+xf86DisableIO()
+{
+ if (!ExtendedEnabled)
+ return;
+
+ i386_iopl(0);
+
+ ExtendedEnabled = false;
+ return;
+}
+
+#endif /* USE_I386_IOPL */
+
+#ifdef USE_AMD64_IOPL
+#include <machine/sysarch.h>
+/***************************************************************************/
+/* I/O Permissions section */
+/***************************************************************************/
+
+static bool ExtendedEnabled = false;
+
+bool
+xf86EnableIO()
+{
+ if (ExtendedEnabled)
+ return true;
+
+ if (amd64_iopl(1) < 0)
+ return false;
+
+ ExtendedEnabled = true;
+ return true;
+}
+
+void
+xf86DisableIO()
+{
+ if (!ExtendedEnabled)
+ return;
+
+ if (amd64_iopl(0) == 0)
+ ExtendedEnabled = false;
+
+ return;
+}
+
+#endif /* USE_AMD64_IOPL */
+
+#ifdef USE_DEV_IO
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+static int IoFd = -1;
+
+bool
+xf86EnableIO()
+{
+ if (IoFd >= 0)
+ return true;
+
+ if ((IoFd = open("/dev/io", O_RDWR)) == -1)
+ return false;
+
+ return true;
+}
+
+void
+xf86DisableIO()
+{
+ if (IoFd < 0)
+ return;
+
+ close(IoFd);
+ IoFd = -1;
+ return;
+}
+#endif
+
+#elif defined(VMMOUSE_OS_GENERIC)
+
+static bool ExtendedEnabled = false;
+
+extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on);
+extern int iopl(int __level);
+
+bool xf86EnableIO(void)
+{
+ if (ExtendedEnabled)
+ return true;
+
+ if (ioperm(0, 1024, 1) || iopl(3))
+ return false;
+
+ ExtendedEnabled = true;
+ return true;
+}
+
+void
+xf86DisableIO(void)
+{
+ if (!ExtendedEnabled)
+ return;
+
+ iopl(0);
+ ioperm(0, 1024, 0);
+ ExtendedEnabled = false;
+
+ return;
+}
+
+#elif defined(VMMOUSE_OS_SOLARIS)
+
+#ifdef __GNUC__
+#if defined(__sun) && !defined(sun)
+#define sun 1
+#endif
+#if defined(__SVR4) && !defined(SVR4)
+#define SVR4 1
+#endif
+#endif
+/*
+ * The below sequence of includes is stolen from Xserver. If it doesn't work
+ * for your setup, please propose a patch to fix it.
+ */
+#include <sys/types.h>
+#include <errno.h>
+#if !(defined (sun) && defined (SVR4))
+#include <sys/immu.h>
+#include <sys/region.h>
+#include <sys/proc.h>
+#endif
+#include <sys/tss.h>
+#include <sys/sysi86.h>
+#if defined(SVR4) && !defined(sun)
+#include <sys/seg.h>
+#endif /* SVR4 && !sun */
+/* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */
+#if !defined(V86SC_IOPL) /* Solaris 7 or later? */
+#include <sys/v86.h> /* Nope */
+#endif
+#if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86))
&& defined (SVR4)
+#include <sys/psw.h>
+#endif
+
+static bool ExtendedEnabled = false;
+
+bool
+xf86EnableIO(void)
+{
+ if (ExtendedEnabled)
+ return true;
+
+ if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0)
+ return false;
+
+ ExtendedEnabled = true;
+
+ return true;
+}
+
+void
+xf86DisableIO(void)
+{
+ if(!ExtendedEnabled)
+ return;
+
+ sysi86(SI86V86, V86SC_IOPL, 0);
+
+ ExtendedEnabled = false;
+}
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-vmmouse-13.0.0/tools/vmmouse_udev.c
new/xf86-input-vmmouse-13.1.0/tools/vmmouse_udev.c
--- old/xf86-input-vmmouse-13.0.0/tools/vmmouse_udev.c 1970-01-01
01:00:00.000000000 +0100
+++ new/xf86-input-vmmouse-13.1.0/tools/vmmouse_udev.c 2015-01-22
08:40:38.000000000 +0100
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2014 by VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_LIBUDEV
+#include <libudev.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define KERNEL_DEVNAME "VirtualPS/2 VMware VMMouse"
+
+/**
+ * vmmouse_uses_kernel_driver - Check whether there's an active
+ * vmmouse driver in the kernel.
+ *
+ * Returns 0 if there was no kernel driver found.
+ * Returns non-zero on error or if there was an active driver found.
+ *
+ * Scans the input subsystem for devices matching KERNEL_DEVNAME. These
+ * devices are assumed to be active vmmouse drivers.
+ */
+int vmmouse_uses_kernel_driver(void)
+{
+ struct udev *udev;
+ struct udev_enumerate *enumerate;
+ struct udev_list_entry *devices, *dev_list_entry;
+ struct udev_device *dev;
+
+ udev = udev_new();
+ if (!udev)
+ return 1;
+
+ /*
+ * Udev error return codes that are not caught immediately are
+ * typically caught in the input argument check in the udev
+ * function calls following the failing call!
+ */
+ enumerate = udev_enumerate_new(udev);
+ if (udev_enumerate_add_match_subsystem(enumerate, "input"))
+ goto out_err;
+ if (udev_enumerate_scan_devices(enumerate))
+ goto out_err;
+
+ devices = udev_enumerate_get_list_entry(enumerate);
+ udev_list_entry_foreach(dev_list_entry, devices) {
+ const char *path, *name;
+
+ path = udev_list_entry_get_name(dev_list_entry);
+ dev = udev_device_new_from_syspath(udev, path);
+ if (!dev)
+ goto out_err;
+ name = udev_device_get_sysattr_value(dev, "name");
+ if (name && !strcasecmp(name, KERNEL_DEVNAME))
+ goto out_found;
+
+ udev_device_unref(dev);
+ }
+
+ udev_enumerate_unref(enumerate);
+ udev_unref(udev);
+
+ return 0;
+
+ out_found:
+ udev_device_unref(dev);
+ out_err:
+ udev_enumerate_unref(enumerate);
+ udev_unref(udev);
+
+ return 1;
+}
+#else
+int vmmouse_uses_kernel_driver(void)
+{
+ return 0;
+}
+#endif