1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
Commit Graph

70154 Commits

Author SHA1 Message Date
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
Yu Watanabe
c08fd7beca resolve: several follow-ups for ac6844460c
- fix indentation,
- drop incorrect comment, dns_packet_ede_rcode() can handle unknown EDE rcode.
- 0 is a valid EDE rcode,
- DnsTransaction.answer_ede_msg may be NULL, so needs to use strempty()
  on logging,
- drop redundant ede_rcode temporary variable.

Follow-up for ac6844460c.
2024-01-10 13:13:11 +09:00
Yu Watanabe
71682ac6bb resolve: cleanup dns_packet_ede_rcode()
This makes the following:
- make dns_packet_ede_rcode() return -EINVAL when EDE code not found.
  Otherwise, the caller may be confused that the packet has an unknown
  error code.
- make the function escape EDE message only when non-utf8 message is received.
- the message handling logic is applied even if the error code is unknown, as
  there is no reason that we escape EDE message only when an known error code
  is received.
- reduce scope of variables,
- drop redundant 'else',
- append full stop to the log messages,
- drop redundant log message in the caller,
- split out error in the function and returned EDE error code.

Follow-up for ac6844460c.
2024-01-10 13:06:02 +09:00
Yu Watanabe
a92ea352a5 resolve: update rcode table and align enum definitions 2024-01-10 10:23:14 +09:00
Yu Watanabe
eabc38daa8 TODO: drop implemented feature 2024-01-10 04:33:55 +09:00
Yu Watanabe
d26319be92 test: add test for [Link] Property= and friends 2024-01-10 04:33:55 +09:00
Yu Watanabe
046286e863 udev/net: introduce [Link] Property=, ImportProperty=, and UnsetProperty= settings
The applied order is equivalent to Environment=, PassEnvironment=, and
UnsetEnvironment= for [Service] or so.
2024-01-10 04:33:51 +09:00
Yu Watanabe
513ca8b6f0 udev: split out check that udev property can be updated 2024-01-10 04:27:41 +09:00
Yu Watanabe
3e00171dcd udev/net: split out udev property assignment logic
No functional change, just refactoring.
2024-01-10 04:27:41 +09:00
Yu Watanabe
0c3af33e19 udev/net: do not set unapplied .link file name to ID_NET_LINK_FILE
Instead, import already assigned value from the udev database.
Then, return the builtin earlier.
2024-01-10 04:27:41 +09:00
Yu Watanabe
ac36406277 udev-builtin-path_id: drop redundant debugging logs
The function udev_builtin_add_property() internally logs the failure.
2024-01-10 04:27:26 +09:00
Yu Watanabe
50a0379d5d udev/builtin: introduce udev_builtin_import_property() helper function
This is not used in this commit, but will be used later commits.
2024-01-10 04:11:08 +09:00
Yu Watanabe
12b1e04073 man: fix indentation 2024-01-10 03:50:32 +09:00