Commit Graph

181 Commits

Author SHA1 Message Date
Matthieu Herrb 07a0acd246 xkb: Fix buffer overflow in _XkbSetCompatMap()
The _XkbSetCompatMap() function attempts to resize the `sym_interpret`
buffer.

However, It didn't update its size properly. It updated `num_si` only,
without updating `size_si`.

This may lead to local privilege escalation if the server is run as root
or remote code execution (e.g. x11 over ssh).

CVE-2024-9632, ZDI-CAN-24756

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1733>
2024-10-31 16:24:41 +01:00
Enrico Weigelt, metux IT consult 5c96b80a8d (!1695) dix: unexport Ones()
It's not used by any module/driver, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 77f7e06508 (submit/extDevReason) xkb: drop unused variable extDevReason
fix warning on unused variable:

> ../xkb/xkb.c:3576:18: warning: variable 'extDevReason' set but not used [-Wunused-but-set-variable]
>     unsigned int extDevReason;
                 ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 8fa7192799 (submit/xkb-errmacro) xkb: move _XkbErrCode3() and _XkbErrCode4()
These are only used inside xkb.c, nowhere else, so no need to
keep them in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 31c8867db4 (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H
The symbol controls whether to include dix-config.h, and it's always set,
thus we don't need it (and dozens of ifdef's) anymore.

This commit only removes them from our own source files, where we can
guarantee that dix-config.h is present - leaving the (potentially exported)
headers untouched.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 66f6f49263 (submit/miext-extinit) miext: move over extinit_priv.h from include
Since most of the extension init logic (and on/off switches for them)
is driven from miext, this seems the appropriate place for the header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 31e693ca2c (!1639) xkb: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult b2198df55a xkb: ProcXkbGetGeometry(): fix memleak
If XkbComputeGetGeometryReplySize() returns an error, the XkbGeometryRec won't
be freed, since we're bailing out too early and not calling XkbSendGeometry().

Having XkbSendGeometry() responsible for freeing that struct is unnecessarily
complicated anyways, so move that to ProcXkbGetGeometry() and do it also when
XkbComputeGetGeometryReplySize() failed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1622>
2024-07-25 18:04:01 +02:00
Enrico Weigelt, metux IT consult 47d6c3ad75 xace: typesafe hook function for XACE_SERVER_ACCESS
he generic XaceHook() call isn't typesafe (und unnecessarily slow).
Better add an explicit function, just like we already have for others.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1556>
2024-06-23 21:07:48 +00:00
Enrico Weigelt, metux IT consult 9524ffee89 xace: typesafe hook function for XACE_DEVICE_ACCESS
The generic XaceHook() call isn't typesafe (und unnecessarily slow).
Better add an explicit function, just like we already have for others.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1556>
2024-06-23 21:07:48 +00:00
Enrico Weigelt, metux IT consult 33350ef8ff include: move private definitions out of extinit.h
Public server module API shouldn't be clobbered with private definitions,
thus move them out to extinit_priv.h.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1289>
2024-04-30 00:47:38 +00:00
Enrico Weigelt, metux IT consult d444cd4237 dix: unexport some lookup functions
These aren't used by any drivers, so no need to export them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1380>
2024-04-15 18:11:57 -07:00
Enrico Weigelt, metux IT consult bc90c44e60 xkb: fix int size mismatch
GCC reports:

../xkb/xkb.c: In function ‘_XkbSetMapCheckLength’:
../xkb/xkb.c:2464:54: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
 2464 |     ErrorF("[xkb] BOGUS LENGTH in SetMap: expected %ld got %ld\n",
      |                                                    ~~^
      |                                                      |
      |                                                      long int
      |                                                    %d
 2465 |            len, req_len);
      |            ~~~
      |            |
      |            size_t {aka unsigned int}
../xkb/xkb.c:2464:62: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
 2464 |     ErrorF("[xkb] BOGUS LENGTH in SetMap: expected %ld got %ld\n",
      |                                                            ~~^
      |                                                              |
      |                                                              long int
      |                                                            %d
 2465 |            len, req_len);
      |                 ~~~~~~~
      |                 |
      |                 size_t {aka unsigned int}

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1257>
2024-02-22 23:56:37 +00:00
Enrico Weigelt, metux IT consult 374ee7acd7 xkb: drop defining XKBSRV_NEED_FILE_FUNCS
No need to define XKBSRV_NEED_FILE_FUNCS, for about 15 years now
(since XKBsrv.h isn't used anymore), so drop it.

Fixes: e5f002edde
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-19 00:44:15 +00:00
FeepingCreature 79c572fbd3 xkb: Avoid length-check failure on empty strings.
_XkbCheckRequestBounds assumes that from..to is at least one byte.
However, request strings can be empty, causing spurious failures in
XkbGetKbdByName calls. To avoid this, before checking bounds make
sure that the length is nonzero.
2022-08-31 06:38:54 +00:00
Peter Hutterer 11beef0b7f xkb: proof GetCountedString against request length attacks
GetCountedString did a check for the whole string to be within the
request buffer but not for the initial 2 bytes that contain the length
field. A swapped client could send a malformed request to trigger a
swaps() on those bytes, writing into random memory.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-13 14:37:51 +10:00
Peter Hutterer 1bb7767f19 xkb: length-check XkbListComponents before accessing the fields
Each string length field was accessed before checking whether that byte
was actually part of the client request. No real harm here since it
would immediately fail with BadLength anyway, but let's be correct here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-13 11:38:16 +10:00
Peter Hutterer 44ae6f4419 xkb: length-check XkbGetKbdByName before accessing the fields
This request accessed &stuff[1] before length-checking everything. The
check was performed afterwards so invalid requests would return
BadLength anyway, but let's do this before we actually access the
memory.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-13 11:33:00 +10:00
Peter Hutterer 18f91b950e xkb: fix some possible memleaks in XkbGetKbdByName
GetComponentByName returns an allocated string, so let's free that if we
fail somewhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-13 11:32:07 +10:00
Peter Hutterer 6907b6ea2b xkb: add request length validation for XkbSetGeometry
No validation of the various fields on that report were done, so a
malicious client could send a short request that claims it had N
sections, or rows, or keys, and the server would process the request for
N sections, running out of bounds of the actual request data.

Fix this by adding size checks to ensure our data is valid.

ZDI-CAN 16062, CVE-2022-2319.

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-12 15:19:27 +03:00
Peter Hutterer dd8caf39e9 xkb: swap XkbSetDeviceInfo and XkbSetDeviceInfoCheck
XKB often uses a FooCheck and Foo function pair, the former is supposed
to check all values in the request and error out on BadLength,
BadValue, etc. The latter is then called once we're confident the values
are good (they may still fail on an individual device, but that's a
different topic).

In the case of XkbSetDeviceInfo, those functions were incorrectly
named, with XkbSetDeviceInfo ending up as the checker function and
XkbSetDeviceInfoCheck as the setter function. As a result, the setter
function was called before the checker function, accessing request
data and modifying device state before we ensured that the data is
valid.

In particular, the setter function relied on values being already
byte-swapped. This in turn could lead to potential OOB memory access.

Fix this by correctly naming the functions and moving the length checks
over to the checker function. These were added in 87c64fc5b0 to the
wrong function, probably due to the incorrect naming.

Fixes ZDI-CAN 16070, CVE-2022-2320.

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Introduced in c06e27b2f6

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-12 15:18:52 +03:00
Peter Hutterer f1070c01d6 xkb: switch to array index loops to moving pointers
Most similar loops here use a pointer that advances with each loop
iteration, let's do the same here for consistency.

No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2022-07-08 14:27:04 +00:00
Peter Hutterer 6f234c60d9 xkb: whitespace fixes
Sick of fighting vim and git from trying to add this fix with every
commit iteration...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2022-07-08 14:27:04 +00:00
Peter Hutterer a2762514b6 xkb: rename xkb.h to xkb-procs.h
This header merely defines the various protocol request handlers, so
let's rename it to something less generic and remove its include from
all the files that don't actually need it (which is almost all of them).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2022-07-08 14:27:04 +00:00
Samuel Thibault 0217cc6e0c xkb: fix XkbSetMap when changing a keysym without changing a keytype
As the comment says:

"symsPerKey/mapWidths must be filled regardless of client-side flags"

so we always have to call CheckKeyTypes which will notably fill mapWidths
and nTypes. That is needed for CheckKeySyms to work since it checks the
width. Without it, any request with XkbKeySymsMask but not
XkbKeyTypesMask will fail because of the missing width information, for
instance this:

  XkbDescPtr xkb;
  if (!(xkb = XkbGetMap (dpy, XkbKeyTypesMask|XkbKeySymsMask, XkbUseCoreKbd))) {
    fprintf (stderr, "ERROR getting map\n");
    exit(1);
  }
  XFlush (dpy);
  XSync (dpy, False);

  XkbMapChangesRec changes = { .changed = 0 };
  int oneGroupType[XkbNumKbdGroups] = { XkbOneLevelIndex };

  if (XkbChangeTypesOfKey(xkb, keycode, 1, XkbGroup1Mask, oneGroupType, &changes)) {
    fprintf(stderr, "ERROR changing type of key\n");
    exit(1);
  }
  XkbKeySymEntry(xkb,keycode,0,0) = keysym;

  if (!XkbChangeMap(dpy,xkb,&changes)) {
    fprintf(stderr, "ERROR changing map\n");
    exit(1);
  }

  XkbFreeKeyboard (xkb, 0, TRUE);
  XFlush (dpy);
  XSync (dpy, False);

This had being going under the radar since about ever until commit
de940e06f8 ("xkb: fix key type index check
in _XkbSetMapChecks") fixed checking the values of kt_index, which was
previously erroneously ignoring errors and ignoring all other checks, just
because nTypes was not set, precisely because CheckKeyTypes was not called.

Note: yes, CheckKeyTypes is meant to be callable without XkbKeyTypesMask, it
does properly check for that and just fills nTypes and mapWidths in that
case.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2022-02-03 21:44:37 +00:00
Peter Hutterer be16bd8543 xkb: fix XkbSetMap check for the keytypes count
The previous if/else condition resulted in us always setting the key
type count to the current number of key types. Split this up correctly.

Regression introduced in de940e06f8

Fixes #1249

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-12-03 00:33:23 +00:00
Ray Strode 8b7f4d3259 xkb: Drop check for XkbSetMapResizeTypes
Commit 446ff2d317 added checks to
prevalidate the size of incoming SetMap requests.

That commit checks for the XkbSetMapResizeTypes flag to be set before
allowing key types data to be processed.

key types data can be changed or even just sent wholesale unchanged
without the number of key types changing, however. The check for
XkbSetMapResizeTypes rejects those legitimate requests. In particular,
XkbChangeMap never sets XkbSetMapResizeTypes and so always fails now
any time XkbKeyTypesMask is in the changed mask.

This commit drops the check for XkbSetMapResizeTypes in flags when
prevalidating the request length.
2021-10-07 14:17:26 +00:00
Peter Hutterer 66ce61983d xkb: silence a compiler warning
xkb.c: In function ‘ProcXkbSetMap’:
xkb.c:2747:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
 2747 |     DeviceIntPtr master = GetMaster(dev, MASTER_KEYBOARD);

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-09 17:37:29 +00:00
Matthieu Herrb 446ff2d317 Check SetMap request length carefully.
Avoid out of bounds memory accesses on too short request.

ZDI-CAN 11572 /  CVE-2020-14360

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
2020-12-01 15:28:58 +01:00
Matthieu Herrb 87c64fc5b0 Fix XkbSetDeviceInfo() and SetDeviceIndicators() heap overflows
ZDI-CAN 11389 / CVE-2020-25712

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
2020-12-01 15:28:58 +01:00
Matthieu Herrb f7cd1276bb Correct bounds checking in XkbSetNames()
CVE-2020-14345 / ZDI 11428

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
2020-08-25 17:01:29 +02:00
Peter Harris de940e06f8 xkb: fix key type index check in _XkbSetMapChecks
This code block was moved from a function that returns 0 for failure to a
function that returns 0 for Success in commit
649293f6b6. Change the return value to
BadValue to match the other checks in _XkbSetMapChecks.

Set nTypes to xkb->map->num_types when XkbKeyTypesMask is not set, to
allow requests with the XkbKeyTypesMask flag unset in stuff->present to
succeed.

Fixes a potential heap smash when client->swapped is true, because the
remainder of the request will not be swapped after "return 0", but
_XkbSetMap will be called anyway (because 0 is Success).

Signed-off-by: Peter Harris <pharris@opentext.com>
2020-02-25 12:12:55 -05:00
Peter Harris 270e439739 xkb: only swap once in XkbSetMap
The server swaps part of the request in _XkbSetMapChecks instead of
SProcXkbSetMap (presumably because walking the XkbSetMap request is hard,
and we don't want to maintain another copy of that code).

Swap the first time _XkbSetMapChecks is called, not the second time.

Signed-off-by: Peter Harris <pharris@opentext.com>
2020-02-25 12:12:55 -05:00
Samuel Thibault fabc421962 Fix crash on XkbSetMap
Since group_info and width are used for the key actions allocations,
when modifying them we need to take care of reallocation key actions if
needed.
2019-07-01 02:33:26 +02:00
Samuel Thibault 8469bfead9 Fix crash on XkbSetMap
Some devices may not have keyboard information.

Fixes #574
2019-07-01 02:33:09 +02:00
Dave Airlie 7583939512 xkb: fix what looks to be a copy-paste error with first vs firstMM
Pointed out by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-09-12 12:26:48 +10:00
Samir Benmendil 5d3fd3856b xkb: XkbSetMap on the lastSlave needs to change the master
The layout needs to be set on the master too if the layout is changed on
the device that was last used by the master.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85256
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91571

Signed-off-by: Samir Benmendil <me@rmz.io>
Acked-by: Daniel Stone <daniels@collabora.com>
2018-03-05 13:41:29 -05:00
Adam Jackson c2c6e9e68a dix: Don't track the XKB client versions in the ClientRec
XKB stores some stuff in the ClientRec that, style-wise, should probably
be in a client private.  vMinor tracks the client's idea of the XKB
minor version, but is never read, we can just nuke it.  vMajor is only
used for a bug-compat workaround for X11R6.0-vintage clients.  We're
only using though (1<<4) for xkbClientFlags in the protocol, so we can
pack that field down to a u8 and store the bug-compat flag there.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2017-10-24 15:53:28 -04:00
Peter Hutterer d135100d6b xkb: add a cause to the xkb indicator update after a keymap change
Regression introduce by ac164e5887 which calls
XkbUpdateAllDeviceIndicators() with two NULL arguments. A few layers down into
the stack and we triggered a NULL-pointer dereference. In theory a NULL cause
is acceptable since we don't actually change modifier state here. Instead of
updating all places to check for NULL just set the cause to the client
request and go to the pub.

https://bugs.freedesktop.org/show_bug.cgi?id=96384

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-06-29 19:20:17 +10:00
Peter Hutterer ac164e5887 xkb: after changing the keymap, force an indicator update
When NumLock is on and a new keymap is applied, the next modifier state
change will turn off that LED (but leave the state enabled). The cause
for this is a bit convoluted:

* the SLI explicitState is copied from the current state in
  ProcXkbGetKbdByName. Thus, if NumLock is on, that state is 0x2.
* on the next modifier key press (e.g. Shift), XkbApplyState() calls into
  XkbUpdateIndicators() -> XkbUpdateLedAutoState() to update SLIs (if any)
  for the currently changed modifier. But it does so with a mask only for
  the changed modifier (i.e. for Shift).
* XkbUpdateLedAutoState() calculates the state based on this mask and
  ends up with 0 because we don't have a Shift LED and we masked out the
  others.
* XkbUpdateLedAutoState() compares that state with the previous state
  (which is still 0x2) and then proceeds to turn the LED off

This doesn't happen in the normal case because either the mask
encompasses all modifiers or the state matches of the masked-out
modifiers matches the old state.

Avoid this issue by forcing an SLI update after changing the keymap.
This updates the sli->effectiveState and thus restores everything to
happy working order.

https://bugzilla.redhat.com/show_bug.cgi?id=1047151

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-05-04 10:55:09 -04:00
Alan Coopersmith 4fe6b03b97 Convert XKB to new *allocarray functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
2015-04-21 16:57:54 -07:00
Olivier Fourdan 20079c36cf xkb: Check strings length against request size
Ensure that the given strings length in an XkbSetGeometry request remain
within the limits of the size of the request.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-10 14:28:28 -08:00
Olivier Fourdan 81c90dc8f0 xkb: Don't swap XkbSetGeometry data in the input buffer
The XkbSetGeometry request embeds data which needs to be swapped when the
server and the client have different endianess.

_XkbSetGeometry() invokes functions that swap these data directly in the
input buffer.

However, ProcXkbSetGeometry() may call _XkbSetGeometry() more than once
(if there is more than one keyboard), thus causing on swapped clients the
same data to be swapped twice in memory, further causing a server crash
because the strings lengths on the second time are way off bounds.

To allow _XkbSetGeometry() to run reliably more than once with swapped
clients, do not swap the data in the buffer, use variables instead.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-10 14:28:18 -08:00
Peter Hutterer 732fd7e571 Drop trailing whitespaces
sed -i "s/[ ]\+$//g" **/*.(c|h)

happy reviewing...
git diff -w is an empty diff.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Keith Packard da70c7d556 xkb: Initialize 'bad' Atom in _XkbSetNamesCheck
When _XkbCheckAtoms returns NULL for an error, it always sets the
error return code, but GCC can't figure that out, so just initialize
the local variable, 'bad', in _XkbSetNamesCheck to eliminate the warning.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-10-28 11:26:23 -07:00
Rui Matos d35a02a767 xkb: Repurpose XkbCopyDeviceKeymap to apply a given keymap to a device
This will also make it useful for cases when we have a new keymap to
apply to a device but don't have a source device.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-12 16:43:23 +10:00
Rui Matos 361f405d3c xkb: Factor out a function to copy a keymap's controls onto another
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-12 15:45:38 +10:00
Keith Packard 60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Keith Packard eda9356271 xkb: Make XkbWriteCountedString take a const char * input parameter
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:50 -08:00
Peter Harris e27b2e6163 xkb: Set nIndicators in XkbGetIndicatorMap
Xlib doesn't use this value (it computes it from the reply length
instead) which is why nobody has noticed yet. But the spec
http://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html
says that it should be set.

Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-21 10:07:22 +10:00