Pierre Ossman [Mon, 9 Sep 2019 14:47:36 +0000 (16:47 +0200)]
Fix length checks in string conversion functions
We need to check the buffer length before accessing the incoming
string. Probably not a problem in practice as there should be a
final null in most incoming strings.
Issue found by Pavel Cheremushkin from Kaspersky Lab.
Pierre Ossman [Fri, 5 Feb 2016 09:26:56 +0000 (10:26 +0100)]
Support extended clipboard transfers
Implements support in both client and server for the extended
clipboard format first seen in UltraVNC. Currently only implements
text handling, but that is still an improvement as it extends the
clipboard from ISO 8859-1 to full Unicode.
Pierre Ossman [Thu, 2 May 2019 10:32:03 +0000 (12:32 +0200)]
Clean up internal clipboard handling
We now filter incoming data, which means we can start assuming the
clipboard data is always null terminated. This allows us to clean
up a lot of the internal handling.
Pierre Ossman [Thu, 2 May 2019 10:32:03 +0000 (12:32 +0200)]
Make sure clipboard uses \n line endings
This is required by the protocol so we should make sure it is
enforced. We are tolerant of clients that violate this though and
convert incoming clipboard data.
Result of overflow on signed integer arithmetic is undefined in C/C++ standard.
So in previous version clang was compiling the statement as (int)a > (int)b (i.e. assuming no overflow), which leads to incorrect result.
Correct deterministic behavior means doing overflow arithmetic as unsigned, i.e.
a != b && a - b <= UINT_MAX / 2
Pierre Ossman [Thu, 4 Apr 2019 08:31:59 +0000 (10:31 +0200)]
Always get raw keyboard layout on macOS
Some input sources are still using input methods even though they
claim to be "ASCII" input. This causes our input handling to fail
since we need to query the layout to handle dead keys.
Fortunately there is another API to get the raw, underlying input
source that the input method uses. So let's use that and be sure
that we're always getting something we can use.
Pierre Ossman [Mon, 1 Apr 2019 12:55:40 +0000 (14:55 +0200)]
Increase version string buffer size for gcc
There is some bug in gcc's new -Werror=format-overflow that makes it
think majorVersion could end up being very large. Increase the target
buffer for now to keep gcc happy.
Pierre Ossman [Mon, 1 Apr 2019 12:25:32 +0000 (14:25 +0200)]
Only save parameters that are visible from the UI
The parameter files are used to make sure changes in the UI are
persistent. Storing anything else results in behaviours that the
user has no easy way of changing.
Pierre Ossman [Mon, 1 Apr 2019 12:24:27 +0000 (14:24 +0200)]
Hide setPrimary parameter on non-X11 platforms
It is already hidden in the UI, so make sure it also is gone as a
command line parameter. This follows the behaviour of the similar
sendPrimary parameter.
Pierre Ossman [Mon, 1 Apr 2019 12:22:01 +0000 (14:22 +0200)]
Add delay on authentication failures
This provides some basic rate limiting that will make it difficult
for an attacker to brute force passwords. Only relevant when the
blacklist is disabled as otherwise the attacker only gets a very
limited number of attempts.
Pierre Ossman [Mon, 25 Mar 2019 13:10:25 +0000 (14:10 +0100)]
Allow blacklist to be disabled
There might be multiple clients using a single IP (e.g. NAT), which
can make the blacklist do more harm than good. So add a setting to
disable it if needed.
Pierre Ossman [Thu, 28 Feb 2019 09:57:40 +0000 (10:57 +0100)]
Only do initial LED sync if focused
We always sync when we get focus, so this code path is really only
for when the server announces LED state support after we already
have focus.
Make sure we only handle this specific scenario as otherwise we
could end up syncing twice, which just toggles things back and forth
and ends up syncing incorrectly.
James Le Cuirot [Wed, 13 Feb 2019 23:22:06 +0000 (23:22 +0000)]
Don't build xserver with -I$(includedir) as it breaks cross-compiling
This is where to install headers to, not where to find headers to
build against. Toolchains should know where to locate their system
headers while non-system headers should be found using
pkg-config. Users with bizarre setups where the toolchain really
cannot find the system headers should set CPPFLAGS.
Ben Hildred [Fri, 28 Sep 2018 20:46:27 +0000 (14:46 -0600)]
dead links and bitrot
Two minor issues:
This script is written in python two which is depreciated, and should be rewritten in python three, but I have so far been successful in not learning python. :-) to simplify debugging I have clarified that it needs a python two interpreter.
This script downloads an old version of mesa (an update may be appropriate), unfortunately the release candidate previously specified is no longer available, so an update to the next released version was made.
Pierre Ossman [Mon, 29 Oct 2018 09:03:37 +0000 (10:03 +0100)]
Require all SMsgWriter caller to check capabilities
Make the API consisitent by requiring the caller to check what the client
supports before calling any of the write* functions. This avoids the
confusion that the functions might not always do anything.
Pierre Ossman [Mon, 10 Dec 2018 19:16:12 +0000 (20:16 +0100)]
Always send current screen layout to client
This is what the protocol requires, rather than sending what the
client specified in the request. This should be the same in practice
except for failures and possibly some races.
Pierre Ossman [Fri, 30 Nov 2018 14:59:43 +0000 (15:59 +0100)]
Increase range of ComparingUpdateTracker statistics
32 bits are not enough to keep track of all the pixels that might
flow through the system. Expand things to 64 bits, which should cover
all reasonable uses.
Pierre Ossman [Mon, 26 Nov 2018 14:40:30 +0000 (15:40 +0100)]
Avoid using "fake" key codes
There is a range of key codes that are never sent by a real keyboard
and are therefore used by layouts to hide "fake" mappings. Make sure
to only use these as a fallback as some applications get confused
when they see these codes.
Pierre Ossman [Fri, 23 Nov 2018 16:48:02 +0000 (17:48 +0100)]
Abort unsafe lossless refresh early
We need to check earlier if we are going to send this refresh or
not. Otherwise we send out pings pointlessly, and we also stall
the request loop with a client as we clear the requested region
without actually sending an update message.