]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
11 months agomount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too...
Yu Watanabe [Fri, 9 May 2025 18:22:20 +0000 (03:22 +0900)] 
mount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too (#37398)

Split out from #36337

11 months agocore/bpf: drop old kernels support (#37151)
Yu Watanabe [Fri, 9 May 2025 18:13:42 +0000 (03:13 +0900)] 
core/bpf: drop old kernels support (#37151)

11 months agoudev: sort queued events by their seqnum 37314/head
Yu Watanabe [Sat, 26 Apr 2025 06:37:25 +0000 (15:37 +0900)] 
udev: sort queued events by their seqnum

Unfortunately, the kernel may send events in a random order:
```
[   25.769624] systemd-udevd[194]: sdi7: Device is queued (SEQNUM=2843, ACTION=add)
[   25.769893] systemd-udevd[194]: sda5: Device is queued (SEQNUM=2842, ACTION=add)
[   25.770517] systemd-udevd[194]: sdi8: Device is queued (SEQNUM=2844, ACTION=add)
```
As you can see, udevd receives the event with SEQNUM=2843 earlier than
one with SEQNUM=2842.

Let's make queued events sorted, as our logic of determining which event
is ready for being processed assumes that queued events are sorted.
See event_build_dependencies().

Also, refuse to queue an event if another event with the same seqnum is
already queued.

11 months agoudev: drop event_is_blocked()
Yu Watanabe [Tue, 6 May 2025 18:13:43 +0000 (03:13 +0900)] 
udev: drop event_is_blocked()

As now it is a trivial wrapper of event_build_dependencies().

11 months agoudev: refactoring for managing events for locked block devices
Yu Watanabe [Tue, 6 May 2025 16:09:09 +0000 (01:09 +0900)] 
udev: refactoring for managing events for locked block devices

Previously, when an event for block device is queued or an inotify event
for a block device is triggered, all queued events were checked by
event_queue_assume_block_device_unlocked(), and its cost may be huge
on early boot stage.

This makes locked events are managed in separated prioq and hashmap,
to reduce the cost of event_queue_assume_block_device_unlocked(),
which is now renamed to manager_requeue_locked_events_by_device().

This also changes the clockid of timer events for requeueing and
timeout of retry from CLOCK_BOOTTIME to CLOCK_MONOTONIC. Otherwise,
if the system suspend while an event is locked, the event may be
requeued immediately after come back from the suspend and timed out.

11 months agoudev: several cleanups for managing events (#37384)
Yu Watanabe [Fri, 9 May 2025 17:30:25 +0000 (02:30 +0900)] 
udev: several cleanups for managing events (#37384)

Mostly no functional changes, just refactoring.

11 months agomount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too 37398/head
Mike Yuan [Mon, 24 Feb 2025 17:32:58 +0000 (18:32 +0100)] 
mount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too

Follow-up for 4e24796b5a64064f8b21c07356eba19e9db4bb33

11 months agocore/mount: remove unused temporary variable
Mike Yuan [Sun, 6 Apr 2025 22:26:57 +0000 (00:26 +0200)] 
core/mount: remove unused temporary variable

11 months agoboot: skip shim-specific logic when running with new shim
Luca Boccassi [Wed, 7 May 2025 23:49:25 +0000 (00:49 +0100)] 
boot: skip shim-specific logic when running with new shim

Since shim 16 the plain BS->LoadImage() will just work (TM), we do not need
anymore to set up manual overrides and manually call in the shim-specific
lock protocol or to set shim-specific EFIVAR to make addons work or to load
shim-signed kernels.

Check if the new protocol added in v16 is present, and if so, skip
all that. Once versions < 16 are no longer supported/revoked, all
the code can be dropped entirely.

11 months agoudev: move error handling in event_requeue() to caller 37384/head
Yu Watanabe [Tue, 6 May 2025 17:46:11 +0000 (02:46 +0900)] 
udev: move error handling in event_requeue() to caller

Also, remove udev database on failure.

11 months agoudev: split out device_broadcast_on_error()
Yu Watanabe [Tue, 6 May 2025 17:32:56 +0000 (02:32 +0900)] 
udev: split out device_broadcast_on_error()

11 months agosd-device: rename arguments
Yu Watanabe [Tue, 6 May 2025 17:31:46 +0000 (02:31 +0900)] 
sd-device: rename arguments

To make it consistent with its declaration and other function
prototypes.

11 months agoudev: move timeout event sources from struct Event to struct Worker
Yu Watanabe [Tue, 6 May 2025 10:23:53 +0000 (19:23 +0900)] 
udev: move timeout event sources from struct Event to struct Worker

The timeout event sources are enabled only when the event is being
processed by a worker, hence they are not necessary to be owned by the
event.

No effective functional change, just refactoring.

11 months agoudev: list up all dependencies of an event when the first time it is examined
Yu Watanabe [Mon, 5 May 2025 17:25:32 +0000 (02:25 +0900)] 
udev: list up all dependencies of an event when the first time it is examined

No functional change, just refactoring.

11 months agoudev: check earlier if there is a free room for processing an event
Yu Watanabe [Mon, 5 May 2025 16:37:16 +0000 (01:37 +0900)] 
udev: check earlier if there is a free room for processing an event

11 months agoudev: cache last queued event entry
Yu Watanabe [Sat, 26 Apr 2025 06:09:12 +0000 (15:09 +0900)] 
udev: cache last queued event entry

When we have N queued events, LIST_APPEND() takes O(N).
Let's cache the last event to optimize queueing.

11 months agoudev: introduce event_freep() and use it as cleanup attribute
Yu Watanabe [Sat, 26 Apr 2025 06:37:11 +0000 (15:37 +0900)] 
udev: introduce event_freep() and use it as cleanup attribute

No functional change, just refactoring and preparation for later change.

11 months agoMore header cleanups (#37381)
Daan De Meyer [Fri, 9 May 2025 15:22:33 +0000 (17:22 +0200)] 
More header cleanups (#37381)

11 months agotest: allow to allocate test scope even running with unprivileged user 37151/head
Yu Watanabe [Wed, 16 Apr 2025 18:03:53 +0000 (03:03 +0900)] 
test: allow to allocate test scope even running with unprivileged user

11 months agocore/bpf-devices: use bpf_program_supported()
Yu Watanabe [Tue, 8 Apr 2025 08:26:58 +0000 (17:26 +0900)] 
core/bpf-devices: use bpf_program_supported()

Note, BPF_PROG_TYPE_CGROUP_DEVICE is supported since kernel v4.15.
As our baseline on the kernel is v5.4, we can assume the bpf type is
always supported.

11 months agocore/bpf-firewall: replace bpf_firewall_supported() with bpf_program_supported()
Yu Watanabe [Wed, 16 Apr 2025 17:39:08 +0000 (02:39 +0900)] 
core/bpf-firewall: replace bpf_firewall_supported() with bpf_program_supported()

Note, BPF_PROG_TYPE_CGROUP_SKB is supported since kernel v4.10, and
BPF_F_ALLOW_MULTI and program name is supported since kernel v4.15.
As our baseline on the kernel is v5.4, we can assume that the type,
flag, and naming is supported when bpf_program_supported() succeeds.

11 months agocore/cgroup: foreign bpf programs needs to pass bpf_program_supported()
Yu Watanabe [Wed, 16 Apr 2025 18:10:38 +0000 (03:10 +0900)] 
core/cgroup: foreign bpf programs needs to pass bpf_program_supported()

As CONFIG_CGROUP_BPF may be disabled on the kernel or we are running on
sanitizers. See comments in bpf_program_supported().

Follow-up for 3fcb98cbff0a5be8bf7c5deda6c1f7e8a31699bd.

11 months agobpf-program: introduce bpf_program_supported() helper function
Yu Watanabe [Wed, 16 Apr 2025 17:05:09 +0000 (02:05 +0900)] 
bpf-program: introduce bpf_program_supported() helper function

It checks if the kernel is built with CONFIG_CGROUP_BPF.
It is currently unused, but will be used later.

11 months agobpf-compat: drop unused compat_libbpf_probe_bpf_prog_type()
Yu Watanabe [Tue, 29 Apr 2025 20:20:06 +0000 (05:20 +0900)] 
bpf-compat: drop unused compat_libbpf_probe_bpf_prog_type()

11 months agocore/bpf: drop unnecessary check for probing program type
Yu Watanabe [Tue, 29 Apr 2025 20:13:26 +0000 (05:13 +0900)] 
core/bpf: drop unnecessary check for probing program type

BPF_PROG_TYPE_CGROUP_SKB is supported since kernel v4.10
(0e33661de493db325435d565a4a722120ae4cbf3) and
BPF_PROG_TYPE_CGROUP_SOCK_ADDR is supported since kernel v4.17
(4fbac77d2d092b475dda9eea66da674369665427).

Our baseline on the kernel is v5.4. The check is not necessary.

11 months agocore: replace cgroup_bpf_supported() with dlopen_bpf_full()
Yu Watanabe [Sun, 20 Apr 2025 03:14:23 +0000 (12:14 +0900)] 
core: replace cgroup_bpf_supported() with dlopen_bpf_full()

After 3988e2489aaf30034e09918890f688780c154af7, the function is a simple
wrapper of bpf_dlopen() with logging. Let's introduce dlopen_bpf_full()
that takes log level, and replace cgroup_bpf_supported() with it.

11 months agoudev: replace get_user/group_creds() with userdb/groupdb_by_name() (#37304)
Yu Watanabe [Fri, 9 May 2025 11:54:16 +0000 (20:54 +0900)] 
udev: replace get_user/group_creds() with userdb/groupdb_by_name() (#37304)

This also makes networkd not refuse User=/Group=root.

11 months agohwdb: keyboard: Add Alienware special keys
Kurt Borja [Thu, 8 May 2025 07:37:55 +0000 (04:37 -0300)] 
hwdb: keyboard: Add Alienware special keys

Add Alienware *Performance mode* toggle key and *Macro* keys.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
11 months agoAdd emulated release to G-Mode key
Marcos Alano [Thu, 8 May 2025 10:28:16 +0000 (07:28 -0300)] 
Add emulated release to G-Mode key

11 months agoman: rework the description of $SYSTEMD_PAGER and $PAGER
Zbigniew Jędrzejewski-Szmek [Tue, 6 May 2025 09:37:26 +0000 (11:37 +0200)] 
man: rework the description of $SYSTEMD_PAGER and $PAGER

$PAGER wasn't documented, but actually we treat it same as $SYSTEMD_PAGER,
except for lower priority. And the two variables can be used to disable the
pager, even if $SYSTEMD_PAGERSECURE is not set.

Behaviour is (obviously) not changed by this patch, it intentionally just
updates the docs to match the code.

11 months agoman: reword the description of "secure pager" handling
Zbigniew Jędrzejewski-Szmek [Tue, 6 May 2025 09:14:10 +0000 (11:14 +0200)] 
man: reword the description of "secure pager" handling

The existing description was not *wrong*, but it was a bit muddled. Let's
reorder the text to give a short intro and then describe what the options
actually do and the clear "true" and "false" cases first, and then describe
autodetection.

Related to https://yeswehack.com/vulnerability-center/reports/346802.

11 months agostrv: Move STRV_FOREACH() to strv-fundamental.h 37381/head
Daan De Meyer [Wed, 7 May 2025 19:43:39 +0000 (21:43 +0200)] 
strv: Move STRV_FOREACH() to strv-fundamental.h

11 months agoalloc-util: Remove unneeded stdlib.h include
Daan De Meyer [Tue, 6 May 2025 12:20:43 +0000 (14:20 +0200)] 
alloc-util: Remove unneeded stdlib.h include

11 months agocompress: Drop lz4 includes from compress.h
Daan De Meyer [Wed, 7 May 2025 09:43:44 +0000 (11:43 +0200)] 
compress: Drop lz4 includes from compress.h

The lz4 functions are only used in test-compress.c, so let's just
put the declarations and includes in there instead of having everyone
including compress.h pull in the lz4 headers.

11 months agoterminal-util: Move various functions to ansi-color.c
Daan De Meyer [Wed, 7 May 2025 09:26:36 +0000 (11:26 +0200)] 
terminal-util: Move various functions to ansi-color.c

11 months agobasic: Move parts of audit-util.{c,h} to libaudit-util.{c,h} in shared/
Daan De Meyer [Wed, 7 May 2025 09:15:12 +0000 (11:15 +0200)] 
basic: Move parts of audit-util.{c,h} to libaudit-util.{c,h} in shared/

11 months agomacro: Reduce transitive includes
Daan De Meyer [Mon, 5 May 2025 14:03:20 +0000 (16:03 +0200)] 
macro: Reduce transitive includes

11 months agobasic: Override glibc's sys/param.h header with an empty file
Daan De Meyer [Tue, 6 May 2025 13:39:03 +0000 (15:39 +0200)] 
basic: Override glibc's sys/param.h header with an empty file

Instead of unconditionally including sys/param.h in
macro-fundamental.h which itself includes a bunch of other unnecessary
headers, let's override it with an empty file to avoid it from overriding
our MAX() macro. We can't make including it an error as it's included (
for seemingly no good reason) by <resolv.h>.

11 months agoudevadm-info: parse all arguments before doing anything (#37292)
Yu Watanabe [Fri, 9 May 2025 05:09:45 +0000 (14:09 +0900)] 
udevadm-info: parse all arguments before doing anything (#37292)

11 months agoudevadm-info: use string table to parse query type 37292/head
David Tardon [Wed, 7 May 2025 13:05:22 +0000 (15:05 +0200)] 
udevadm-info: use string table to parse query type

11 months agoudevadm-info: drop args of stat_device()
David Tardon [Fri, 25 Apr 2025 12:56:35 +0000 (14:56 +0200)] 
udevadm-info: drop args of stat_device()

They are all static vars now, so can be used directly.

11 months agoudevadm-info: shorten the code a bit
David Tardon [Fri, 25 Apr 2025 12:36:02 +0000 (14:36 +0200)] 
udevadm-info: shorten the code a bit

11 months agoudevadm-info: reject devices passed via opts too
David Tardon [Wed, 7 May 2025 12:35:54 +0000 (14:35 +0200)] 
udevadm-info: reject devices passed via opts too

Follow-up-for a6b4b2fa010f6dc5e18f1a14d93204c6c1416278

11 months agoudevadm-info: split arg. parsing into a separate function
David Tardon [Fri, 3 Nov 2023 13:56:52 +0000 (14:56 +0100)] 
udevadm-info: split arg. parsing into a separate function

11 months agoudevadm-info: drop superfluous pager_open() call
David Tardon [Fri, 25 Apr 2025 12:42:34 +0000 (14:42 +0200)] 
udevadm-info: drop superfluous pager_open() call

It's already called in advance in info_main().

11 months agoudevadm-info: make arg_pager_flags static
David Tardon [Thu, 17 Apr 2025 08:21:41 +0000 (10:21 +0200)] 
udevadm-info: make arg_pager_flags static

11 months agoudevadm-info: move static dtor closer to args
David Tardon [Thu, 17 Apr 2025 08:20:33 +0000 (10:20 +0200)] 
udevadm-info: move static dtor closer to args

11 months agoudev: use userdb_by_name()/groupdb_by_name() 37304/head
Yu Watanabe [Wed, 30 Apr 2025 11:43:44 +0000 (20:43 +0900)] 
udev: use userdb_by_name()/groupdb_by_name()

Prompted by https://github.com/systemd/systemd/pull/37294#discussion_r2068141968.

11 months agouserdb: introduce USERDB_SYNTHESIZE_NUMERIC flag
Yu Watanabe [Fri, 9 May 2025 02:18:02 +0000 (11:18 +0900)] 
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.

11 months agonetwork/tuntap: allow to specify root to User=/Group=
Yu Watanabe [Wed, 30 Apr 2025 16:30:35 +0000 (01:30 +0900)] 
network/tuntap: allow to specify root to User=/Group=

Follow-up for 940441b44c7040d62ae58b66bf124e9a0dae578d.

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.

11 months agouser-record: introduce USERDB_MATCH_ROOT_AND_SYSTEM
Yu Watanabe [Wed, 30 Apr 2025 14:27:59 +0000 (23:27 +0900)] 
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.

11 months agouserdb: introduce user/group_record_buildo() helper macros
Yu Watanabe [Wed, 30 Apr 2025 13:53:35 +0000 (22:53 +0900)] 
userdb: introduce user/group_record_buildo() helper macros

11 months agouser-util,user-record-nss: initialize buffer before calling getpwnam_r() and friends
Yu Watanabe [Thu, 1 May 2025 03:44:23 +0000 (12:44 +0900)] 
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
```

11 months agoudevadm-trigger: parse all arguments before doing anything (#37293)
Yu Watanabe [Fri, 9 May 2025 03:09:18 +0000 (12:09 +0900)] 
udevadm-trigger: parse all arguments before doing anything (#37293)

11 months agoudev: enable kill workers timer when processing events stopped (#37382)
Yu Watanabe [Fri, 9 May 2025 01:42:48 +0000 (10:42 +0900)] 
udev: enable kill workers timer when processing events stopped (#37382)

This also extends test cases for
`udevadm control --start-exec-queue/--stop-exec-queue`.

11 months agoudevadm-trigger: use string table to parse scan type 37293/head
David Tardon [Wed, 7 May 2025 14:11:38 +0000 (16:11 +0200)] 
udevadm-trigger: use string table to parse scan type

11 months agoudevadm-trigger: add prefix to enumeration values
David Tardon [Tue, 29 Apr 2025 12:02:37 +0000 (14:02 +0200)] 
udevadm-trigger: add prefix to enumeration values

11 months agoudevadm-trigger: replace home-made key/value splitting function
David Tardon [Tue, 29 Apr 2025 11:57:10 +0000 (13:57 +0200)] 
udevadm-trigger: replace home-made key/value splitting function

11 months agotest: extend udevadm coverage test a bit
David Tardon [Tue, 29 Apr 2025 12:34:44 +0000 (14:34 +0200)] 
test: extend udevadm coverage test a bit

11 months agoudevadm: allow key without a value
David Tardon [Tue, 29 Apr 2025 12:29:59 +0000 (14:29 +0200)] 
udevadm: allow key without a value

11 months agoudevadm: move key/value parsing func. to udevadm-util.c
David Tardon [Tue, 29 Apr 2025 12:22:15 +0000 (14:22 +0200)] 
udevadm: move key/value parsing func. to udevadm-util.c

11 months agoudevadm-trigger: split arg. parsing into a separate function
David Tardon [Tue, 29 Apr 2025 08:36:28 +0000 (10:36 +0200)] 
udevadm-trigger: split arg. parsing into a separate function

11 months agoudevadm-trigger: add vertical space to separate cases
David Tardon [Tue, 29 Apr 2025 08:09:11 +0000 (10:09 +0200)] 
udevadm-trigger: add vertical space to separate cases

11 months agoTEST-17-UDEV: extend test cases for udevadm control --start-exec-queue/--stop-exec... 37382/head
Yu Watanabe [Wed, 7 May 2025 19:18:58 +0000 (04:18 +0900)] 
TEST-17-UDEV: extend test cases for udevadm control --start-exec-queue/--stop-exec-queue

11 months agoTEST-17-UDEV: drop needless numbering
Yu Watanabe [Wed, 7 May 2025 19:07:04 +0000 (04:07 +0900)] 
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 40959dcc028a6884fbea00c11d89217a77716d4d.

11 months agoudev: enable kill workers timer when processing queued events stopped
Yu Watanabe [Wed, 7 May 2025 16:07:44 +0000 (01:07 +0900)] 
udev: enable kill workers timer when processing queued events stopped

It is not necessary to keep idle workers so long time in that case.

11 months agohashmap,prioq: check hash_ops or compare_func is identical to one already set (#37379)
Mike Yuan [Thu, 8 May 2025 20:50:38 +0000 (22:50 +0200)] 
hashmap,prioq: check hash_ops or compare_func is identical to one already set (#37379)

11 months agoudev-worker: send path to device node of whole disk when it is locked, and one cleanu...
Daan De Meyer [Thu, 8 May 2025 06:20:21 +0000 (08:20 +0200)] 
udev-worker: send path to device node of whole disk when it is locked, and one cleanup (#37385)

11 months agoboot: add an option to control action after SecureBoot enrollment (#36684)
Itxaka [Thu, 8 May 2025 04:28:41 +0000 (06:28 +0200)] 
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.

11 months agoprioq: make prioq_ensure_put() type safe 37379/head
Yu Watanabe [Wed, 7 May 2025 16:59:40 +0000 (01:59 +0900)] 
prioq: make prioq_ensure_put() type safe

11 months agoprioq: check if identical compare func is specified if already allocated
Yu Watanabe [Wed, 7 May 2025 17:01:55 +0000 (02:01 +0900)] 
prioq: check if identical compare func is specified if already allocated

11 months agohashmap: check if identical hash_ops is specified if already allocated
Yu Watanabe [Wed, 7 May 2025 17:06:28 +0000 (02:06 +0900)] 
hashmap: check if identical hash_ops is specified if already allocated

11 months agoresolve: use set_put_strdup_full() to specify hash_ops
Yu Watanabe [Wed, 7 May 2025 20:53:23 +0000 (05:53 +0900)] 
resolve: use set_put_strdup_full() to specify hash_ops

11 months agocore/unit: use the same hash_ops originally used on allocation
Yu Watanabe [Wed, 7 May 2025 19:59:37 +0000 (04:59 +0900)] 
core/unit: use the same hash_ops originally used on allocation

See unit_file_build_name_map().

11 months agoset: rename _set_ensure_allocated() -> set_ensure_allocated()
Yu Watanabe [Wed, 7 May 2025 17:10:31 +0000 (02:10 +0900)] 
set: rename _set_ensure_allocated() -> set_ensure_allocated()

Follow-ups for c09ce222b6379e8f73695e5ce53fce76a44d78c7.

11 months agonetwork: log_link_message_debug_errno() automatically append %m if necessary
Yu Watanabe [Wed, 7 May 2025 17:21:59 +0000 (02:21 +0900)] 
network: log_link_message_debug_errno() automatically append %m if necessary

Follow-up for d28746ef552b11cba8890963f49ce3e0082e6053.
Fixes CID#1609753.

11 months agoudev-worker: notify device node of whole disk to manager when the disk is locked 37385/head
Yu Watanabe [Tue, 6 May 2025 16:02:26 +0000 (01:02 +0900)] 
udev-worker: notify device node of whole disk to manager when the disk is locked

It is currently unused, but will be used later.

11 months agoudev-worker: allocate UdevEvent object just before use
Yu Watanabe [Tue, 6 May 2025 15:59:56 +0000 (00:59 +0900)] 
udev-worker: allocate UdevEvent object just before use

No functional change, just refactoring.

11 months agoman: fix typo
Yu Watanabe [Wed, 7 May 2025 18:37:35 +0000 (03:37 +0900)] 
man: fix typo

Follow-up for a50fa2a40f4a91d49503d3588a3dd29ea05e559b.

11 months agoboot: Add EDID (#36843)
Yu Watanabe [Wed, 7 May 2025 17:48:00 +0000 (02:48 +0900)] 
boot: Add EDID (#36843)

This adds a couple of custom CHIDs which include panel manufacturer and
product code.

11 months agoexec-util: make missing agents a gracefull handled issues
Lennart Poettering [Wed, 7 May 2025 15:47:01 +0000 (17:47 +0200)] 
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
11 months agoflush_ports: flush POSIX message queues properly
Todd C. Miller [Tue, 6 May 2025 22:39:14 +0000 (16:39 -0600)] 
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.

11 months agotest: add test cases for ExecStart= via-shell prefix 37071/head
Mike Yuan [Wed, 9 Apr 2025 15:35:33 +0000 (17:35 +0200)] 
test: add test cases for ExecStart= via-shell prefix

11 months agorun0: introduce --via-shell for invoking target user's shell, and -i shortcut
Mike Yuan [Tue, 8 Apr 2025 22:55:27 +0000 (00:55 +0200)] 
run0: introduce --via-shell for invoking target user's shell, and -i shortcut

-i/--login has exact sudo semantics. But we only document
the short option and advertise expressly specifying
--via-shell --chdir='~' otherwise.

11 months agorun0: support --chdir='~' for switching to target user's home dir
Mike Yuan [Tue, 6 May 2025 22:36:41 +0000 (00:36 +0200)] 
run0: support --chdir='~' for switching to target user's home dir

parse_path_argument() unconditionally makes the passed path absolute,
without handling '~' of any sort. I think this generally makes sense
in most tools, since ~ expansion is typically done by the shell
and we wouldn't be seeing them in the first place and hence special
casing is not worth it. But in run0 let's explicit enable '~'.

11 months agocore: accept "|" ExecStart= prefix to spawn target user's shell
Mike Yuan [Wed, 9 Apr 2025 13:22:11 +0000 (15:22 +0200)] 
core: accept "|" ExecStart= prefix to spawn target user's shell

When switching to another user it's oftentimes desirable to also spawn
the target user's shell. sudo supports this via -i flag, run0 currently
doesn't. We don't want to proactively query NSS ourselves, since
that would fall short when operating remotely. Let's instead teach
the service manager to spawn the command using the user's default shell.

I opted for "|" instead of "." in the end because the latter seems
a bit obscure. But happy to change it to something else if a better option
comes up.

11 months agopath-util: introduce filename_or_absolute_path_is_valid() helper
Mike Yuan [Mon, 5 May 2025 18:12:05 +0000 (20:12 +0200)] 
path-util: introduce filename_or_absolute_path_is_valid() helper

11 months agobus-unit-util: do not trigger assertion on "ExecStart=@"
Mike Yuan [Thu, 17 Apr 2025 21:57:57 +0000 (23:57 +0200)] 
bus-unit-util: do not trigger assertion on "ExecStart=@"

extract_first_word() normalizes empty string to NULL,
triggering the assertion on input string in strv_split_full().

11 months agoenv-util: add missing assertions
Mike Yuan [Wed, 9 Apr 2025 18:54:42 +0000 (20:54 +0200)] 
env-util: add missing assertions

11 months agoman/systemd.service: drop dangling reference to "!!" prefix
Mike Yuan [Thu, 10 Apr 2025 19:00:27 +0000 (21:00 +0200)] 
man/systemd.service: drop dangling reference to "!!" prefix

Follow-up for 00a415fc8f9e3469549a56d29f448b8cf14b0598

11 months agounits: enable IgnoreOnIsolate=yes on systemd-udevd-kernel.socket
Yu Watanabe [Wed, 7 May 2025 12:44:22 +0000 (21:44 +0900)] 
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.

11 months agoanalyze-chid: Support EDID CHIDs 36843/head
anonymix007 [Mon, 31 Mar 2025 17:41:15 +0000 (20:41 +0300)] 
analyze-chid: Support EDID CHIDs

11 months agosd-device: Introduce sd_device_get_sysattr_value_with_size()
anonymix007 [Tue, 1 Apr 2025 14:40:29 +0000 (17:40 +0300)] 
sd-device: Introduce sd_device_get_sysattr_value_with_size()

11 months agochid: Setup EDID CHIDs
anonymix007 [Mon, 24 Mar 2025 13:53:49 +0000 (16:53 +0300)] 
chid: Setup EDID CHIDs

11 months agochid-fundamental: Introduce new CHID types
anonymix007 [Mon, 24 Mar 2025 13:43:12 +0000 (16:43 +0300)] 
chid-fundamental: Introduce new CHID types

These are extra types needed to distinguish devices by the installed
display panel

11 months agoboot: Add EDID parsing
anonymix007 [Mon, 31 Mar 2025 17:56:58 +0000 (20:56 +0300)] 
boot: Add EDID parsing

Will be used for identifying the currently used display panel
and choosing the appropriate DTB

11 months agofundamental: Introduce EDID header parsing
anonymix007 [Mon, 31 Mar 2025 17:38:24 +0000 (20:38 +0300)] 
fundamental: Introduce EDID header parsing

11 months agoboot: Add be16toh, le16toh and le32toh
anonymix007 [Mon, 31 Mar 2025 17:37:13 +0000 (20:37 +0300)] 
boot: Add be16toh, le16toh and le32toh

11 months agofundamental: Move common string constants from basic/string-util.h to string-util...
anonymix007 [Wed, 7 May 2025 15:01:07 +0000 (18:01 +0300)] 
fundamental: Move common string constants from basic/string-util.h to string-util-fundamental.h

11 months agoReduce the number of transitive includes (#37364)
Yu Watanabe [Wed, 7 May 2025 13:58:09 +0000 (22:58 +0900)] 
Reduce the number of transitive includes (#37364)