Commit Graph

554 Commits

Author SHA1 Message Date
Eamon Walsh
a470e8426e Correct outdated e-mail address in "Author" statements.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-09-02 17:56:52 -04:00
Jerome Glisse
0e46066efe Xext: fix a typo for bigreqsproto.h header file
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2009-09-01 13:59:47 +02:00
Jeremy Huddleston
c61d8ce150 Xext: Require newer versions of xcmiscproto, bigreqsproto, and xf86bigfontproto for new *proto.h header file names
bigreqsproto >= 1.1.0
xcmiscproto >= 1.2.0
xf86bigfontproto >= 1.2.0
2009-08-31 18:44:53 -07:00
Peter Hutterer
903c3db1d1 Xext: rename Xtst* to XTest*
This patch corrects a misnaming of XTest-related functions.

The extension itself announces itself as XTEST. Xtst is the library name
itself, but all library functions are prefixed by XTest. Same with the
naming in the server.

- Rename all *Xtst* functions to *XTest* for consistency with the library
  and in-server API.
- Rename the "Xtst device" property to "XTEST device" for consistency with
  the extension naming.
- Rename the device naming to "<master device name> XTEST device". The
  default xtest devices become "Virtual core XTEST pointer" and "Virtual
  core XTEST keyboard".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27 14:24:51 +10:00
Peter Hutterer
8bfd23e144 input: move XTest device initialization into Xext/xtest.c
XTest devices are non-optional but nonetheless specific to the XTEST
extension.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27 14:24:50 +10:00
Peter Hutterer
990d204ef8 Xext: remove un-used extern of DeviceMotionNotify.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24 10:15:00 +10:00
Eamon Walsh
73975ef3a3 xselinux: Allow per-client device create contexts.
The previous behavior was to set the serverClient's value which was used globally.
This is in support of XI2, where clients can create device pairs directly.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-08-17 14:51:10 -04:00
Eamon Walsh
66e32d252c xselinux: Add more new device permissions for XI2.
Reflects the ability of clients to create/destroy device objects.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-08-17 14:51:10 -04:00
Richard Hughes
c1d901d723 Don't reset the lastDeviceEventTime when doing DPMS actions
When we change the DPMS mode, don't play games with the last event time as
this breaks applications using IDLETIME to turn the backlight off after a
preset time.

This patch fixes gnome-power-manager and xfce-power-manager

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-17 11:18:38 +10:00
Peter Hutterer
db568f9eab Xext: fix up wrong conditions for negative sync transitions.
If the counter had a value higher than the trigger value for a negative
transition, the trigger value did not get set.

The correct sequence of checks is:
if (positive transition)
   if (counter value < trigger value)
      set up trigger
if (negative transition)
   if (counter value > trigger value)
      set up trigger

Red Hat Bug 501601 <https://bugzilla.redhat.com/show_bug.cgi?id=501601>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-14 07:49:52 +10:00
Peter Hutterer
36e24a6d93 Xext: add missing return code check to ProcSyncDestroyAlarm
Introduced with 57aff88c7d.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13 11:19:37 +10:00
Peter Hutterer
e46f02fa2d Xext: allocate a separate event list for XTest events (#23100)
XTest event processing may be interrupted by a SIGIO. If Xtest uses the same
event list as the rest of the server, this list may be overwritten
in-flight.

X.Org Bug 23100 <http://bugs.freedesktop.org/show_bug.cgi?id=23100>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13 11:19:35 +10:00
Peter Hutterer
4db8950b1d Xext: include securproto.h instead of securstr.h
Reported-by: Byeong-ryeol Kim
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-17 14:40:54 +10:00
Peter Hutterer
d3f6b43a24 Update to xextproto 7.0.99.1.
xextproto had Xlib client headers moved into libXext.
Protocol header files are named fooproto.h, header files with constants
foo.h or fooconst.h where foo.h was already in use for client-side headers.
2009-07-15 17:00:05 +10:00
Peter Hutterer
7b9e84e320 Xext: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 10:14:01 +10:00
Michael Lorenz
36dc66ae79 The way XaceHook() mixes struct initializers and va_arg() is not portable and
gives bogus data on sparc and probably others leading to a crash.

Fix:
Don't use initializers, instead set each member directly to enforce order.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-07-07 20:21:39 -04:00
Peter Hutterer
89cf81cd85 Xext: return BadValue for XTestFakeInput on unsupported capabilities.
Calling XTestFakeDevice*Event on a device that doesn't allow the matching
event returns BadValue.

Reported-by: Florian Echtler
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-06 12:59:42 +10:00
Peter Hutterer
744bb55982 Xext: remove unused variable 'it'.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-06 12:58:03 +10:00
Peter Hutterer
0814f511d5 input: store the master device's ID in the devPrivate for XTest devices.
Rather than storing a simple boolean in the devPrivate for XTest devices,
store the actual master device's id (since it is constant for the life of
the device anyway).

Callers should use GetXtstDevice now instead of digging around in the
devPrivates themselves.

This patch allows for a cleanup in the creation of new master devices since
GetMaster and GetXtstDevice spare the need for loops, IsPointer checks and
similar.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Close <Benjamin.Close@clearchain.com>
2009-07-01 08:46:31 +10:00
Eamon Walsh
51105de9b0 xselinux: ignore property hook calls with the new Post access mode bit set.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-26 17:05:52 -04:00
Eamon Walsh
3efb23a6c4 xselinux: Add new device permissions for XI2.
Refects the ability of clients to add/remove devices and device properties.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-18 20:56:19 -04:00
Eamon Walsh
1e060c3d8b xselinux: Move the security class mapping to the header file.
Take the mapping of DixAccess bits to Flask permissions, move it
into the header file, break up the extremely long lines, and
annotate the permission names with the bit being referenced.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-18 20:56:18 -04:00
Peter Hutterer
d7aef3f663 Merge branch 'master' into xi2
Conflicts:
	Xext/geext.c
	Xi/chdevcur.c
	Xi/extgrbdev.c
	Xi/xiproperty.c
	configure.ac
	dix/ptrveloc.c
	hw/xfree86/common/xf86Config.c
	mi/mipointer.h
	test/input.c
	xkb/xkb.c
2009-05-28 17:20:58 +10:00
Peter Hutterer
b12d302df8 Input: rename DeviceIntRec->isMaster to ->type.
isMaster is not enough as long as we differ between master pointers and
keyboard. With flexible device classes, the usual checks for whether a
master device is a pointer (currently check for ->button, ->valuators or
->key) do not work as an SD may post an event through a master and mess this
check up.

Example, a device with valuators but no buttons would remove the button
class from the VCP and thus result in the
IsPointerDevice(inputInfo.pointer) == FALSE.

This will become worse in the future when new device classes are introduced
that aren't provided in the current system (e.g. a switch class).

This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and
MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an
IsMaster(dev).
2009-05-22 15:44:50 +10:00
Eamon Walsh
0952d12717 xselinux: Relax ownership restriction on SetSelectionUseContext.
Instead, clients should keep track of the selection instances they use.
2009-05-11 15:27:46 -04:00
Alan Coopersmith
b680bda34d Fix a couple off-by-one array boundary checks.
Error: Write outside array bounds at Xext/geext.c:406
        in function 'GEWindowSetMask' [Symbolic analysis]
       In array dereference of cli->nextSib[extension] with index 'extension'
       Array size is 128 elements (of 4 bytes each), index <= 128

Error: Buffer overflow at dix/events.c:592
	in function 'SetMaskForEvent' [Symbolic analysis]
       In array dereference of filters[deviceid] with index 'deviceid'
       Array size is 20 elements (of 512 bytes each), index >= 0 and index <= 20

Error: Read buffer overflow at hw/xfree86/loader/loader.c:226
	in function 'LoaderOpen' [Symbolic analysis]
       In array dereference of refCount[new_handle] with index 'new_handle'
       Array size is 256 elements (of 4 bytes each), index >= 1 and index <= 256

These bugs were found using the Parfait source code analysis tool.
For more information see http://research.sun.com/projects/parfait

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 12:27:11 -07:00
Peter Hutterer
a38d33f6ac Xext: shut up compiler warnings in xtest.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-05 14:12:04 +10:00
Peter Hutterer
14d5471981 Xext: return BadDevice from XTest if we don't have keys/buttons/valuators.
BadDevice is an XI error, but this cannot happen for core XTest fake input
anyway since the device will be the matching virtual XTest slave device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-05 14:12:04 +10:00
Peter Hutterer
f1bed0959e Xext: fix core Xtest button presses, don't call PickPointer.
We already did the device selection before, so dev should be the XTest virtual
pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-05 14:12:04 +10:00
Peter Hutterer
63a3c727b3 Xext: shut up compiler warnings in xtest.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-04 15:21:39 +10:00
Peter Hutterer
226dd90597 Xext: return BadDevice from XTest if we don't have keys/buttons/valuators.
BadDevice is an XI error, but this cannot happen for core XTest fake input
anyway since the device will be the matching virtual XTest slave device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-04 15:21:39 +10:00
Peter Hutterer
0fdff0a47a Xext: fix core Xtest button presses, don't call PickPointer.
We already did the device selection before, so dev should be the XTest virtual
pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-04 15:21:39 +10:00
Eamon Walsh
57aff88c7d Fix most remaining deprecated resource lookups.
Callsites updated to use dixLookupResourceBy{Type,Class}.
TODO: Audit access modes to make sure they reflect the usage.
2009-04-29 01:04:37 -04:00
Peter Hutterer
057fc9a4f8 Merge branch 'master' into xi2
Conflicts:
	Xi/chdevhier.c
	include/input.h
2009-04-24 16:15:47 +10:00
Benjamin Close
fab563bf8f input: propagate XTst events through virtual slave devices.
A XTest virtual slave device pair (kbd/ptr) exists for every master
device pair. This is so XTest events are correctly propogated via slave
devices up to Master devices and the classes are correctly changed along
the way. We add the XTest slave device pair to the Virtual Core pointer
and provide a simple way of creating the devices.

A XTest Slave Device is identified by the XTstDevicePrivateKey property
being set in the devices devProperties

XI events are still propagated through the matching device, in the hope the
client knows what it is doing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-24 15:28:33 +10:00
Peter Hutterer
d5ad14c8ed Merge branch 'master' into xi2 2009-04-19 22:28:22 +10:00
Eamon Walsh
4559d2ace6 security: Grant untrusted windows remove access on all windows.
This allows untrusted clients to destroy their own windows when they
have been reparented by a trusted window manager.
2009-04-16 23:46:01 -04:00
Eamon Walsh
3481b32ab9 security: Fix a crash caused by wrong ordering of format arguments. 2009-04-16 23:46:01 -04:00
Eamon Walsh
6045506be0 security: Revert behavior of extension access for compatibility.
Previously, three extensions were defined as "trusted" by the extension:
BIG-REQUESTS, XC-MISC, and XPrint.  No other extensions were permitted
to be used by untrusted clients.

In commit 8b5d21cc1d this was changed for
some reason.  Return to the old, compatible behavior.
2009-04-16 23:46:00 -04:00
Eamon Walsh
682d7b5569 xselinux: Don't BadAlloc in List* requests if there are no items to list. 2009-04-09 02:48:04 -04:00
Eamon Walsh
e8b324102f xselinux: Don't require incoming context strings to be null-terminated. 2009-04-08 15:10:16 -04:00
Peter Hutterer
6c3b633299 Merge branch 'master' into xi2 2009-04-07 19:36:27 +10:00
Adam Jackson
e25d55ad54 Revert accidental Makefile change from previous commit 2009-04-03 22:38:00 -04:00
Adam Jackson
472811dc4b DPMS: Re-export the various DPMS variables.
The drivers might not need them but extmod does.  Should move it to
builtin though.
2009-04-03 22:27:51 -04:00
Adam Jackson
2d0a4fff79 DPMS: Remove unused DPMSGet() 2009-04-03 18:22:20 -04:00
Adam Jackson
4da347adb1 DPMS: Code motion. 2009-04-03 18:22:19 -04:00
Adam Jackson
283a081572 selinux: Only activate if policy says to be an object manager 2009-03-27 15:56:15 -04:00
Peter Hutterer
603db34337 Xext: set POINTER_SCREEN flag in XTestFakeInput if necessary. (RH #490984)
The POINTER_SCREEN flag must be set explicitly for XTest core events to avoid
out-of-range events when the lastSlave was an SD with an explicit axis range.
Device events sent through XTest don't need this flag, they are expected to be
in the valuator range of the device anyway.

Red Hat Bug 490984 <https://bugzilla.redhat.com/show_bug.cgi?id=490984>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-27 11:26:15 +10:00
Peter Hutterer
6b6b660c36 Xext: remove ev_fill from GEExtensions. 2009-03-20 15:17:54 +10:00
Peter Hutterer
445daa62e7 Xext: purge XGE event masks.
The masks were originally designed to generically handle event masks for
extensions. Since all that is in-server anyway, it's much better writing
custom event masks for those extensions that need it and not providing a
unified mechanism.
XI2 needs more than the current implementation, which is already too complex
for most other extensions. good riddance.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:53 +10:00