Commit Graph
81488 Commits
Author SHA1 Message Date
Luca Boccassi a49f3c3890 Update hwdb (#37470)
Update hwdb, even though we are pretty far from a release in order to:
- incrementally test upstream additions to hwdb
- allow backports to stable branches
2025-05-15 12:09:03 +01:00
Luca Boccassi ed5c3f4436 core: use socket cookie for naming per-connection service instances + set $SO_COOKIE env var to it (#37469) 2025-05-15 11:11:21 +01:00
Tommy Unger ef3a0478bb test: write file from systemd service in transient unit
This integration test demonstrates that a containerized systemd instance can
write to a bind mounted file observable to the host. Specifically, the bash
script uses systemd-run to start a systemd instance as a transient unit
container. This systemd-run command bind mounts a directory the container will
share with the host, and runs an internal service which creates and writes to a
file from the container's view of this directory. When finished writing, the
service runs the exit target, terminating the internal systemd instance, and
ending the lifetime of the container.

The script waits for the container to finish running, then verifies that the
expected file contents were written on the host side of the filesystem mount.

This test employs a workaround, creating an unmasked procfs mount on the host
which enables the privileged guest to create its own mounts internally. This
may indicate a systemd bug, as the privileged container should not rely on
the existence of an unmasked procfs on the host in order to mount its own
filesystems internally.
2025-05-15 11:33:23 +02:00
Lennart Poettering 62e5b90a49 varlink: two tweaks for method call handling (#37466) 2025-05-15 11:28:58 +02:00
Zbigniew Jędrzejewski-Szmek 7bd6626a43 hwdb: run "update-hwdb-autosuspend"
As usual, mostly additions and a few removals.
2025-05-15 10:51:28 +02:00
Zbigniew Jędrzejewski-Szmek f41c0fa11e hwdb: run "update-hwdb"
As usual, it seems to be mostly additions and corrections.

The last update was in 0d740f4bc0, Dec 10th. I
think it's reasonable to update the hwdb more often. In particular, I want to
push an update to the stable branches, but it should be updated in 'main'
first.
2025-05-15 10:50:28 +02:00
Lennart Poettering 1619918da7 update TODO 2025-05-15 09:53:30 +02:00
Yu Watanabe 6a4fe38f7f network: do not drop duplicated entries in loop
Fixes #37456.
2025-05-15 09:49:46 +02:00
Lennart Poettering 9be6e18444 core: name socket unit instances after the socket cookie
On linux sockets have a really good, unique identifier, the SO_COOKIE,
which is used by sockdiag and BPF and elsewhere. Let's expose this more
prominently in the service name of per-connection services invoked via
Accept=yes sockets.

This is really nice, because together with our $SO_COOKIE env var we can
now match up services, process execution contexts, and "ss" outputs, BPF
rules, and more.
2025-05-15 09:45:33 +02:00
Lennart Poettering bfb1f9e2c9 core: pass the socket cookie to invoked per-connection service instances as $SO_COOKIE env var
The socket cookie is just too useful for identifying connections, let's
emphasize this a bit and pass it as environment variable.
2025-05-15 09:45:32 +02:00
Lennart Poettering 272017d32a socket-util: add trivial socket_get_cookie() helper 2025-05-15 09:45:19 +02:00
Lennart Poettering 3bdcd994cd man: correct version information when $REMOTE_ADDR/$REMOTE_PORT where added
This was in commit 3b1c524154, i.e. in the
v220 cycle.
2025-05-15 09:45:19 +02:00
Lennart Poettering 99d52ab51f man: don't claim REMOTE_PORT= was initialized to the protocol for AF_RAW sockets
This claim has no basis in reality, not even in the original commit
where the sentence was added this was true, see
3b1c524154.

Hence removing.
2025-05-15 09:33:34 +02:00
Lennart Poettering 8d7d2edcbb bus-polkit: add a generic vtable for methods with no params, but with polkit 2025-05-15 09:31:27 +02:00
Lennart Poettering 231cab5c5e core: always handle method call params via sd_varlink_dispatch(), even if we accept none
This results in much more precise errors for the clients, and is what we
do everywhere else these days.
2025-05-15 09:31:27 +02:00
Mike Yuan 946eea7a7f mountpoint-util: remove unused TMPFS_LIMITS_SYS_FS_CGROUP
Follow-up for 6801a9d88a
2025-05-15 09:00:51 +09:00
Mike Yuan 68a2435cc2 cgroup-util: drop cg_kill() cgroup.threads kludge
Our baseline is v5.4 now.
2025-05-15 07:26:03 +09:00
Yu Watanabe 231557fe40 resolve: fix typo
Follow-up for 801ad6a6a9.
2025-05-15 07:19:24 +09:00
Daan De Meyer 3b21af5234 hashmap: Split out iterator.h
As preparation for #37344, let's split out iterator.h so we can
avoid including the entirety of hashmap.h where it's not needed.
2025-05-15 00:01:32 +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