Commit graph

74242 commits

Author SHA1 Message Date
Ronan Pigott 364c948707 resolved: permit dnssec rrtype questions when we aren't validating
This check introduced in 91adc4db33 is intended to spare us from
encountering broken resolver behavior we don't want to deal with.
However if we aren't validating we more than likely don't know the state
of the upstream resolver's support for dnssec. Let's let clients try
these queries if they want.

This brings the behavior of sd-resolved in-line with previouly stated
change in the meaning of DNSSEC=no, which now means "don't validate"
rather than "don't validate, because the upstream resolver is declared to
be dnssec-unaware".

Fixes: 9c47b33444 ("resolved: enable DNS proxy mode if client wants DNSSEC")
2024-06-12 18:50:45 +09:00
Yu Watanabe 707890d4ff
Merge pull request #33074 from keszybz/bpf-fd-handling
Small cleanups in bpf code
2024-06-12 18:44:30 +09:00
Yu Watanabe a07c903a38
Merge pull request #33071 from keszybz/sd_event_source-cleanup
Clean up calls to sd_event_source_set_enabled()
2024-06-12 18:42:14 +09:00
Yu Watanabe 42d281a197
Merge pull request #32972 from keszybz/small-cleanups
Small cleanups
2024-06-12 18:38:09 +09:00
Дамјан Георгиевски d357f129b2 vsock-mux ssh proxy
allow the ssh-proxy to connect to cloud-hypervisor/Firecracker guests,
via their unix-domain socket to AF_VSOCK multiplexer:

https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/vsock.md
https://github.com/firecracker-microvm/firecracker/blob/main/docs/vsock.md
2024-06-12 18:36:21 +09:00
Yu Watanabe 12c9ebbbe4
Merge pull request #32933 from YHNdnzj/faccessat-empty-path
fs-util: several cleanups
2024-06-12 18:35:13 +09:00
Yu Watanabe 3c7eea0724 core: invoke_main_loop() does not return MANAGER_RELOAD
Follow-up for 5409c6fcc5.
2024-06-12 18:31:41 +09:00
Daan De Meyer d6518003f8 tpm2-setup: Don't fail if we can't access the TPM due to authorization failure
The TPM might be password/pin protected for various reasons even if
there is no SRK yet. Let's handle those cases gracefully instead of
failing the unit as it is enabled by default.
2024-06-12 18:31:21 +09:00
Yu Watanabe 0ef63b11aa
Merge pull request #32847 from YHNdnzj/exitrd
shutdown: several cleanups, rename initrd to exitrd
2024-06-12 18:28:33 +09:00
Yu Watanabe f7da67db58
Merge pull request #32720 from poettering/hostnamed-no-varlink-exit-on-idle
hostnamed: exit-on-idle tweaks
2024-06-12 18:25:24 +09:00
Yu Watanabe 29d5da5fef
Merge pull request #32603 from YHNdnzj/install-basename
shared/install: modernize and eliminate the use of basename()
2024-06-12 18:22:10 +09:00
Ian Abbott c8596cc640 udev: tag MTD devices for systemd
Allow systemd units to require/bind to MTD devices.  One use case is for
using a systemd service to attach an MTD device to an UBI controller,
which cannot be done until the MTD device has been probed.

Fixes #33096
2024-06-12 00:18:33 +01:00
Matthieu Baerts (NGI0) 3f69070598 core/socket: allow MPTCP protocol
Multipath TCP (MPTCP), standardized in RFC8684 [1], is a TCP extension
that enables a TCP connection to use different paths. It allows a device
to make use of multiple interfaces at once to send and receive TCP
packets over a single MPTCP connection. MPTCP can aggregate the
bandwidth of multiple interfaces or prefer the one with the lowest
latency, it also allows a fail-over if one path is down, and the traffic
is seamlessly re-injected on other paths.

To benefit from MPTCP, both the client and the server have to support
it. Multipath TCP is a backward-compatible TCP extension that is enabled
by default on recent Linux distributions (Debian, Ubuntu, Redhat, ...).
Multipath TCP is included in the Linux kernel since version 5.6 [2]. To
use it on Linux, an application must explicitly enable it when creating
the socket:

  int sd = socket(AF_INET(6), SOCK_STREAM, IPPROTO_MPTCP);

No need to change anything else in the application.

This patch allows MPTCP protocol in the Socket unit configuration. So
now, a <unit>.socket can contain this to use MPTCP instead of TCP:

  [Socket]
  SocketProtocol=mptcp

MPTCP support has been allowed similarly to what has been already done
to allow SCTP: just one line in core/socket.c, a very simple addition
thanks to the flexible architecture already in place.

On top of that, IPPROTO_MPTCP has also been added in the list of allowed
protocols in two other places, and in the doc. It has also been added to
the missing_network.h file, for systems with an old libc -- note that it
was also required to include <netinet/in.h> in this file to avoid
redefinition errors.

Link: https://www.rfc-editor.org/rfc/rfc8684.html [1]
Link: https://www.mptcp.dev [2]
2024-06-12 00:14:08 +01:00
Kamil Szczęk 608bfe76c1 core: populate $REMOTE_ADDR for AF_UNIX sockets
Set the $REMOTE_ADDR environment variable for AF_UNIX socket connections
when using per-connection socket activation (Accept=yes). $REMOTE_ADDR
will now contain the remote socket's file system path (starting with a
slash "/") or its address in the abstract namespace (starting with an
at symbol "@").

This information is essential for identifying the remote peer in AF_UNIX
socket connections, but it's not easy to obtain in a shell script for
example without pulling in a ton of additional tools. By setting
$REMOTE_ADDR, we make this information readily available to the
activated service.
2024-06-12 00:11:10 +01:00
Mike Yuan bd6e5b4d93 core/manager: enclose debug info acquirement in 'if (DEBUG_LOGGING)' 2024-06-12 00:10:12 +01:00
Daan De Meyer dc38f9addd rules: Limit the number of device units generated for serial ttys
As per the suggestion in https://github.com/systemd/systemd/issues/33242.

This reduces the number of /dev/ttySXX device units generated in
mkosi from 32 to 4.
2024-06-12 00:09:26 +01:00
Yu Watanabe 442c6bd4ba udev: rewrite token_match_attr() to make it easier for Coverity to understand
No functional change.

Closes CID#1469719.
2024-06-12 00:07:33 +01:00
Yu Watanabe 40f9fa0af4 sd-dhcp-server: clear buffer before receive
I do not think this is necessary, but all other places in
libsystemd-network we clear buffer before receive. Without this,
Coverity warns about use-of-uninitialized-values.
Let's silence Coverity.

Closes CID#1469721.
2024-06-12 00:06:46 +01:00
Lennart Poettering 75fb956f70 bus-util: check sd_bus_pending_method_calls() when determining whether a service is idle 2024-06-11 23:17:38 +01:00
Lennart Poettering 48ce0824dc sd-bus: add new sd_bus_pending_method_calls() call 2024-06-11 23:17:38 +01:00
Lennart Poettering ec8bbd8adb tree-wide: never consider service idle if polkit authentication is still pending
Let's be correct on this.
2024-06-11 23:17:38 +01:00
Lennart Poettering ac908152b3 hostnamed: don't allow hostnamed to exit on idle if varlink connections are still ongoing
And while we are at it, ongoing PK authorizations are also a reason to
block exit on idle.
2024-06-11 23:17:38 +01:00
Mike Yuan 178a71d970 unit-file,portable: replace streq + basename with path_equal_filename 2024-06-11 23:17:21 +01:00
Mike Yuan 521a7c9bb9 shared/install: use FOREACH_ARRAY at one more place 2024-06-11 23:17:21 +01:00
Mike Yuan 3e02c8d87d shared/install: replace streq + basename with path_equal_filename 2024-06-11 23:17:21 +01:00
Mike Yuan d51c404507 shared/install: use path_extract_filename in install_info_traverse 2024-06-11 23:17:21 +01:00
Mike Yuan ca3c95c1c5 shared/install: modernize unit_file_get_list, use key destructor
The rest of the basename()s are easy to drop.
2024-06-11 23:17:21 +01:00
Mike Yuan 0bb4614adc shared/install: modernize unit_file_link
Also eliminate one more use of basename(), yay!
2024-06-11 23:17:21 +01:00
Mike Yuan e9e77e443d install,dbus-manager: make unit_file_* take (char* const*) for strv 2024-06-11 23:17:21 +01:00
Mike Yuan 1ac0056cc2 shared/install: modernize install_info_add 2024-06-11 23:17:21 +01:00
Mike Yuan df152dbbe5 shared/install: modernize find_symlinks and friends 2024-06-11 23:17:21 +01:00
Mike Yuan 1d2e1cad30 shared/install: modernize remove_marked_symlink_fd
Note that we now collect errors from
install_changes_add(), too.
2024-06-11 23:17:21 +01:00
Mike Yuan 05adb256f1 shared/install: return bool where appropriate 2024-06-11 23:17:21 +01:00
Mike Yuan f9ef2aad28 shared/dropin: minor modernization 2024-06-11 23:17:21 +01:00
Luca Boccassi 1ea7bda77f meson: update version to 257~devel 2024-06-11 22:55:29 +01:00
Luca Boccassi 870a8a3cc5 NEWS: add placeholder for 257 2024-06-11 22:55:03 +01:00
Luca Boccassi 5c79cdec10 Finalize NEWS and version for v256 2024-06-11 22:42:06 +01:00
Luca Boccassi 8b884bdf36 Update hwdb
ninja -C build update-hwdb
2024-06-11 22:40:37 +01:00
Lennart Poettering a5139b1415 tpm2-util: tighten rules on the nvindex handle range we allocate from
Let's follow the conventions set by "Registry of Reserved TPM 2.0 Handles
and Localities" and only allocate nvindex currently not assigned to any
vendor.

For details see:

https://trustedcomputinggroup.org/resource/registry/

Section 2.2
2024-06-11 22:40:23 +01:00
Tobias Jakobi 9afc6ac87c hwdb: add keyboard mappings for the Ayaneo Kun face buttons
See comment in hwdb file for details.
2024-06-12 02:49:06 +09:00
Yu Watanabe 7b88bf087f shared: fix typo: dito -> ditto
Follow-up for bc9e5a4c67 and
3572d3df8f.
2024-06-12 02:34:39 +09:00
Zbigniew Jędrzejewski-Szmek 7b529bfc47 man: document that separate /usr/local/ must not be used for config
Since we document /usr/local/lib/systemd/ and other paths for various things,
add notes that this is not supported if /usr/local is a separate partition. In
systemd.unit, I tried to add the footnote in the table where
/usr/local/lib/systemd/ is listed, but that get's rendered as '[sup]a[/sup]'
with a mangled footnote at the bottom of the table :( .

Also, split paragraphs in one place where the subject changes without any
transition.

Follow-up for 02f35b1c90.
Replaces https://github.com/systemd/systemd/pull/33231.
2024-06-11 18:02:31 +01:00
Zbigniew Jędrzejewski-Szmek 835fbe5f75 bus-unit-util: extend the bus call timeout for UnitFreezer
Follow-up for 1d617b35fe.
Should fix https://github.com/systemd/systemd/issues/33269.

From the logs in the bug:
Jun 10 22:55:37 systemd-logind[909]: The system will suspend now!
Jun 10 22:55:37 ModemManager[996]: <msg> [sleep-monitor-systemd] system is about to suspend
...
Jun 10 22:55:48 systemd-sleep[422408]: Failed to freeze unit 'user.slice': Connection timed out
Jun 10 22:55:48 systemd-sleep[422408]: Performing sleep operation 'suspend'...

The delay is ~11 s, consistent with the patch that set the timeout to 10 s.
Looks like this is not enough. It's the freeze operation that fails, but
thawing might be slow too, so just bump the timeout again.
2024-06-11 14:56:00 +01:00
Daan De Meyer 7efaab482a chase: Tighten "." and "./" check
Currently the check also succeeds if the input path starts with a dot, whereas
we only want it to succeed for "." and "./". Tighten the check and add a test.
2024-06-11 13:55:35 +01:00
Yu Watanabe 8843726ac2 test-network: wait a while for addresses to be dropped
Hopefully fixes the following failure:
```
======================================================================
FAIL: test_ipv6_token_prefixstable (__main__.NetworkdRATests.test_ipv6_token_prefixstable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/systemd/tests/testdata/test-network/systemd-networkd-tests.py", line 5705, in test_ipv6_token_prefixstable
    self.assertNotIn('2002:da8:1:0:b47e:7975:fc7a:7d6e/64', output) # the 1st prefixstable
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '2002:da8:1:0:b47e:7975:fc7a:7d6e/64' unexpectedly found in
  '19: veth99@veth-peer: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000\n
       inet6 2002:da8:1:0:b47e:7975:fc7a:7d6e/64 scope global tentative dynamic mngtmpaddr noprefixroute \n
          valid_lft 2100sec preferred_lft 1000sec\n
       inet6 2002:da8:1:0:da5d:e50a:43fd:5d0f/64 scope global dynamic mngtmpaddr noprefixroute \n
          valid_lft 2100sec preferred_lft 1000sec\n
       inet6 fe80::1034:56ff:fe78:9abc/64 scope link proto kernel_ll \n
          valid_lft forever preferred_lft forever'
----------------------------------------------------------------------
```
2024-06-11 13:52:41 +01:00
Zbigniew Jędrzejewski-Szmek 6eddfeebdb man/systemd-soft-reboot.service: upgrade drop-in to unit file for slice
Follow-up for d91c7c91bf.
Closes https://github.com/systemd/systemd/issues/33260.
2024-06-11 10:36:50 +01:00
Yu Watanabe 18200b426e shell-completion: update bash completion for networkctl 2024-06-11 10:35:55 +01:00
Yu Watanabe ba5e44e26b shell-completion: update bash-completion for udevadm
- Add missing options.
- Show device nodes when supported.

Closes #33265.
2024-06-11 10:35:29 +01:00
Yu Watanabe 60c1fec461 homed: fix typo
Follow-up for c4b5de7eff.
2024-06-11 15:52:13 +09:00
Yu Watanabe 753c896ff9 login: re-used -> reused
Suggested by Fossies.
2024-06-11 15:52:13 +09:00