| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Several keyboard devices are erroneously tagged with ID_INPUT_JOYSTICK
because of random buttons they set. For example, the LiteOn Lenovo
Calliope USB Keyboard sets BTN_TRIGGER, BTN_TOP2, BTN_PINKIE and
BTN_BASE, see libinput issue 745 for details.
ID_INPUT_JOYSTICK triggers the uaccess rules, making those keyboards
easily accessible. That's not a problem in the LiteOn example since that
event node doesn't contain the normal keys and eavesdropping on volume
keys is probably not very interesting.
Improve the joystick detection by adding heuristics similar to what
libinput 1.20 uses: check for some specific set of keys that are common
on keyboards but very unlikely on joysticks. If enough of those are
present (or the device has less than 2 axes or joysticks), don't tag it
as joystick.
libinput also checks for > 10 keyboard keys, but this is not done here
to be more conservative.
|
|\
| |
| | |
udev: three minor tweaks
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Simplify generated sysfs paths, since we might get data passed that
includes extra // in the middle.
Also, let's not assume /sys/ prefix without verification.
|
| |
| |
| |
| |
| | |
We can use enumerator_scan_devices_all() to shorten the code, and drop
some of the error handling complexities.
|
|\ \
| | |
| | | |
Add more tests for specifiers
|
| | |
| | |
| | |
| | |
| | | |
We use "hostname" exclusively in docs, and also in a big majority of the
code. Let's use the same spelling in remaining places.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It turns out that in fa3cd7394c227ad38c5c09b2bc2d035e7fb14a76 back
in 2013 I got the test reversed: assert_se(strncmp()) should be
assert_se(strncmp==0). So the tests that were using "*" were not entirely
useful ;) The function was refactored a bunch of times since then, and it
seems nobody noticed.
So let's replace this fragile construct by a simple fnmatch, which also
has the advantage that the glob can be inserted in arbitrary places.
Following up for d0aba07f1ac8d6df2ccfa033fe1e195b1b9e5272: we should have at
least basic tests for all interfaces, even the deprecated ones, so that we
catch obvious errors. This sorts the specifiers the same way that they are
declared in the unit-printf.c, and adds tests for all the specifiers. We
even were setting 'shell', but not using it in a test.
Also, we shouldn't initialize variables in tests. This catches the error fixed
in previous commit.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This doesn't change anything for real uses, because we'd initialize the
variable to NULL for _cleanup_ anyway, but let's follow our general pattern
of always setting the output on "success". (Even if that success is an empty
answer here.)
|
| | |
| | |
| | |
| | |
| | | |
Inspired by 9fe20c3234. When the specifier is undocumented, it is really easy
to add a duplicate definition in a different place.
|
| |/
|/|
| |
| |
| | |
Replace old SD_BUS_METHOD_WITH_NAMES and SD_BUS_SIGNAL_WITH_NAMES macros
to the new SD_BUS_METHOD_WITH_ARGS and SD_BUS_SIGNAL_WITH_ARGS macros.
|
| | |
|
|\ \
| | |
| | | |
loop-util/image dissect fixes
|
| | |
| | |
| | |
| | | |
Then, we can safely open devices even if symlinks are not yet created by udevd.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
So here's something we should always keep in mind:
systemd-udevd actually does *two* things with BSD file locks on block
devices:
1. While it probes a device it takes a LOCK_SH lock. Thus everyone else
taking a LOCK_EX lock will temporarily block udev from probing
devices, which is good when making changes to it.
2. Whenever a device is closed after write (detected via inotify), udevd
will issue BLKRRPART (requesting the kernel to reread the partition
table). It does this while holding a LOCK_EX lock on the block
device. Thus anyone else taking LOCK_SH or LOCK_EX will temporarily
block udevd from issuing that ioctl. And that's quite relevant, since
the kernel will temporarily flush out all partitions while re-reading
the partition table and then create them anew. Thus it is smart to
take LOCK_SH when dissecting a block device to ensure that no
BLKRRPART is issued in the background, until we mounted the devices.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This revisits the mess around waiting for partition block devices in
the image dissection code. It implements a nice little trick:
Instead of waiting for the kernel to probe the partition table for us
and generate the block devices from it, we'll just do that ourselves.
How can we do it? Via the BLKPG_ADD_PARTITION ioctl, that the kernel has
supported for a while. This ioctl allows creating partition block
devices off "whole" block devices from userspace, without the partitions
necessarily being present in the partition table at all.
So, whenever we want a partition to be there, we'll just issue
BLKPG_ADD_PARTITION. This can either work, in which case we know the
partition is there, and can use it. Yay. Or it can fail with EBUSY,
which the kernel returns if a partition by the selected partition index
already exists (or if an existing partition overlaps with the new one).
But if that's the case, then that's also OK, because the partition will
already exist.
So, regardless if we win or the kernel wins, for us the outcome is the
same: the partition block device will exist after invoking the ioctl.
Yay.
Net effect: we are not dependent on asynchronous uevent messages to wait
for the devices. Instead we synchronously get what we need. This makes
us independent of the (apparently less than reliable) netlink transport,
and should almost always be quicker.
Hopefully addresses #17469 even on older kernels.
Fixes: #17469
|
|\ \ \
| | | |
| | | | |
sd-device: validate input parameter after creating sd-device object
|
| | | | |
|
| | | | |
|
| |/ / |
|
|\ \ \
| | | |
| | | | |
udev: log once
|
| | | | |
|
| | | | |
|
| |/ /
| | |
| | |
| | | |
To make the log message shown only once.
|
| | | |
|
| | | |
|
| | | |
|
|/ / |
|
| | |
|
| |
| |
| |
| | |
Follow-up for 31cf58864d3f437c7e3f0497df0fef85130f159d.
|
| | |
|
|\ \
| | |
| | | |
timesyncd: add runtime servers
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Use `LIST_APPEND()` in favour of `LIST_FIND_TAIL()` + `LIST_INSERT_AFTER()`.
Also use a switch/case statement instead of if/else if.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When looking at debug logs, it's helpful to know what type of server
address has been added.
For that, introduce a string lookup table for the ServerType type.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This new server type can only be set at runtime through a D-Bus method
and is exposed for reading through a D-Bus property.
`CAP_NET_ADMIN` and a PolKit acknowledge is required for setting
runtime servers.
Entries submitted that way are used before system and link servers
are being looked at.
|
| | |
| | |
| | |
| | | |
This function use useful from other files, so let's export it.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In Semaphore CI, for some reason, /run/systemd/resolve is busy so the umount
fails at the end of the test run:
Verify link states with Unmanaged= settings, cold-plug. ... umount: /run/systemd/resolve: target is busy.14:57
ok14:57
ERROR14:57
======================================================================14:57
ERROR: tearDownModule (__main__)14:57
----------------------------------------------------------------------14:57
Traceback (most recent call last):14:57
File /tmp/autopkgtest-lxc.6islza9t/downtmp/build.A9b/src/test/networkd-test.py, line 94, in tearDownModule14:57
subprocess.check_call([umount, d])14:57
File /usr/lib/python3.9/subprocess.py, line 373, in check_call14:57
raise CalledProcessError(retcode, cmd)14:57
subprocess.CalledProcessError: Command '['umount', '/run/systemd/resolve']' returned non-zero exit status 32.14:57
----------------------------------------------------------------------14:58
Ran 35 tests in 138.868s14:58
FAILED (errors=1, skipped=2)
Use lazy umount to avoid erroring out.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* machine: update to use new-style sd-bus macros
Replace old SD_BUS_METHOD_WITH_NAMES and SD_BUS_SIGNAL_WITH_NAMES macros to
the new SD_BUS_METHOD_WITH_ARGS and SD_BUS_SIGNAL_WITH_ARGS macros.
Meson test, mkosi test image and running machinectl after build returned
no error. But since I don't have any virtual machines or containers, I'm not
sure how to test the changes thoroughly.
|
|/ |
|
|
|
|
|
|
|
| |
%R is already used in service manager specifier expansion (cgroup root),
hence use a different char, that was so far not used.
Follow-up for: 6ceb0a4094908dd213a78b9f6d0c59a684831ab0
|
|
|
|
|
| |
The env var is called $CREDENTIALS_DIRECTORY, not $CREDENTIALS_PATH. Fix
message about it accordingly.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
To make sure we don't miss any _exit() calls let's move the
coverage-related tweaks into a separate header file and include it
explicitly on the compiler command line using -include when a coverage
build is requested.
Follow-up to c6552ad381003a23cde7c3228e7071f30465df35.
|
|\
| |
| |
| |
| | |
keszybz/fix-detection-of-libsystemd-shared-with-suffix
Fix detection of libsystemd-shared with suffix
|
| | |
|