]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 months agotree-wide: Clean up includes 37457/head
Daan De Meyer [Wed, 14 May 2025 20:22:11 +0000 (22:22 +0200)] 
tree-wide: Clean up includes

This commit cleans up the includes for all the small tools across
the tree.

A few cases of returning EXIT_SUCCESS are replaced with returning
0 to avoid including <stdlib.h>.

Split out of #37344.

5 months agotpm2-util: Make sure structs/enums are named and add to forward.h
Daan De Meyer [Wed, 14 May 2025 20:27:28 +0000 (22:27 +0200)] 
tpm2-util: Make sure structs/enums are named and add to forward.h

We have to name structs/enums to be able to forward declare them, so
let's do that and add the missing ones to forward.h.

5 months agonetworkd-util: Avoid call to endswith()
Daan De Meyer [Wed, 14 May 2025 19:41:43 +0000 (21:41 +0200)] 
networkd-util: Avoid call to endswith()

Instead of recalculating the length of the string again after
reading it, let's make sd_netlink_message_read_string() return the
length of the string that we then use to check if the last character
is a dot or not.

This allows us to get rid of the string-util.h include in #37344.

5 months agotest: fix assertion failure with CONFIG_UNIX_DIAG disabled
Luca Boccassi [Wed, 14 May 2025 19:02:34 +0000 (20:02 +0100)] 
test: fix assertion failure with CONFIG_UNIX_DIAG disabled

On OBS the build VM is heavily locked down, with network
disabled in various ways in the custom kernel, to isolate the
build, including disabling CONFIG_UNIX_DIAG.

[  456s] /* test_af_unix_get_qlen */
[  456s] src/test/test-socket-netlink.c:393: Assertion failed: Expected "af_unix_get_qlen(unix_fd, &q)" to succeed, but got error: No such file or directory

[  454s] /* test_sock_diag_unix */
[  454s] src/libsystemd/sd-netlink/test-netlink.c:727: Assertion failed: Expected "sd_netlink_call(nl, message, 0, &reply)" to succeed, but got error: No such file or directory

Follow-up for 89e546e927b8d1fb6b7d44d689586f949109f144
Follow-up for 4a3bf440f26c0577808c16da84a57f731c48eaeb

5 months agoserialize: Move some logic to the implementation file
Daan De Meyer [Wed, 14 May 2025 17:29:00 +0000 (19:29 +0200)] 
serialize: Move some logic to the implementation file

This will allow removing the string-util.h include in #37344.

5 months agovalidatefs: follow ups for recent change (#37447)
Yu Watanabe [Wed, 14 May 2025 19:25:28 +0000 (04:25 +0900)] 
validatefs: follow ups for recent change (#37447)

Follow-ups for #37434.

5 months agoBugprone argument comment - round 4 (#37380)
Yu Watanabe [Wed, 14 May 2025 18:36:16 +0000 (03:36 +0900)] 
Bugprone argument comment - round 4 (#37380)

Follow up from https://github.com/systemd/systemd/pull/37356

5 months agocapability-util: Ignore unknown capabilities instead of aborting
Daan De Meyer [Wed, 14 May 2025 16:46:58 +0000 (18:46 +0200)] 
capability-util: Ignore unknown capabilities instead of aborting

capability_quintet_mangle() can be called with capability sets
containing unknown capabilities. Let's not crash when this is the
case but instead ignore the unknown capabilities.

Fixes d5e12dc75e0e356c62e514e9c347efb200fe60e0

5 months agoSmall fixups after review for stable (#37442)
Yu Watanabe [Wed, 14 May 2025 18:30:41 +0000 (03:30 +0900)] 
Small fixups after review for stable (#37442)

5 months agoImprove hwdb boilerplate texts (#37440)
Yu Watanabe [Wed, 14 May 2025 18:29:53 +0000 (03:29 +0900)] 
Improve hwdb boilerplate texts (#37440)

5 months agovalidatefs: split out validating gpt label and type 37447/head
Yu Watanabe [Wed, 14 May 2025 17:34:18 +0000 (02:34 +0900)] 
validatefs: split out validating gpt label and type

No functional change, just refactoring.
This addresses https://github.com/systemd/systemd/pull/37434#discussion_r2088950725.

5 months agovalidatefs: drop unnecessary empty lines
Yu Watanabe [Wed, 14 May 2025 17:55:50 +0000 (02:55 +0900)] 
validatefs: drop unnecessary empty lines

5 months agoman: fix typo
Yu Watanabe [Wed, 14 May 2025 17:22:23 +0000 (02:22 +0900)] 
man: fix typo

Follow-up for 778cfac5fba45b7ac828571704945b722b2fb718.
Addresses https://github.com/systemd/systemd/pull/37434#discussion_r2088882005.

5 months agodiscover-image: Move some logic to the implementation file
Daan De Meyer [Wed, 14 May 2025 17:04:53 +0000 (19:04 +0200)] 
discover-image: Move some logic to the implementation file

This will allow removing the string-util.h and path-util.h includes
as part of #37344.

5 months agoforward: Add forward declaration for LockFile (#37445)
Daan De Meyer [Wed, 14 May 2025 17:55:18 +0000 (19:55 +0200)] 
forward: Add forward declaration for LockFile (#37445)

5 months agoCleanup up includes #1 (#37438)
Daan De Meyer [Wed, 14 May 2025 17:55:03 +0000 (19:55 +0200)] 
Cleanup up includes #1 (#37438)

5 months agoforward: Add forward declaration for LockFile 37445/head
Daan De Meyer [Wed, 14 May 2025 17:02:36 +0000 (19:02 +0200)] 
forward: Add forward declaration for LockFile

5 months agointegration-tests: several cleanups (#37394)
Yu Watanabe [Wed, 14 May 2025 16:45:10 +0000 (01:45 +0900)] 
integration-tests: several cleanups (#37394)

5 months agofundamental: assume that intmax_t is the biggest integer 37442/head
Zbigniew Jędrzejewski-Szmek [Wed, 14 May 2025 14:39:32 +0000 (16:39 +0200)] 
fundamental: assume that intmax_t is the biggest integer

Allowing intmax_t to be narrower than some other type in the assert
is rather strange. By definition, it is the widest type.

Follow-up for c0239e5f113335f49328286698d4a9f13fed983d.

5 months agosystemd-journald: drop pointless bitfield annotations
Zbigniew Jędrzejewski-Szmek [Wed, 14 May 2025 13:49:44 +0000 (15:49 +0200)] 
systemd-journald: drop pointless bitfield annotations

This actually doesn't change the struct size, because bools are coalesced
anyway. Also group the bool fields together.

5 months agoelf2efi: make code more pythonic
Zbigniew Jędrzejewski-Szmek [Wed, 14 May 2025 13:09:09 +0000 (15:09 +0200)] 
elf2efi: make code more pythonic

Follow-up for 53628612b75b444681fabc729ad7b012299c4c63.

With 'or', we ignore the empty string (but not '0'), and we only call
time.time() lazily. So this works the same as the code that is replaced,
but avoids the ugly repetition.

5 months agoMinor docs cleanups (#37439)
Luca Boccassi [Wed, 14 May 2025 16:16:05 +0000 (17:16 +0100)] 
Minor docs cleanups (#37439)

5 months agohwdb: say that settings can be also set to 0 37440/head
Zbigniew Jędrzejewski-Szmek [Wed, 14 May 2025 15:59:34 +0000 (17:59 +0200)] 
hwdb: say that settings can be also set to 0

We recommend that users create overriddes. This creates the problem that there
is no syntax to unset a property. Thus, the user needs to just set the property
to "something else" in the override file. But then the blurb saying that
"VAR=1" (or "VAR=0" in some cases) is the only allowed value can be confusing.
Say that both 0 and 1 can be set, since this documentation is also intended
for end users.

In our files, we generally don't want the override values anywhere. But we
have a test which checks the rvalue, which should be enough.

5 months agohwdb.d: update/expand boilerplate on various hwdb files
Zbigniew Jędrzejewski-Szmek [Wed, 14 May 2025 15:44:25 +0000 (17:44 +0200)] 
hwdb.d: update/expand boilerplate on various hwdb files

We don't want to encourage people to copy the whole files. The
boilerplate text that recommends an override file rather than a
full copy appeared first in 0213a26f656d72ac83eb201f2104726fcfe60eaa,
but was added in other places in 57bb707d48131f4daad2b1b746eab586eb66b4f3.

Directly inspired by 951e8cb06037d5b67c0ac86f56bcbd73f4fb2d7b, but
the wrong boilerplate was added in other places too.

5 months agohwdb.d: reword and simplify boilerplate texts
Zbigniew Jędrzejewski-Szmek [Wed, 14 May 2025 15:31:57 +0000 (17:31 +0200)] 
hwdb.d: reword and simplify boilerplate texts

Let's keep things simple and uniform. We put a dot at the
end of some commands… This is obviously correct, but might confuse
some poor user.

5 months agodocs/BOOT_LOADER_INTERFACE: minor grammar fixes 37439/head
Zbigniew Jędrzejewski-Szmek [Tue, 6 May 2025 19:04:00 +0000 (21:04 +0200)] 
docs/BOOT_LOADER_INTERFACE: minor grammar fixes

5 months agodocs: punctuation and a typo
Zbigniew Jędrzejewski-Szmek [Wed, 7 May 2025 13:08:46 +0000 (15:08 +0200)] 
docs: punctuation and a typo

5 months agovalidatefs: fix checks on file systems backed by multiple devices (i.e. verity) ...
Lennart Poettering [Wed, 14 May 2025 15:53:06 +0000 (17:53 +0200)] 
validatefs: fix checks on file systems backed by multiple devices (i.e. verity) (#37434)

Fixes #37157

5 months agovmspawn: Clean up includes 37438/head
Daan De Meyer [Wed, 14 May 2025 15:12:06 +0000 (17:12 +0200)] 
vmspawn: Clean up includes

Split out of #37344

5 months agoxdg-autostart-generator: Clean up includes
Daan De Meyer [Wed, 14 May 2025 15:10:53 +0000 (17:10 +0200)] 
xdg-autostart-generator: Clean up includes

Split out of #37344

5 months agosd-bus: Make sure sd_bus_error and sd_bus_error_map structs are named
Daan De Meyer [Wed, 14 May 2025 15:20:57 +0000 (17:20 +0200)] 
sd-bus: Make sure sd_bus_error and sd_bus_error_map structs are named

Otherwise we can't forward declare them.

Split out of #37344

5 months agohashmap: Make sure Iterator struct is named
Daan De Meyer [Wed, 14 May 2025 15:14:35 +0000 (17:14 +0200)] 
hashmap: Make sure Iterator struct is named

Otherwise we can't forward declare it.

Split out of #37344

5 months agostatic-destruct: Move static_destruct() logic to implementation file
Daan De Meyer [Wed, 14 May 2025 13:06:50 +0000 (15:06 +0200)] 
static-destruct: Move static_destruct() logic to implementation file

This will allow us to remove the memory-util.h include from
static-destruct.h as part of #37344.

5 months agoblockdev-util: Remove dependency on string-util.h
Daan De Meyer [Wed, 14 May 2025 13:33:36 +0000 (15:33 +0200)] 
blockdev-util: Remove dependency on string-util.h

Let's insist on a string literal in SYS_BLOCK_PATH_MAX() so that
we don't accidentally allocate VLAs and let's inline strempty() in
xsprintf_sys_block_path() so we don't need to include string-util.h
in blockdev-util.h

We'll remove the actual string-util.h include as part of #37344.

5 months agoIntroduce forward.h header with forward declarations (#37428)
Daan De Meyer [Wed, 14 May 2025 14:51:10 +0000 (16:51 +0200)] 
Introduce forward.h header with forward declarations (#37428)

In preparation for adopting forward declarations to reduce unnecessary
transitive includes across the tree, let's introduce a forward.h header
with forward declarations for all libc, libsystemd, basic and shared
types.

Additionally, this header exports all basic integer types and errno
constants, as well as all macros including assertions macros. These
header files contain types often used in headers and are always included
in every source file one way or another anyway.

To avoid having to include memory-util.h and alloc-util.h in forward.h,
we split off the parts we need from both into cleanup-util.h and only
include cleanup-util.h in forward.h.

To keep this commit self-contained, we include cleanup-fundamental.h and
cleanup-util.h from the headers that originally contained the same
macros. We'll remove these again in a later commit that optimizes the
includes in src/basic and src/fundamental.

Split out of #37364

5 months agoboot: Use DEFINE_TRIVIAL_CLEANUP_FUNC() to define strv_freep() 37428/head
Daan De Meyer [Wed, 14 May 2025 13:45:15 +0000 (15:45 +0200)] 
boot: Use DEFINE_TRIVIAL_CLEANUP_FUNC() to define strv_freep()

5 months agotest: attempt to fix resolved wait-online testcase
Lennart Poettering [Wed, 14 May 2025 12:24:02 +0000 (14:24 +0200)] 
test: attempt to fix resolved wait-online testcase

Fixes: #37430
5 months agoci: extend validatefs testcase to validate verity partitions 37434/head
Lennart Poettering [Wed, 14 May 2025 12:24:51 +0000 (14:24 +0200)] 
ci: extend validatefs testcase to validate verity partitions

5 months agoman: document that gpt-label/gpt-type uuid xattrs are now lists
Lennart Poettering [Wed, 14 May 2025 12:36:09 +0000 (14:36 +0200)] 
man: document that gpt-label/gpt-type uuid xattrs are now lists

5 months agorepart: initialize validatefs xattrs to list *all* verity subordinate partitions
Lennart Poettering [Wed, 14 May 2025 10:35:52 +0000 (12:35 +0200)] 
repart: initialize validatefs xattrs to list *all* verity subordinate partitions

Now that we can actually list multiple gpt labels/type uuids in xattrs,
let's start doing so.

Fixes: #37157
5 months agovalidatefs: properly authenticate all subordinate devices of DM devices
Lennart Poettering [Wed, 14 May 2025 10:18:04 +0000 (12:18 +0200)] 
validatefs: properly authenticate all subordinate devices of DM devices

Previously, we'd only authenticate "one" of the subordinate devices of a
DM device, and which one was somewhat undefined, it would be what we
find in slaves/ first. This is in particular a problem with dm-verity
which generally has two subordinate devices: the data device and the
hash device.

Let's fix this properly. This means two things:

1. iterate through *all* subordinate devices of a DM device (i.e.
   iterate through the sysfs slaves/ subdir), not just
   one

2. permit configuring a list of gpt labels and gpt type uuids in the
   xattrs of mount points, so that all valid combinations can be listed.

This only updates the validation like this. The generation of xattrs
that carry multiple type uuids/labels in systemd-repart will follow in a
later commit.

This extends the syntax of the two gpt-related xattrs, to allow lists of
things. This is a true extension, without breaking compat (but even if
it was, it wouldn't matter given that validatefs was added post v257,
i.e. is not included in a stable release.

Fixes: #37157
5 months agoIntroduce forward.h header with forward declarations
Daan De Meyer [Tue, 13 May 2025 09:50:05 +0000 (11:50 +0200)] 
Introduce forward.h header with forward declarations

In preparation for adopting forward declarations to reduce unnecessary
transitive includes across the tree, let's introduce a forward.h header
with forward declarations for all libc, libsystemd, basic and shared types.

Additionally, this header exports all basic integer types and errno constants,
as well as all macros including assertions macros. These header files contain
types often used in headers and are always included in every source file one
way or another anyway.

To avoid having to include memory-util.h and alloc-util.h in forward.h, we
split off the parts we need from both into cleanup-util.h and only include
cleanup-util.h in forward.h.

To keep this commit self-contained, we include cleanup-fundamental.h and
cleanup-util.h from the headers that originally contained the same macros.
We'll remove these again in a later commit that optimizes the includes in
src/basic and src/fundamental.

Split out of #37364

5 months agovalidatefs: split out validate_fields_check() into three functions
Lennart Poettering [Wed, 14 May 2025 09:30:52 +0000 (11:30 +0200)] 
validatefs: split out validate_fields_check() into three functions

Just some basic refactoring, no actual code changes

5 months agoavoid race between systemd-logind and systemd-udevd in setting ACLs (#36444)
Lennart Poettering [Wed, 14 May 2025 11:03:46 +0000 (13:03 +0200)] 
avoid race between systemd-logind and systemd-udevd in setting ACLs (#36444)

Follow-up for #36408.
Hopefully fixes #24026, #28512, and/or #23547.

5 months agoAddress post-merge issues in the sysfail entry functionality (#37426)
Lennart Poettering [Wed, 14 May 2025 11:03:13 +0000 (13:03 +0200)] 
Address post-merge issues in the sysfail entry functionality (#37426)

5 months agofork-journal: some follow-ups (#37423)
Lennart Poettering [Wed, 14 May 2025 11:02:46 +0000 (13:02 +0200)] 
fork-journal: some follow-ups (#37423)

5 months agojournald: rename primary object from "Server" to "Manager"
Lennart Poettering [Wed, 14 May 2025 09:00:53 +0000 (11:00 +0200)] 
journald: rename primary object from "Server" to "Manager"

In all our daemons the primary entrypoint object is called "Manager".
But so far there was one exception: in journald it was called "Server".
Let's normalize that, and stick to the same nomenclature everywhere, to
make journald less special.

No real code change, just some search&replace.

5 months agosd-device: fix argument comment chase_flags 37380/head
Jelle van der Waa [Fri, 9 May 2025 13:47:00 +0000 (15:47 +0200)] 
sd-device: fix argument comment chase_flags

5 months agobasic: fix consistency of flags argument for chase and chaseat
Jelle van der Waa [Fri, 9 May 2025 13:42:26 +0000 (15:42 +0200)] 
basic: fix consistency of flags argument for chase and chaseat

Both functions have one flags argument, so we don't need to
rename them to `chase_flags`.

5 months agoshared/cred-util: fix argument comment for copy_file_at
Jelle van der Waa [Wed, 7 May 2025 17:53:18 +0000 (19:53 +0200)] 
shared/cred-util: fix argument comment for copy_file_at

5 months agoask-password-api: use flags consistently as argument name
Jelle van der Waa [Wed, 7 May 2025 17:34:11 +0000 (19:34 +0200)] 
ask-password-api: use flags consistently as argument name

5 months agotreewide: fix argument comment for getxattr_at_bool
Jelle van der Waa [Wed, 7 May 2025 17:22:31 +0000 (19:22 +0200)] 
treewide: fix argument comment for getxattr_at_bool

5 months agobasic: fix argument naming for vt_release
Jelle van der Waa [Wed, 7 May 2025 17:15:04 +0000 (19:15 +0200)] 
basic: fix argument naming for vt_release

5 months agohostname: use argument comment name transient_hostname
Jelle van der Waa [Wed, 7 May 2025 17:11:16 +0000 (19:11 +0200)] 
hostname: use argument comment name transient_hostname

5 months agonetwork: correct argument comment may_keep_dhcp
Jelle van der Waa [Wed, 7 May 2025 10:22:46 +0000 (12:22 +0200)] 
network: correct argument comment may_keep_dhcp

5 months agotest: correct argument comment simplified
Jelle van der Waa [Wed, 7 May 2025 10:20:34 +0000 (12:20 +0200)] 
test: correct argument comment simplified

5 months agoshared: dissect-image: use argument comment name label
Jelle van der Waa [Wed, 7 May 2025 10:17:01 +0000 (12:17 +0200)] 
shared: dissect-image: use argument comment name label

5 months agoshared: bootspec: use argument comment name auto_only
Jelle van der Waa [Wed, 7 May 2025 10:14:02 +0000 (12:14 +0200)] 
shared: bootspec: use argument comment name auto_only

5 months agovmspawn: correct argument comment
Jelle van der Waa [Wed, 7 May 2025 10:05:30 +0000 (12:05 +0200)] 
vmspawn: correct argument comment

5 months agoudev: fix argument comments for test_udev_rule_parse_value_one
Jelle van der Waa [Wed, 7 May 2025 09:55:38 +0000 (11:55 +0200)] 
udev: fix argument comments for test_udev_rule_parse_value_one

5 months agoupdate TODO
Lennart Poettering [Wed, 14 May 2025 07:36:15 +0000 (09:36 +0200)] 
update TODO

5 months agoman: run update-man-rules 37426/head
Igor Opaniuk [Wed, 14 May 2025 07:10:52 +0000 (09:10 +0200)] 
man: run update-man-rules

Re-generate meson rules (as systemd-boot-clear-sysfail.service.xml
man page was added).

Fixes: https://github.com/systemd/systemd/issues/37415
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
5 months agounits: fix systemd-boot-clear-sysfail description
Igor Opaniuk [Wed, 14 May 2025 07:10:06 +0000 (09:10 +0200)] 
units: fix systemd-boot-clear-sysfail description

Fix 's/systemd-boot-random-seed/systemd-boot-clear-sysfail/g'
copypaste.

Fixes: https://github.com/systemd/systemd/issues/37415
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
5 months agoman: fix systemd-boot-clear-sysfail description
Igor Opaniuk [Wed, 14 May 2025 07:06:54 +0000 (09:06 +0200)] 
man: fix systemd-boot-clear-sysfail description

Fix s/systemd-boot-random-seed/systemd-boot-clear-sysfail/g
copypaste.

Fixes: https://github.com/systemd/systemd/issues/37415
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
5 months agoUpdate description and uid checks when invoking pager (#37419)
Mike Yuan [Wed, 14 May 2025 01:01:41 +0000 (03:01 +0200)] 
Update description and uid checks when invoking pager (#37419)

5 months agofork-journal: drop unneeded cast 37423/head
Mike Yuan [Tue, 13 May 2025 21:07:17 +0000 (23:07 +0200)] 
fork-journal: drop unneeded cast

5 months agofork-journal: use char* const* for strv input param
Mike Yuan [Tue, 13 May 2025 20:58:02 +0000 (22:58 +0200)] 
fork-journal: use char* const* for strv input param

This is compatible with char** and is what I originally
asked for in
https://github.com/systemd/systemd/pull/36858#discussion_r2086792739
Someone needs to read better ;-)

5 months agojournalctl-show: report VARLINKERROR=
Mike Yuan [Tue, 13 May 2025 20:56:02 +0000 (22:56 +0200)] 
journalctl-show: report VARLINKERROR=

Who knows, maybe one day we'd support spawning journalctl
as varlink socket-activatable service, where this bit of
info would help.

5 months agojournalctl-show: check Context.has_cursor rather than arg_*
Mike Yuan [Tue, 13 May 2025 20:55:15 +0000 (22:55 +0200)] 
journalctl-show: check Context.has_cursor rather than arg_*

5 months agojournal: do not clear individual fields if the struct won't be reused
Mike Yuan [Tue, 13 May 2025 20:54:10 +0000 (22:54 +0200)] 
journal: do not clear individual fields if the struct won't be reused

Especially that only some of the fields are cleared currently.

5 months agomeson: fix path to coverage.h 37394/head
Yu Watanabe [Tue, 13 May 2025 15:58:32 +0000 (00:58 +0900)] 
meson: fix path to coverage.h

Follow-up for 30d20907bddfe064cc3437a888dd8f00d14929e4.

5 months agoTEST-73-LOCALE: skip lv keymap and friends
Yu Watanabe [Fri, 9 May 2025 07:33:12 +0000 (16:33 +0900)] 
TEST-73-LOCALE: skip lv keymap and friends

The following failure should be in libxkbcommon and/or sanitizer.
There is nothing we can do here. Let's skip it.

```
TEST-73-LOCALE.sh[3733]: + assert_rc 0 localectl set-keymap lv
TEST-73-LOCALE.sh[6699]: + set +ex
TEST-73-LOCALE.sh[6700]: Failed to set keymap: Remote peer disconnected
TEST-73-LOCALE.sh[6703]: FAIL: expected: '0' actual: '1'
TEST-73-LOCALE.sh[157]: + rm -f /etc/dbus-1/system.d/systemd-localed-read-only.conf
[FAILED] Failed to start TEST-73-LOCALE.service - TEST-73-LOCALE.
```
```
==3719==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7fa51f161000 at pc 0x7fa521250be4 bp 0x7ffe49130a80 sp 0x7ffe49130240
READ of size 19126 at 0x7fa51f161000 thread T0
    #0 0x7fa521250be3 in strndup (/usr/lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.asan.so+0x50be3) (BuildId: aa6231e817f72469c44a6c6cee9f0694a87db7fb)
    #1 0x7fa51f128325  (/lib64/libxkbcommon.so.0+0x1c325) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #2 0x7fa51f121952  (/lib64/libxkbcommon.so.0+0x15952) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #3 0x7fa51f123d3a  (/lib64/libxkbcommon.so.0+0x17d3a) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #4 0x7fa51f117c86  (/lib64/libxkbcommon.so.0+0xbc86) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #5 0x7fa51f12548f  (/lib64/libxkbcommon.so.0+0x1948f) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #6 0x7fa51f125c9e  (/lib64/libxkbcommon.so.0+0x19c9e) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #7 0x7fa51f126a59  (/lib64/libxkbcommon.so.0+0x1aa59) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #8 0x7fa51f12cec6  (/lib64/libxkbcommon.so.0+0x20ec6) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #9 0x7fa51f12e3c2  (/lib64/libxkbcommon.so.0+0x223c2) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #10 0x7fa51f12a4e5 in xkb_keymap_new_from_names (/lib64/libxkbcommon.so.0+0x1e4e5) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #11 0x5574dd63f864 in verify_xkb_rmlvo /usr/src/debug/systemd/src/locale/xkbcommon-util.c:69:14
(snip)
```

5 months agoTEST-73-LOCALE: drop unnecessary workaround
Yu Watanabe [Fri, 9 May 2025 08:09:19 +0000 (17:09 +0900)] 
TEST-73-LOCALE: drop unnecessary workaround

It should be fixed by 157d5b5c30b472c8c70a629a0c609ad240151746.

5 months agointegration-tests: adjust priorities
Yu Watanabe [Fri, 9 May 2025 07:56:48 +0000 (16:56 +0900)] 
integration-tests: adjust priorities

When running with sanitizers:
```
26/95 systemd:integration-tests / TEST-21-DFUZZER                          OK 1517.75s
40/95 systemd:integration-tests / TEST-85-NETWORK-NetworkdDHCPClientTests  OK  779.18s
42/95 systemd:integration-tests / TEST-04-JOURNAL                          OK  716.17s
```
and without sanitizers:
```
44/95 systemd:integration-tests / TEST-85-NETWORK-NetworkdDHCPClientTests  OK  730.33s
29/95 systemd:integration-tests / TEST-64-UDEV-STORAGE-simultaneous_events OK  701.49s
40/95 systemd:integration-tests / TEST-04-JOURNAL                          OK  348.05s
```

So, let's set higher priorities only on these tests.

5 months agogithub/mkosi: tentatively disable mkosi(opensuse) job
Yu Watanabe [Fri, 9 May 2025 07:41:06 +0000 (16:41 +0900)] 
github/mkosi: tentatively disable mkosi(opensuse) job

There is a package dependency issue in opensuse, and there is nothing we
can do. Let's reenable later when the issue is fixed.

5 months agoTEST-21-DFUZZER: skip test when no sanitizer is enabled
Yu Watanabe [Fri, 9 May 2025 08:45:26 +0000 (17:45 +0900)] 
TEST-21-DFUZZER: skip test when no sanitizer is enabled

5 months agosystemctl: make systemctl clean --what= values more discoverable (#37418)
Yu Watanabe [Tue, 13 May 2025 17:16:47 +0000 (02:16 +0900)] 
systemctl: make systemctl clean --what= values more discoverable (#37418)

5 months agoacl-util: make acl_find_uid() static 36444/head
Yu Watanabe [Thu, 27 Feb 2025 02:07:17 +0000 (11:07 +0900)] 
acl-util: make acl_find_uid() static

5 months agoudev: move devnoce_acl() to udev-builtin-uaccess.c
Yu Watanabe [Thu, 27 Feb 2025 01:45:13 +0000 (10:45 +0900)] 
udev: move devnoce_acl() to udev-builtin-uaccess.c

As it is now only used by udev-builtin-uaccess.c.

This also makes devnode_acl() use fd rather than path to device node.

5 months agologin,udev: avoid race between systemd-logind and systemd-udevd in setting ACLs
Yu Watanabe [Tue, 13 May 2025 14:02:13 +0000 (23:02 +0900)] 
login,udev: avoid race between systemd-logind and systemd-udevd in setting ACLs

Previously, both udevd and logind modifies ACLs of a device node. Hence,
there exists a race something like the following:
1. udevd reads an old state file,
2. logind updates the state file, and apply new ACLs,
3. udevd applies ACLs based on the old state file.

This makes logind not update ACLs but trigger uevents for relevant
devices to make ACLs updated by udevd.

5 months agologin: do not call manager_process_seat_device() more than once per event
Yu Watanabe [Tue, 13 May 2025 14:50:22 +0000 (23:50 +0900)] 
login: do not call manager_process_seat_device() more than once per event

When udevd broadcasts an event for e.g. a graphics device with master-of-seat
tag, then previously manager_process_seat_device() was called twice for
the event.

With this commit, the function is called only once even for an event for
such device.

5 months agologin: use FOREACH_STRING() at one more place
Yu Watanabe [Tue, 13 May 2025 15:21:41 +0000 (00:21 +0900)] 
login: use FOREACH_STRING() at one more place

5 months agodevice-util: introduce device_get_seat() helper function
Yu Watanabe [Tue, 13 May 2025 14:39:09 +0000 (23:39 +0900)] 
device-util: introduce device_get_seat() helper function

5 months agodevice-util: introduce several more helper functions
Yu Watanabe [Thu, 27 Feb 2025 04:19:03 +0000 (13:19 +0900)] 
device-util: introduce several more helper functions

This also makes device_in_subsystem() and device_is_devtype() return
negative error on critical error

5 months agobacklight: replace recursion with for loop
Yu Watanabe [Tue, 13 May 2025 15:02:07 +0000 (00:02 +0900)] 
backlight: replace recursion with for loop

5 months agobacklight: use device_get_sysattr_unsigned() at one more place
Yu Watanabe [Tue, 13 May 2025 14:59:50 +0000 (23:59 +0900)] 
backlight: use device_get_sysattr_unsigned() at one more place

5 months agoPrepare for reducing transitive includes in tests.h (#37414)
Daan De Meyer [Tue, 13 May 2025 17:02:12 +0000 (19:02 +0200)] 
Prepare for reducing transitive includes in tests.h (#37414)

5 months agopager: also check for $SUDO_UID 37419/head
Zbigniew Jędrzejewski-Szmek [Tue, 6 May 2025 12:29:02 +0000 (14:29 +0200)] 
pager: also check for $SUDO_UID

This returns to the original approach proposed in
https://github.com/systemd/systemd/pull/17270. After review, the approach was
changed to use sd_pid_get_owner_uid() instead. Back then, when running in a
typical graphical session, sd_pid_get_owner_uid() would usually return the user
UID, and when running under sudo, geteuid() would return 0, so we'd trigger the
secure path.

sudo may allocate a new session if is invoked outside of a session (depending
on the PAM config). Since nowadays desktop environments usually start the user
shell through user units, the typical shell in a terminal emulator is not part
of a session, and when sudo is invoked, a new session is allocated, and
sd_pid_get_owner_uid() returns 0 too. Technically, the code still works as
documented in the man page, but in the common case, it doesn't do the expected
thing.

$ build/test-sd-login |& rg 'get_(owner_uid|cgroup|session)'
sd_pid_get_session(0) → No data available
sd_pid_get_owner_uid(0) → 1000
sd_pid_get_cgroup(0) → /user.slice/user-1000.slice/user@1000.service/app.slice/app-ghostty-transient-5088.scope/surfaces/556FAF50BA40.scope

$ sudo build/test-sd-login |& rg 'get_(owner_uid|cgroup|session)'
sd_pid_get_session(0) → c289
sd_pid_get_owner_uid(0) → 0
sd_pid_get_cgroup(0) → /user.slice/user-0.slice/session-c289.scope

I think it's worth checking for sudo because it is a common case used by users.
There obviously are other mechanims, so the man page is extended to say that
only some common mechanisms are supported, and to (again) recommend setting
SYSTEMD_LESSSECURE explicitly. The other option would be to set "secure mode"
by default. But this would create an inconvenience for users doing the right
thing, running systemctl and other tools directly, because then they can't run
privileged commands from the pager, e.g. to save the output to a file. (Or the
user would need to explicitly set SYSTEMD_LESSSECURE. One option would be to
set it always in the environment and to rely on sudo and other tools stripping
it from the environment before running privileged code. But that is also fairly
fragile and it obviously relies on the user doing a complicated setup to
support a fairly common use case. I think this decreases usability of the
system quite a bit. I don't think we should build solutions that work in
priniciple, but are painfully inconvenient in common cases.)

Fixes https://yeswehack.com/vulnerability-center/reports/346802.

Also see https://github.com/polkit-org/polkit/pull/562, which adds support for
$SUDO_UID/$SUDO_GID to pkexec.

5 months agosystemctl: add "systemctl start -v" mode, which shows unit's logs while starting...
Lennart Poettering [Tue, 13 May 2025 16:03:16 +0000 (18:03 +0200)] 
systemctl: add "systemctl start -v" mode, which shows unit's logs while starting the unit (#36858)

5 months agosystemct: show all in output of systemctl clean --what=help 37418/head
Jörg Behrmann [Tue, 13 May 2025 15:21:02 +0000 (17:21 +0200)] 
systemct: show all in output of systemctl clean --what=help

5 months agoman: note for systemctl clean --what that commas separate values
Jörg Behrmann [Tue, 13 May 2025 15:20:37 +0000 (17:20 +0200)] 
man: note for systemctl clean --what that commas separate values

5 months agoman, systemctl: document --what=help
Jörg Behrmann [Tue, 13 May 2025 15:19:39 +0000 (17:19 +0200)] 
man, systemctl: document --what=help

5 months agoman: add missing fdstore in systemctl clean --what documentation
Jörg Behrmann [Tue, 13 May 2025 15:19:02 +0000 (17:19 +0200)] 
man: add missing fdstore in systemctl clean --what documentation

5 months agohwdb: add bladeRF SDR devices (#37413)
Yu Watanabe [Tue, 13 May 2025 14:44:29 +0000 (23:44 +0900)] 
hwdb: add bladeRF SDR devices (#37413)

5 months agobash: add shell completion 36858/head
Lennart Poettering [Tue, 13 May 2025 10:34:25 +0000 (12:34 +0200)] 
bash: add shell completion

No idea what I am doing, but this might be enough.

5 months agoupdate TODO
Lennart Poettering [Mon, 24 Mar 2025 10:53:39 +0000 (06:53 -0400)] 
update TODO

5 months agocompress: deal with zstd decoder issues gracefully
Lennart Poettering [Thu, 3 Apr 2025 15:28:11 +0000 (17:28 +0200)] 
compress: deal with zstd decoder issues gracefully

If zstd frames are corrupted the initial size returned for the current
frame might be wrong. Don#t assert() on that, but handle it gracefully,
as EBADMSG

5 months agologs-show: use memory_startswith() rather than startswith()
Lennart Poettering [Thu, 3 Apr 2025 13:00:54 +0000 (15:00 +0200)] 
logs-show: use memory_startswith() rather than startswith()

Let's be strict here: this data is conceptually not NUL terminated,
hence use memory_startswith() rather than startswith() (which implies
NUL termination). All other similar cases in logs-show.c got this right.
Fix the remaining three, too.

5 months agologs-show: handle bad messages like EOF
Lennart Poettering [Thu, 3 Apr 2025 13:02:22 +0000 (15:02 +0200)] 
logs-show: handle bad messages like EOF

Similar to the previous commit, but for logs-show.c

5 months agologs-show: drop unused function parameter
Lennart Poettering [Thu, 3 Apr 2025 14:19:12 +0000 (16:19 +0200)] 
logs-show: drop unused function parameter