Commit graph

74504 commits

Author SHA1 Message Date
Ronan Pigott bd73de3575 ndisc: Parse RFC9463 encrypted DNS (DNR) option
This option is equivalent to the V4/V6 DNR options for DHCP.
2024-06-20 08:36:00 -07:00
Ronan Pigott e3d2befc13 test-network: add DHCPv6 DNR test
Same as the DHCPv4 test.
2024-06-20 08:36:00 -07:00
Ronan Pigott 59b867823f network: Serialize DHCPv6 DNR servers
This serializes DNR servers acquired by V6_DNR option, equivalent to the
V4_DNR option.
2024-06-20 08:36:00 -07:00
Ronan Pigott cff8947fac network: Introduce UseDNR DHCPv6 option
This is equivalent to the DHCPv4 option introduced earlier.
2024-06-20 08:36:00 -07:00
Ronan Pigott 072071bc61 network: Parse RFC9463 DHCPv6 DNR option
Implement the parsing for V6_DNR DHCPv6 option. This does the same as
the DHCP V4_DNR option.
2024-06-20 08:36:00 -07:00
Ronan Pigott 47b87dc2ed dhcp6: use dns_name_from_wire_format
Convert some of the option parsing to use dns_name_from_wire_format,
introduced earlier. No change in behavior intended.
2024-06-20 08:36:00 -07:00
Ronan Pigott aeed60a1fc test-dhcp6: terminate fqdn option
The encoded fqdn in this option must be properly terminated. We will
soon validate that this field is correctly encoded, so correct it in the
test.
2024-06-20 08:36:00 -07:00
Ronan Pigott c42ed79c3a test-network: add test for DHCPv4 DNR
This will test that networkd/resolved can understand the V4_DNR DHCP
option.
2024-06-20 08:36:00 -07:00
Ronan Pigott ea72b708ed network: Serialize DNR servers
Implement serialization/deserialization for DNR servers. This re-uses
the string format in place for user configuration of DoT servers, and as
a consequence non-DoT servers are discarded when recording the link
configuration, for correctness.

This also enables sd-resolved to use these servers as it would other DNS
servers.
2024-06-20 08:36:00 -07:00
Ronan Pigott 169f90c158 network: Add serialization for DoT resolvers
For now only DoT is supported, so DoT resolvers are represented using
the existing configuration format.
2024-06-20 08:36:00 -07:00
Ronan Pigott 9fcc5d2d78 network: Introduce UseDNR DHCPv4 option
This option will control the use of DNR for choosing DNS servers on the
link. Defaults to the value of UseDNS so that in most cases they will be
toggled together.
2024-06-20 08:36:00 -07:00
Ronan Pigott 3f484e344a network: parse RFC9463 DHCPv4 DNR option
This option is another way for DHCP servers to indicate preferred DNS
servers for the network, but includes more detailed info like the server
name, transport (DoT/DoH/DoQ etc.), and port.

Allow our DHCPv4 client to parse this option.
2024-06-20 08:36:00 -07:00
Ronan Pigott 2c313e2907 network: Introduce sd_dns_resolver
This type will be used to represent a "designated resolver", and the
necessary info for communicating with it. Beyond and address endpoint,
we may need to know the dns transport, authenticated domain name, DoH
path, etc.
2024-06-20 08:35:57 -07:00
Ronan Pigott c9fa4f5aca dns: introduce dns_name_from_wire_format
This is implemented in various places, but it is better to share this
code.
2024-06-20 08:30:55 -07:00
Yu Watanabe 912730a2d5
Merge pull request #33426 from aafeijoo-suse/conf-parser-parse-size-log
conf-parser: print why config_parse_iec_uint64() fails
2024-06-20 23:56:59 +09:00
Ludwig Nussel 0e10c3d872 logind: implement maintenance time
Update frameworks that work automatically in the background
occasionally need to schedule reboots. Systemd-logind already
provides a nice mechanism to schedule shutdowns, send notfications
and block logins short before the time. Systemd has a framework for
calendar events, so we may conveniently use logind to define a
maintenance time for reboots.

The existing ScheduleShutdown DBus method in logind expects a usec_t
with an absolute time. Passing USEC_INFINITY as magic value now tells
logind to take the time from the configured maintenance time if set.

"shutdown -r" leverages that and uses the maintenance time
automatically if configured. The one minute default is still used if
nothing was specified.

Similarly the new 'auto' setting for the --when parameter of systemctl
uses the maintenance time if configured or a one minute timer like the
shutdown command.
2024-06-20 14:37:42 +02:00
Kamil Szczęk e262205eb7 cryptenroll: support for enrolling FIDO2 tokens in manual mode
systemd-cryptsetup supports a FIDO2 mode with manual parameters, where
the user provides all the information necessary for recreating the
secret, such as: credential ID, relaying party ID and the salt. This
feature works great for implementing 2FA schemes, where the salt file
is for example a secret unsealed from the TPM or some other source.
While the unlocking part is quite straightforward to set up, enrolling
such a keyslot - not so easy. There is no clearly documented
way on how to set this up and online resources are scarce on this topic
too. By implementing a straightforward way to enroll such a keyslot
directly from systemd-cryptenroll we streamline the enrollment process
and reduce chances for user error when doing such things manually.
2024-06-20 14:26:24 +02:00
Antonio Alvarez Feijoo b3244d2b0a
conf-parser: print why config_parse_iec_uint64() fails
Print the same output as `config_parse_iec_size()` and
`config_parse_si_uint64()` if `parse_size()` fails, not only the `rvalue`.
2024-06-20 12:54:32 +02:00
Antonio Alvarez Feijoo 152f349385
conf-parser: set standard pointer alignment 2024-06-20 12:53:08 +02:00
Lennart Poettering ac6eb58f09
Merge pull request #33407 from poettering/varlink-idl-comment-fix
varlink: make comments on enum entries work
2024-06-20 12:13:59 +02:00
Lennart Poettering 8710bbfe96 bootctl: add comments to Varlink interface
This is mostly intended as test case for the early enum comment bugfix,
as this Varlink IDL description now contains such comments, and
test-varlink-idl will process it forth and back aleady.
2024-06-20 10:02:40 +02:00
Lennart Poettering 9e10f3a7e8 bootctl: normalize how we report no boot entries found
This normalizes how we report an empty list of boot entries in
ListBootEntries(). Our usual pattern is to return one item per method
call, but when there is none we usually return a NoSuchXYZ error. Do so
here too.

Before this we'd return a null item instead here, and only here.

This is a minor compat break, but given that this IPC interface is very
new and probably not used so far (we don't use it in our code at least,
and google doesn#t find any other use) I think this normalization is OK
at this point.
2024-06-20 10:02:40 +02:00
Lennart Poettering 5e542f8706 varlink: correctly format comments for enums too
I apparently never tested comments on enum values and hence they didn#t
work. Fix that.
2024-06-20 08:49:40 +02:00
Ludwig Nussel 8ce171bf51 bootctl: add --random-seed=yes/no 2024-06-20 14:26:13 +09:00
Yu Watanabe 8422d04e8d
Merge pull request #33420 from poettering/build-with-object
sd-json: add sd_json_build() flavour that implies we are building an object
2024-06-20 13:04:32 +09:00
Diego Viola 11b46dc117 man: fix typo in systemd-tmpfiles
Signed-off-by: Diego Viola <diego.viola@gmail.com>
2024-06-20 13:02:06 +09:00
Yu Watanabe 60e46382f4
Merge pull request #33419 from YHNdnzj/install-report-symlink
shared/install: several fixes for change reporting
2024-06-20 13:00:44 +09:00
Yu Watanabe 7fef19963d core/namespace: ensure private tmpfs is mounted earlier
And drop spurious assertion.

Fortunately, the previous logic worked, as /run/systemd/unit-private-tmp
is ordered earlier than /tmp or /var/tmp. But, let's ensure the tmpfs
mounted earlier to make the logic clearer.

Follow-up for 0e551b04ef.
2024-06-20 12:59:49 +09:00
Yu Watanabe 2bb69a2050
Merge pull request #33410 from poettering/sd-json-log-level-clean-up
sd-json: clean up SD_JSON_WARNING/SD_JSON_DEBUG definition and comments
2024-06-20 12:59:06 +09:00
Lennart Poettering 61e0b2bb65 update TODO 2024-06-19 22:50:02 +02:00
Lennart Poettering be5bee2a13 tree-wide: port over to new builder apis 2024-06-19 22:50:02 +02:00
Lennart Poettering 004c69a27f sd-json: add sd_json_build() wrapper macro that implies SD_JSON_BUILD_OBJECT()
In 99% of uses of sd_json_build() we want to build an object as
outermost construct. Let's shorten this most common case a bit, by
adding sd_json_buildo() that implies this. This allows us to shorten
much of our code, all across the tree.
2024-06-19 22:50:02 +02:00
Lennart Poettering 917b8bd377 update TODO 2024-06-19 22:42:51 +02:00
Lennart Poettering 357fa81375 sd-json: add comment clarifying that _SD_JSON_BUILD* enums are not to be used directly 2024-06-19 22:42:51 +02:00
Lennart Poettering 90cfb61c71 sd-json.h: reword SD_JSON_WARNING/SD_JSON_DEBUG comments
Even though we don't export json_log() in the public API, let's
officially make the SD_JSON_WARNING/SD_JSON_DEBUG that control its
effect in the public API.

After all, for our own dispatcher functions they have a nice effect, and
they are trivially reimplemented in user code independently.

(We might eventually consider exporting json_log() as public API, but
this is quite involved, given its use of macros/inline functions and
iternal logging API).

This mostly just swaps around the bit flags and cleans up comments.
2024-06-19 22:42:51 +02:00
Mike Yuan 9fb5a8ca24
test-install-root: introduce test case for #33411 2024-06-19 21:29:08 +02:00
Mike Yuan 4441cf330b
shared/install: correctly report changes in install_info_symlink_alias()
Follow-up for b2751cf039

Also make the conditions consistent for install_info_symlink_wants().

Fixes #33411
2024-06-19 21:28:55 +02:00
Mike Yuan a159aa07e1
shared/install: propagate all errors in install_info_apply()
Currently, install_info_apply() only updates r if it's 0,
meaning that if one of the earlier install_info_symlink_alias/wants()
calls returns > 0, errors generated by later calls will be discarded.
Fix that.
2024-06-19 21:28:40 +02:00
Mike Yuan dd6b325a05
shared/install: drop unneeded initialization 2024-06-19 21:19:13 +02:00
Yu Watanabe de732ade09
Merge pull request #33034 from yuwata/update-kernel-headers
basic/linux: update kernel headers from v6.10-rc3
2024-06-20 03:53:16 +09:00
Antonio Alvarez Feijoo 111f988992 kernel-install: correct the place where it works in man and help text 2024-06-20 03:01:22 +09:00
Maximilian Wilhelm 163bb43cea man/systemd.exec: list inaccessible files for ProtectKernelTunables 2024-06-20 03:00:59 +09:00
Xeonacid 5f7136a369 vmspawn: define QEMU_MACHINE_TYPE for riscv
Use ["virt"](https://www.qemu.org/docs/master/system/target-riscv.html#board-specific-documentation) as a commonly used generic platform on riscv.
2024-06-20 03:00:38 +09:00
Yu Watanabe 3176c78e68
Merge pull request #32868 from keszybz/more-whomification
Fix confusion between killer and prey
2024-06-20 02:59:14 +09:00
Yu Watanabe 834afa11ab core: drop unnecessary auto_fs4.h inclusion
auto_fs4.h is a trivial wrapper of auto_fs.h, and it is already included
by auto_dev-ioctl.h.
2024-06-20 02:35:35 +09:00
Yu Watanabe 0b37761936 missing: drop BCACHEFS_SUPER_MAGIC as it is now defined in linux/magic.h 2024-06-20 02:35:35 +09:00
Yu Watanabe 0cced2948f basic/linux: update kernel headers from v6.10-rc3
This also
- merges basic/linux and shared/linux,
- moves BPF_JUMP_A() to basic/missing_bpf.h,
- copies from usrspace kernel headers directory generated by 'make headers',
  rather than copying from kernel tree,
- copies const.h into our tree to reduce change in ethtool.h,
- copies auto_fs.h into our tree to reduce change in auto_dev-ioctl.h.
2024-06-20 02:35:35 +09:00
Lennart Poettering c7dd491d66 update TODO 2024-06-19 16:53:48 +02:00
Zbigniew Jędrzejewski-Szmek ff3f29537c various: move ptr indicator to return value 2024-06-19 16:37:12 +02:00
Zbigniew Jędrzejewski-Szmek bfd5a0687f various: move const ptr indicator to return value 2024-06-19 16:28:28 +02:00