Commit graph

70166 commits

Author SHA1 Message Date
Yu Watanabe bc02f03561 network: fix Name= -> OriginalName= in the default .link files
Follow-up for 658169e6d3.
2024-01-11 12:20:10 +00:00
Lennart Poettering 658dc909dc man: fix references to systemd.exec(5)
For some reason the section for the systemd.exec man page was added
incorrectly and then copypasted everywhere else incorrectly too. Let's
fix that.
2024-01-11 12:19:44 +00:00
Antonio Alvarez Feijoo 5e16328506 analyze: clarify that security --offline=true requires an argument
Without `--root` or `--image`, the `security` command inspects all currently
loaded service units if no unit name is specified. But with `--root` or
`--image` with `--offline=true`, the `security` command exits silently if no
unit name is specified.

Also, fixed description of `--root` and `--image` in the man page, and added
missing `--unit` option to help text.
2024-01-11 12:19:20 +00:00
Frantisek Sumsal ec6c7bac5c test: fix dbus installation on Arch
Arch finally made dbus-broker the default dbus daemon [0], but unlike
Fedora they don't use Alias=dbus.service to make the dbus.symlink under
/etc, instead they create the symlink manually under /usr/lib, so let's
account for that.

[0] b24d15795a
2024-01-11 12:01:42 +00:00
Antonio Alvarez Feijoo 1c585a4ccd Revert "initrd-parse-etc: override argv[0] to avoid dracut issue"
This reverts commit db5276215a.

dracut is patched since https://github.com/dracutdevs/dracut/commit/23684e4a,
and this commit is included in the latest dracut-059 release.
2024-01-11 10:41:30 +00:00
Lennart Poettering e992753e58
Merge pull request #30879 from yuwata/dhcp-client-id-json
dhcp: introduce json_dispatch_client_id() and friends
2024-01-11 10:22:31 +01:00
Yu Watanabe 0705e05c3d sd-dhcp-client-id: introduce json_dispatch_client_id() 2024-01-11 17:03:25 +09:00
Yu Watanabe 72278e62d9 json: introduce json_dispatch_byte_array_iovec() and json_dispatch_in_addr() 2024-01-11 17:03:25 +09:00
Yu Watanabe cf9b425749 sd-dhcp-client-id/duid: do not trigger assertion when invalid size is passed
The data may be from user input or file. We usually use assertion for
programming error. Hence, using assert is not a good choise there.

Preparation for later commits.
2024-01-11 17:03:25 +09:00
Diego Viola 25cbc42d93 test-systemctl-enable: make titles more consistent 2024-01-11 14:13:40 +09:00
Rose ed0cf4171f boot/efi: use Header field of hd directly instead of casting to EFI_DEVICE_PATH
The header of EFI_DEVICE_PATH is the first member of hd, which means that we can use that directly instead of casting one struct to another.
2024-01-11 14:03:13 +09:00
Rose aa9ff6c28d tree-wide: replace string functions with fundamental functions 2024-01-11 13:36:25 +09:00
Lennart Poettering 658169e6d3 network: take explicit ownership of our own interfaces
This is a follow-up for #30786 and uses it to assign
ID_NET_MANAGED_BY=io.systemd.Network to all all network interfaces that
we consider ours to manage. This should hopefully have the effect that
other well-behaving managers won't fight for these devices.

This doesn't bother with network interfaces we match inside containers,
since udev is not available there anyway.
2024-01-10 19:56:43 +00:00
Luca Boccassi d6b39152a9
Merge pull request #30717 from yuwata/network-ref-unref
network: introduce address_ref() and friends
2024-01-10 19:34:48 +00:00
Luca Boccassi 3df2b718b2
Merge pull request #30716 from yuwata/network-cancel-request
network: also remove configuration on cancelling request
2024-01-10 19:33:16 +00:00
Carlos Garnacho 501d8b8bc6 logind: Mark LidClosed property as "emits change"
It may be useful for DEs to follow changes on this property, esp. now that
recent UPower has removed its own lid handling code.

Related: 07565ef6a1
2024-01-10 19:31:06 +00:00
Luca Boccassi 09263532b6
Merge pull request #30720 from yuwata/dhcp-server-address-verification
dhcp-server: several fixlets for address verification
2024-01-10 19:29:25 +00:00
Luca Boccassi 311f80cee2
Merge pull request #30764 from yuwata/network-queue-fix-assertion
network/queue: exit from loop of processing request when a new request is queued
2024-01-10 19:27:57 +00:00
Luca Boccassi 31056154dd
Merge pull request #30811 from yuwata/network-route-metric
network/route-metric: introduce RouteMetric to unify route metric handling
2024-01-10 19:25:52 +00:00
Luca Boccassi dadd7d46d9
Merge pull request #30809 from yuwata/resolve-fix-EDE-handling
resolve: fix EDE handling
2024-01-10 19:21:55 +00:00
Holger Assmann f681046ede watchdog: ensure configured timeout is used instead of USEC_INFINITY
In some rare cases, a watchdog driver might neither be able to change
the watchdog timeout value, nor read it from the hardware at runtime.

With an otherwise functional watchdog setup, this constellation worked
until systemd v249. Since then, systemd ends up ignoring the timeout
defined by the system.conf and rather uses USEC_INFINITY. Consequently,
the watchdog is not pinged anymore and eventually resets the system.

We therefore want to ensure that the system keeps running with the
originally configured timeout.
2024-01-10 19:14:38 +00:00
Antonio Alvarez Feijoo ecb4c5a63e repart: fix memory leak
With the `--image` option, if `arg_node` is NULL, it's being assigned via
`strdup`.
2024-01-10 19:07:21 +00:00
Lennart Poettering 52e5b950dc pam-util: implement our own pam_prompt() replacement, that doesn't log loudly
pam_prompt() will log very noisely at high error levels if it is called
without a conversation function that works. This is however a frequent
case, given that ssh doesn't provide one. To tone down the misleading
logging a bit, implement our own pam_prompt_graceful() that is just like
pam_prompt(), but reports errors back the caller who then logs (which we
generally do anyway).
2024-01-10 19:06:40 +00:00
Mike Yuan 54cc0367cb logind-action: query HandleActionData.sleep_operation where appropriate 2024-01-10 19:04:38 +00:00
Luca Boccassi d5f270fdbb
Merge pull request #30870 from aafeijoo-suse/firstboot-help-fix
firstboot: minor fixes
2024-01-10 19:04:18 +00:00
Yu Watanabe 28815fdac4 test-resolved-dummy-server: several modernization
- use sd-event,
- use DEFINE_MAIN_FUNCTION(),
- use log_setup().
2024-01-11 02:13:32 +09:00
Frantisek Sumsal f1caa5d6e7 test: introduce a dummy DNS test server
Introduce a _very_ simple DNS server using our internal DNS-related
code, that responds to queries with specifically crafted packets, to
cover scenarios that are difficult to reproduce with well-behaving DNS
servers.

Also, hide the test DNS server behind Knot using the dnsproxy module, so
we don't have to switch DNS servers during tests.
2024-01-11 02:13:29 +09:00
Frantisek Sumsal ed6c51781f resolve: export sendmsg_loop()
So we can use it in tests.
2024-01-11 02:10:32 +09:00
Yu Watanabe a068e06da6 resolve: notify DNSSEC failure, EDE code, and EDE message 2024-01-11 02:10:32 +09:00
Yu Watanabe d9f9b8ce8a resolve: make manager_monitor_send() take DnsQuery* 2024-01-11 02:10:32 +09:00
Yu Watanabe 37baa00fe0 resolve: also read EDE code and message from cached packet 2024-01-11 02:10:32 +09:00
Yu Watanabe a72cf22d06 resolve: introduce DNSSEC_UPSTREAM_FAILURE
and include EDE code and message in the error messages.

This replaces 9ca133e97a, and implements
originally suggested at
https://github.com/systemd/systemd/pull/30513#discussion_r1433823737
2024-01-11 02:10:32 +09:00
Yu Watanabe 0c61995d80 resolvectl: use JSON_ALLOW_EXTENSIONS
Follow-up for f0e4244b2f.
2024-01-11 02:10:32 +09:00
Yu Watanabe 41398e8793 resolve: several follow-ups for 9ca133e97a.
- add missing initialization for DnsQuery.answer_ede_rcode,

- clear EDE code and message in dns_transaction_reset_answer(),
  otherwise the previous EDE code or message may be mistakenly reused
  on restart. This fixes memory leak of DnsTransaction.answer_ede_msg.

- also clear EDE code and message in dns_query_reset_answer(),
  otherwise ede message is leaked if dns_query_accept() is called
  multiple times for the same DnsQuery.

Follow-up for 9ca133e97a.

Fixes #30752.
2024-01-11 02:10:11 +09:00
Lennart Poettering 563c5511ad pam_systemd_home: move two bool flags into a proper flags parameter
We are going to add more shortly, but this makes sense on its own.

No changes in behaviour.
2024-01-10 17:53:57 +01:00
Antonio Alvarez Feijoo 4f464e7419
firstboot: fix memory leak 2024-01-10 17:31:49 +01:00
Antonio Alvarez Feijoo 981644edc9
firstboot: fix typo and add missing option to help text 2024-01-10 17:29:56 +01:00
Lennart Poettering 9a70dc02c6
Merge pull request #30786 from yuwata/udev-net-link-property
udev/net: introduce [Link] Property= setting and friends
2024-01-10 15:56:29 +01:00
Damien Challet 3a0fbeacea
hwdb: add Teclast X98 Pro sensor info (#30859)
added Teclast X98 Pro
2024-01-10 15:12:56 +01:00
Antonio Alvarez Feijoo 398760c84a kernel-install: clarify what is currently supported with --root and --image
`list` and `add-all` ignore `--root` or `--image`, working on the running
system instead.
Also improve the error message if `--image` is used.
2024-01-10 12:40:35 +00:00
Yu Watanabe 9540f8e216 test-network: add test case for MACAddress=none in .netdev and MACAddressPolicy=none in .link
Prompted by #30813.
2024-01-10 12:07:23 +01:00
Lennart Poettering 8d27d78784
Merge pull request #30860 from aafeijoo-suse/kernel-install-leak-fix
kernel-install/coredumpctl: fix memory leaks
2024-01-10 10:47:32 +01:00
Nick Rosbrook 76808638b6 test: skip test_exec_networknamespacepath if netns setup fails
In some environments, such as a LXD container, the netns setup might
fail because ip netns exec fails trying to mount /sys:

 $ systemd-detect-virt
 lxc
 $ ip link add dummy-test-exec type dummy
 $ ip netns add test-execute-netns
 $ ip netns exec test-execute-netns ip link add dummy-test-ns type dummy
 mount of /sys failed: Operation not permitted

If this setup fails, test_exec_networknamespacepath will fail, so check
the exit codes for these setup calls and skip the test if necessary.
2024-01-10 08:59:22 +00:00
Lennart Poettering a795ec8100
Merge pull request #30839 from yuwata/detect-virt-google
detect-virt: add Google Compute Engine support
2024-01-10 09:55:44 +01:00
Lennart Poettering f5812f337d
Merge pull request #30849 from YHNdnzj/daemon-modernization
Modernize a couple of daemons that use bus_event_loop_with_idle
2024-01-10 09:55:12 +01:00
Mike Yuan 95bcaa4e81 creds-util: make read_credential_strings_many behave the same as comment
The comment states "If the specified buffers are already non-NULL
frees them if a credential is found".

Also return 1 if all credentials are found.
2024-01-10 09:54:39 +01:00
Lennart Poettering ff85480458
Merge pull request #30853 from YHNdnzj/mount-accept-fstab-node
core: allow fstab-style nodes in mount/swap What=
2024-01-10 09:54:18 +01:00
Antonio Alvarez Feijoo 57ab094d73
coredumpctl: fix memory leak 2024-01-10 09:30:50 +01:00
Antonio Alvarez Feijoo d1b1cf8f26
kernel-install: fix memory leak 2024-01-10 09:20:15 +01:00
Yu Watanabe 9ae51762d7 resolve: drop DNS_TRANSACTION_UPSTREAM_DNSSEC_FAILURE
This partially reverts commit 9ca133e97a.

Not only there is no reason to introduce a new transaction failure state,
but also the commit introduces several severe issues.

Fixes #30776, #30779.
2024-01-10 13:14:14 +09:00