Commit Graph

81477 Commits

Author SHA1 Message Date
Daan De Meyer
e59fa61ba2 mountfsd: Clean up includes
Split out of #37344.
2025-05-15 00:01:59 +02:00
Daan De Meyer
ca00c93962 nss: Clean up includes
Split out of #37344.
2025-05-15 00:01:59 +02:00
Daan De Meyer
06b5f13db3 shutdown: Clean up includes
Split out of #37344.
2025-05-15 00:01:59 +02:00
Daan De Meyer
bfe1e8fc5e busctl: Clean up includes
Split out of #37344.
2025-05-15 00:00:03 +02:00
Daan De Meyer
546bba9097 path: Clean up includes 2025-05-15 00:00:03 +02:00
Daan De Meyer
6795ef3505 timedate: Clean up includes
Split out of #37344.
2025-05-15 00:00:03 +02:00
Daan De Meyer
2a5559c290 userdb: Clean up includes
Split out of #37344.
2025-05-15 00:00:03 +02:00
Daan De Meyer
90711654df user-record: Make sure UserStorage enum has the same name as its typedef 2025-05-15 00:00:03 +02:00
Daan De Meyer
a1ccfc420c tree-wide: Clean up includes (#37457) 2025-05-14 23:53:49 +02:00
Daan De Meyer
8857aa74e5 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.
2025-05-14 22:34:02 +02:00
Daan De Meyer
0dc510ab03 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.
2025-05-14 22:34:02 +02:00
Daan De Meyer
08fd159db1 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.
2025-05-14 22:33:45 +02:00
Luca Boccassi
74acb358c5 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 89e546e927
Follow-up for 4a3bf440f2
2025-05-14 21:24:48 +01:00
Daan De Meyer
9ebbb785b0 serialize: Move some logic to the implementation file
This will allow removing the string-util.h include in #37344.
2025-05-15 04:25:47 +09:00
Yu Watanabe
ff4814f60c validatefs: follow ups for recent change (#37447)
Follow-ups for #37434.
2025-05-15 04:25:28 +09:00
Yu Watanabe
1ef6cee327 Bugprone argument comment - round 4 (#37380)
Follow up from https://github.com/systemd/systemd/pull/37356
2025-05-15 03:36:16 +09:00
Daan De Meyer
17b0d165f6 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 d5e12dc75e
2025-05-15 03:33:32 +09:00
Yu Watanabe
561f53c92b Small fixups after review for stable (#37442) 2025-05-15 03:30:41 +09:00
Yu Watanabe
5472f6c78f Improve hwdb boilerplate texts (#37440) 2025-05-15 03:29:53 +09:00
Yu Watanabe
f78e89b018 validatefs: split out validating gpt label and type
No functional change, just refactoring.
This addresses https://github.com/systemd/systemd/pull/37434#discussion_r2088950725.
2025-05-15 02:58:05 +09:00
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
Zbigniew Jędrzejewski-Szmek
81d7934882 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 c0239e5f11.
2025-05-14 18:35:32 +02:00
Zbigniew Jędrzejewski-Szmek
1a47f96a8d 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.
2025-05-14 18:35:32 +02:00
Zbigniew Jędrzejewski-Szmek
c730fd7ddd elf2efi: make code more pythonic
Follow-up for 53628612b7.

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.
2025-05-14 18:35:21 +02:00
Luca Boccassi
fa25fece05 Minor docs cleanups (#37439) 2025-05-14 17:16:05 +01:00
Zbigniew Jędrzejewski-Szmek
9282a85ed7 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.
2025-05-14 18:08:26 +02:00
Zbigniew Jędrzejewski-Szmek
97f7b74f97 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 0213a26f65,
but was added in other places in 57bb707d48.

Directly inspired by 951e8cb060, but
the wrong boilerplate was added in other places too.
2025-05-14 18:08:26 +02:00
Zbigniew Jędrzejewski-Szmek
16acf66cf6 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.
2025-05-14 18:08:26 +02: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