Commit Graph
81250 Commits
Author SHA1 Message Date
Yu Watanabe e06e34a3b6 udev: replace get_user/group_creds() with userdb/groupdb_by_name() (#37304)
This also makes networkd not refuse User=/Group=root.
2025-05-09 20:54:16 +09:00
Kurt Borja 15450ba214 hwdb: keyboard: Add Alienware special keys
Add Alienware *Performance mode* toggle key and *Macro* keys.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
2025-05-09 20:42:00 +09:00
Marcos Alano fb8149234a Add emulated release to G-Mode key 2025-05-09 20:41:45 +09:00
Yu Watanabe 37c8a03ebf udevadm-info: parse all arguments before doing anything (#37292) 2025-05-09 14:09:45 +09:00
David Tardon 6cdc63d120 udevadm-info: use string table to parse query type 2025-05-09 12:14:21 +09:00
David Tardon 4ef3019ceb udevadm-info: drop args of stat_device()
They are all static vars now, so can be used directly.
2025-05-09 12:14:21 +09:00
David Tardon 8ea3c1fb9e udevadm-info: shorten the code a bit 2025-05-09 12:14:21 +09:00
David Tardon 31767b92a0 udevadm-info: reject devices passed via opts too
Follow-up-for a6b4b2fa01
2025-05-09 12:14:21 +09:00
David Tardon d89b3004da udevadm-info: split arg. parsing into a separate function 2025-05-09 12:14:16 +09:00
David Tardon 86ff972ac3 udevadm-info: drop superfluous pager_open() call
It's already called in advance in info_main().
2025-05-09 12:10:51 +09:00
David Tardon 5b4d73208e udevadm-info: make arg_pager_flags static 2025-05-09 12:10:51 +09:00
David Tardon cb3f6c9e0d udevadm-info: move static dtor closer to args 2025-05-09 12:10:51 +09:00
Yu Watanabe 0c93e66386 udev: use userdb_by_name()/groupdb_by_name()
Prompted by https://github.com/systemd/systemd/pull/37294#discussion_r2068141968.
2025-05-09 12:10:28 +09:00
Yu Watanabe e4d07d1a2d userdb: introduce USERDB_SYNTHESIZE_NUMERIC flag
When the flag is set, even if the specified UID/GID does not exist,
create a synthetic user record for the UID/GID.
Currently, only system UID/GID are supported.
2025-05-09 12:10:28 +09:00
Yu Watanabe 6d30c11a0a network/tuntap: allow to specify root to User=/Group=
Follow-up for 940441b44c.

With the commit, User=/Group=root was refused and warned that the root
is not a system user. Typically it is not necessary to specify such, but
let's not log confusing warning and honor the setting.
2025-05-09 12:10:28 +09:00
Yu Watanabe 6377f40d26 user-record: introduce USERDB_MATCH_ROOT_AND_SYSTEM
It may be useful when we want to resolve root and system user/group
but want to refuse nobody user/group.
2025-05-09 12:10:28 +09:00
Yu Watanabe 4dcc308fba userdb: introduce user/group_record_buildo() helper macros 2025-05-09 12:10:28 +09:00
Yu Watanabe 64fc712fe7 user-util,user-record-nss: initialize buffer before calling getpwnam_r() and friends
The buffer will be used by a library outside of our code base,
and may not be initialized even on success. Let's initialize
them for safety.

Hopefully fixes the following fuzzer warning:
```
==2039==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f9ad8be3ae6 in _nss_files_getsgnam_r (/lib/x86_64-linux-gnu/libnss_files.so.2+0x8ae6) (BuildId: 013bf05b4846ebbdbebdb05585acc9726c2fabce)
    #1 0x7f9ad93e5902 in getsgnam_r (/lib/x86_64-linux-gnu/libc.so.6+0x126902) (BuildId: 0323ab4806bee6f846d9ad4bccfc29afdca49a58)
    #2 0x7f9ad9b98153 in nss_sgrp_for_group /work/build/../../src/systemd/src/shared/user-record-nss.c:357:21
    #3 0x7f9ad9b98926 in nss_group_record_by_gid /work/build/../../src/systemd/src/shared/user-record-nss.c:431:21
    #4 0x7f9ad9bcebd7 in groupdb_by_gid_fallbacks /work/build/../../src/systemd/src/shared/userdb.c:1372:29

  Uninitialized value was created by a heap allocation
    #0 0x556fd5294302 in malloc /src/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1021:3
    #1 0x7f9ad9b9811d in nss_sgrp_for_group /work/build/../../src/systemd/src/shared/user-record-nss.c:353:23
    #2 0x7f9ad9b98926 in nss_group_record_by_gid /work/build/../../src/systemd/src/shared/user-record-nss.c:431:21
    #3 0x7f9ad9bcebd7 in groupdb_by_gid_fallbacks /work/build/../../src/systemd/src/shared/userdb.c:1372:29
```
2025-05-09 12:10:28 +09:00
Yu Watanabe 1e35d21ab0 udevadm-trigger: parse all arguments before doing anything (#37293) 2025-05-09 12:09:18 +09:00
Yu Watanabe fe927f3dbb udev: enable kill workers timer when processing events stopped (#37382)
This also extends test cases for
`udevadm control --start-exec-queue/--stop-exec-queue`.
2025-05-09 10:42:48 +09:00
David Tardon a63822a7e3 udevadm-trigger: use string table to parse scan type 2025-05-09 09:54:27 +09:00
David Tardon bc995d6764 udevadm-trigger: add prefix to enumeration values 2025-05-09 09:54:27 +09:00
David Tardon a07f40e264 udevadm-trigger: replace home-made key/value splitting function 2025-05-09 09:54:25 +09:00
David Tardon f849e85221 test: extend udevadm coverage test a bit 2025-05-09 09:53:50 +09:00
David Tardon 9925193a76 udevadm: allow key without a value 2025-05-09 09:53:50 +09:00
David Tardon f10206a88e udevadm: move key/value parsing func. to udevadm-util.c 2025-05-09 09:53:50 +09:00
David Tardon 5f0ebd9754 udevadm-trigger: split arg. parsing into a separate function 2025-05-09 09:53:40 +09:00
David Tardon 9b65fb8f34 udevadm-trigger: add vertical space to separate cases 2025-05-09 09:44:56 +09:00
Yu Watanabe 75e906a406 TEST-17-UDEV: extend test cases for udevadm control --start-exec-queue/--stop-exec-queue 2025-05-09 08:54:26 +09:00
Yu Watanabe 9999e8b409 TEST-17-UDEV: drop needless numbering
The subtest was renamed from TEST-17-UDEV.10.sh.
Let's also drop the numbering from function name and interface name.

Follow-up for 40959dcc02.
2025-05-09 08:54:26 +09:00
Yu Watanabe a3d79fc3a0 udev: enable kill workers timer when processing queued events stopped
It is not necessary to keep idle workers so long time in that case.
2025-05-09 08:54:26 +09:00
Mike Yuan df5dd05941 hashmap,prioq: check hash_ops or compare_func is identical to one already set (#37379) 2025-05-08 22:50:38 +02:00
Daan De Meyer dd832c4fed udev-worker: send path to device node of whole disk when it is locked, and one cleanup (#37385) 2025-05-08 08:20:21 +02:00
Itxaka 03eae2a402 boot: add an option to control action after SecureBoot enrollment (#36684)
This PR provides a new option for systemd-boot
`secure-boot-enroll-action` which allows to configure the behavior after
SecureBoot keys are enrolled.

Provides the option to either reboot or power off.

The current behavior is not changed, it will by default reboot as it did
before.

It also provides a small message about the action its going to take with
a small delay so the user can read it.
2025-05-08 13:28:41 +09:00
Yu Watanabe f9550d1182 prioq: make prioq_ensure_put() type safe 2025-05-08 05:58:33 +09:00
Yu Watanabe 4699f0e68a prioq: check if identical compare func is specified if already allocated 2025-05-08 05:58:33 +09:00
Yu Watanabe bc169c4fa2 hashmap: check if identical hash_ops is specified if already allocated 2025-05-08 05:58:33 +09:00
Yu Watanabe 472379925c resolve: use set_put_strdup_full() to specify hash_ops 2025-05-08 05:58:33 +09:00
Yu Watanabe 16c7555e1a core/unit: use the same hash_ops originally used on allocation
See unit_file_build_name_map().
2025-05-08 05:58:33 +09:00
Yu Watanabe 54bbfa007d set: rename _set_ensure_allocated() -> set_ensure_allocated()
Follow-ups for c09ce222b6.
2025-05-08 05:58:33 +09:00
Yu Watanabe f24f70343d network: log_link_message_debug_errno() automatically append %m if necessary
Follow-up for d28746ef55.
Fixes CID#1609753.
2025-05-08 05:57:48 +09:00
Yu Watanabe 22750aa91e udev-worker: notify device node of whole disk to manager when the disk is locked
It is currently unused, but will be used later.
2025-05-08 04:46:01 +09:00
Yu Watanabe 356d44a063 udev-worker: allocate UdevEvent object just before use
No functional change, just refactoring.
2025-05-08 04:46:01 +09:00
Yu Watanabe ecad362d7e man: fix typo
Follow-up for a50fa2a40f.
2025-05-08 03:37:38 +09:00
Yu Watanabe 8449d38d6f boot: Add EDID (#36843)
This adds a couple of custom CHIDs which include panel manufacturer and
product code.
2025-05-08 02:48:00 +09:00
Lennart Poettering 0d5ee894c4 exec-util: make missing agents a gracefull handled issues
Just downgrade the log message in case of ENOENT of agent binaries to
LOG_DEBUG. Do this in order to support distros which split off some
agent bianries into separate optional binaries.

Fixes: #37369
2025-05-08 02:38:47 +09:00
Todd C. Miller ffb6adb763 flush_ports: flush POSIX message queues properly
On Linux, read() on a message queue descriptor returns the message
queue statistics, not the actual message queue data.  We need to use
mq_receive() to drain the queues instead.

Fixes a problem where a POSIX message queue socket unit with messages
in the queue at shutdown time could result in a hang on reboot/shutdown.
2025-05-08 02:37:45 +09:00
Yu Watanabe 676fb42aae units: enable IgnoreOnIsolate=yes on systemd-udevd-kernel.socket
Otherwise, initrd-cleanup.service requests isolation thus the socket
is stopped before switching root, and several early events after
switching root may be lost.
2025-05-08 01:29:53 +09:00
anonymix007 9fed4ec252 analyze-chid: Support EDID CHIDs 2025-05-07 18:52:49 +03:00
anonymix007 907328749f sd-device: Introduce sd_device_get_sysattr_value_with_size() 2025-05-07 18:52:49 +03:00