Commit Graph
81438 Commits
Author SHA1 Message Date
Yu Watanabe e4db2c9b83 validatefs: drop unnecessary empty lines 2025-05-15 02:57:57 +09:00
Yu Watanabe e71ff6639c man: fix typo
Follow-up for 778cfac5fb.
Addresses https://github.com/systemd/systemd/pull/37434#discussion_r2088882005.
2025-05-15 02:56:30 +09:00
Daan De Meyer 7305347221 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.
2025-05-14 19:55:56 +02:00
Daan De Meyer d802d40e86 forward: Add forward declaration for LockFile (#37445) 2025-05-14 19:55:18 +02:00
Daan De Meyer e03e45aef2 Cleanup up includes #1 (#37438) 2025-05-14 19:55:03 +02:00
Daan De Meyer ba6d1f9aca forward: Add forward declaration for LockFile 2025-05-14 19:20:00 +02:00
Yu Watanabe eba8cc8981 integration-tests: several cleanups (#37394) 2025-05-15 01:45:10 +09:00
Luca Boccassi fa25fece05 Minor docs cleanups (#37439) 2025-05-14 17:16:05 +01:00
Zbigniew Jędrzejewski-Szmek 2fe7cdd91a docs/BOOT_LOADER_INTERFACE: minor grammar fixes 2025-05-14 18:06:38 +02:00
Zbigniew Jędrzejewski-Szmek f72e277d0b docs: punctuation and a typo 2025-05-14 18:06:04 +02:00
Lennart Poettering 4fefc10c0d validatefs: fix checks on file systems backed by multiple devices (i.e. verity) (#37434)
Fixes #37157
2025-05-14 17:53:06 +02:00
Daan De Meyer e2165e01bd vmspawn: Clean up includes
Split out of #37344
2025-05-14 17:21:37 +02:00
Daan De Meyer 5a94aaaf5d xdg-autostart-generator: Clean up includes
Split out of #37344
2025-05-14 17:21:37 +02:00
Daan De Meyer 905ebf6b79 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
2025-05-14 17:21:37 +02:00
Daan De Meyer 5f7b80b4e5 hashmap: Make sure Iterator struct is named
Otherwise we can't forward declare it.

Split out of #37344
2025-05-14 17:21:37 +02:00
Daan De Meyer 02b6ac3a50 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.
2025-05-14 16:56:41 +02:00
Daan De Meyer bdcd47a269 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.
2025-05-14 16:56:05 +02:00
Daan De Meyer 5f3b558b99 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
2025-05-14 16:51:10 +02:00
Daan De Meyer b23c1cf55e boot: Use DEFINE_TRIVIAL_CLEANUP_FUNC() to define strv_freep() 2025-05-14 16:22:54 +02:00
Lennart Poettering c019ad849f test: attempt to fix resolved wait-online testcase
Fixes: #37430
2025-05-14 16:09:32 +02:00
Lennart Poettering 61b15b78e5 ci: extend validatefs testcase to validate verity partitions 2025-05-14 15:44:54 +02:00
Lennart Poettering 778cfac5fb man: document that gpt-label/gpt-type uuid xattrs are now lists 2025-05-14 15:44:54 +02:00
Lennart Poettering 02347d24e4 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
2025-05-14 15:44:54 +02:00
Lennart Poettering f7d3262844 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
2025-05-14 15:44:54 +02:00
Daan De Meyer 686bbf1e7f 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
2025-05-14 15:44:17 +02:00
Lennart Poettering 510e966677 validatefs: split out validate_fields_check() into three functions
Just some basic refactoring, no actual code changes
2025-05-14 13:04:20 +02:00
Lennart Poettering 798d140cac avoid race between systemd-logind and systemd-udevd in setting ACLs (#36444)
Follow-up for #36408.
Hopefully fixes #24026, #28512, and/or #23547.
2025-05-14 13:03:46 +02:00
Lennart Poettering 66d84090f4 Address post-merge issues in the sysfail entry functionality (#37426) 2025-05-14 13:03:13 +02:00
Lennart Poettering 86bb6f4052 fork-journal: some follow-ups (#37423) 2025-05-14 13:02:46 +02:00
Lennart Poettering c55f87062d 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.
2025-05-14 13:02:26 +02:00
Lennart Poettering d6319768bd update TODO 2025-05-14 09:36:15 +02:00
Igor Opaniuk 51e1c882fa 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>
2025-05-14 09:34:07 +02:00
Igor Opaniuk 8130af42e2 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>
2025-05-14 09:34:07 +02:00
Igor Opaniuk 6f7639f0fe 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>
2025-05-14 09:33:57 +02:00
Mike Yuan b431092675 Update description and uid checks when invoking pager (#37419) 2025-05-14 03:01:41 +02:00
Mike Yuan 38e3f79d52 fork-journal: drop unneeded cast 2025-05-13 23:11:34 +02:00
Mike Yuan b86b1ca22f 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 ;-)
2025-05-13 23:01:23 +02:00
Mike Yuan c49c2477a4 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.
2025-05-13 22:57:29 +02:00
Mike Yuan df3c049fa5 journalctl-show: check Context.has_cursor rather than arg_* 2025-05-13 22:55:15 +02:00
Mike Yuan 2627c8e79e journal: do not clear individual fields if the struct won't be reused
Especially that only some of the fields are cleared currently.
2025-05-13 22:54:10 +02:00
Yu Watanabe e9ad95438d meson: fix path to coverage.h
Follow-up for 30d20907bd.
2025-05-14 02:28:27 +09:00
Yu Watanabe 18609909d9 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)
```
2025-05-14 02:28:27 +09:00
Yu Watanabe 7ded7cfb7f TEST-73-LOCALE: drop unnecessary workaround
It should be fixed by 157d5b5c30.
2025-05-14 02:28:27 +09:00
Yu Watanabe 71078275e8 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.
2025-05-14 02:28:27 +09:00
Yu Watanabe 48a092afbb 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.
2025-05-14 02:28:27 +09:00
Yu Watanabe 59dd650501 TEST-21-DFUZZER: skip test when no sanitizer is enabled 2025-05-14 02:28:22 +09:00
Yu Watanabe 5884fafcd7 systemctl: make systemctl clean --what= values more discoverable (#37418) 2025-05-14 02:16:47 +09:00
Yu Watanabe 003c6faff4 acl-util: make acl_find_uid() static 2025-05-14 02:06:02 +09:00
Yu Watanabe 1abb592f2f 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.
2025-05-14 02:06:02 +09:00
Yu Watanabe c960ca2be1 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.
2025-05-14 02:06:02 +09:00