sync: Avoid ridiculously long timeouts

On OpenBSD, passing a timeout longer than 100000000 seconds to select(2) will
make it fail with EINVAL.  As this is original 4.4BSD behaviour it is not
inconceivable that other systems suffer from the same problem.  And Linux,
though not suffering from any 4.4BSD heritage, briefly did something similar:

<https://lkml.org/lkml/2012/8/31/263>

So avoid calling AdjustWaitForDelay() instead of setting the timeout to
(effectively) ULONG_MAX milliseconds.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
(cherry picked from commit ddeca927498c9df3b5e62c7bf05e31e2a3aeaa52)
Xi: check for invalid modifiers for XI2 passive grabs

The other values are checked correctly, but if a modifier was outside the
allowed range, it would go unnoticed and cause a out-of-bounds read error for
any mask equal or larger than 256. The DetailRec where we store the grab masks
is only sized to 8 * sizeof(Mask).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 0f10cfd4b903d4db293ec47c8a9a0d8b33965803)
config: search for PnPID on all parents (#75513)

The PnPID for a device may not be on the immediate parent, so search up the
device tree until we find one.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 795066477ee81b5b82e490eac8bed6b656d01f17)