Failing the leftover-rules check in the valgrind stage because
==1491== Invalid read of size 16
==1491== at 0x5320AE8: __wcsnlen_sse4_1 (in /usr/lib64/libc-2.27.so)
==1491== by 0x5310AD1: wcsrtombs (in /usr/lib64/libc-2.27.so)
==1491== by 0x1AA403: ??? (in /usr/bin/bash)
==1491== by 0x1AB3E3: glob_filename (in /usr/bin/bash)
==1491== by 0x179FF1: shell_glob_filename (in /usr/bin/bash)
==1491== by 0x1752CD: ??? (in /usr/bin/bash)
==1491== by 0x14C05F: ??? (in /usr/bin/bash)
==1491== by 0x14E2E3: execute_command_internal (in /usr/bin/bash)
==1491== by 0x14FBC5: execute_command (in /usr/bin/bash)
==1491== by 0x137598: reader_loop (in /usr/bin/bash)
==1491== by 0x135D38: main (in /usr/bin/bash)
==1491== Address 0x5651fd0 is 32 bytes before a block of size 128 in arena "client"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
There's no need for high performance in these little tests, so instead of
supporting various platform-specific sendfile() implementations, just use a local read-write function.
This hasn't been a real .in file since the autotools removal, so rename it to
reflect that. And since we can call it with arguments from meson, let's do so
in the most sensible manner - passing the full paths in as required rather
than relying on a directory layout within the script.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
I keep hitting this in the gitlab runner, 100ms is clearly not enough here for
slow containers.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
destroy isn't called until the last libinput_device_unref(), so we may trigger
a debounce timer after the device was removed. The same fix is neded for the
touchpad interface.
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/72
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If the args are bad, we don't need to check for root and whatnot.
Only exception here is the debugger check because it changes defaults that we
may want to override with commandline arguments later.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The tapping code can handle palm states now, so there is no need to disable
tapping altogether when a tool-based palm is detected.
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/65
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
These are tests that don't need *any* uinput devices at all. Mark them
accordingly and create a new binary that only runs those tests. This way we
can run some of the test suite even in containers where we're restricted.
Better have 10% tested than none, I guess.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
value isn't touched where the quirk doesn't exist, so we're accessing an
uninitialized variable here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The current /dev/input/* check isn't reliable enough. So rather than adding
extra heuristics prone to fail add an environment variable that says "do not
run the test suite runner". All other tests are run since they do not
require/modify any specific system setup.
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/62
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The ssize_t cast upsets coverity for some reason but we can be a lot more
restrictive here anyway. Quick analysis of the zalloc calls in the test suite
show the largest allocation is 9204 bytes.
Let's put a cap on for one MB, anything above that is likely some memory
corruption and should be caught early.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Matheus Santana <embs@cin.ufpe.br>
Leftover from a previous iteration of this code - having a static but
unnecessarily large size for dirname results in:
../test/litest.c:1251:38: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
snprintf(dest, sizeof(dest), "%s/%s", dirname, filename);
^
../test/litest.c:1251:3: note: ‘snprintf’ output 2 or more bytes (assuming 4097) into a destination of size 4096
snprintf(dest, sizeof(dest), "%s/%s", dirname, filename);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Nothing in libinput needs large buffers, so if we ever get something that
large, we probably passed a negative number to zalloc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Make it return NULL for a string array in the form of [ NULL ], like the docs
say. This also adds an extra safety check for the joiner to be of a reasonable
length to avoid overflows.
Found in
https://gitlab.freedesktop.org/libinput/libinput/issues/26#note_6320
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
So we have them available per litest device and can check in tests for certain
quirks to be present.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If we created it, remove it again. No change because we're not adding any of
the directories yet.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Make the tempfile creation dependent on whether the required template is
present. Currently unused, this is just prep work for future patches.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is supposed to come from systemd on a real setup, but for our test setup
we want to pass the test suite even when the system itself doesn't set it.