]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 months agoMerge pull request #30811 from yuwata/network-route-metric
Luca Boccassi [Wed, 10 Jan 2024 19:25:52 +0000 (19:25 +0000)] 
Merge pull request #30811 from yuwata/network-route-metric

network/route-metric: introduce RouteMetric to unify route metric handling

4 months agoMerge pull request #30809 from yuwata/resolve-fix-EDE-handling
Luca Boccassi [Wed, 10 Jan 2024 19:21:55 +0000 (19:21 +0000)] 
Merge pull request #30809 from yuwata/resolve-fix-EDE-handling

resolve: fix EDE handling

4 months agowatchdog: ensure configured timeout is used instead of USEC_INFINITY
Holger Assmann [Tue, 9 Jan 2024 14:05:19 +0000 (15:05 +0100)] 
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.

4 months agorepart: fix memory leak
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 14:05:50 +0000 (15:05 +0100)] 
repart: fix memory leak

With the `--image` option, if `arg_node` is NULL, it's being assigned via
`strdup`.

4 months agopam-util: implement our own pam_prompt() replacement, that doesn't log loudly
Lennart Poettering [Tue, 28 Nov 2023 10:02:56 +0000 (11:02 +0100)] 
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).

4 months agologind-action: query HandleActionData.sleep_operation where appropriate
Mike Yuan [Wed, 10 Jan 2024 15:11:23 +0000 (23:11 +0800)] 
logind-action: query HandleActionData.sleep_operation where appropriate

4 months agoMerge pull request #30870 from aafeijoo-suse/firstboot-help-fix
Luca Boccassi [Wed, 10 Jan 2024 19:04:18 +0000 (19:04 +0000)] 
Merge pull request #30870 from aafeijoo-suse/firstboot-help-fix

firstboot: minor fixes

4 months agotest-resolved-dummy-server: several modernization 30809/head
Yu Watanabe [Tue, 9 Jan 2024 19:56:09 +0000 (04:56 +0900)] 
test-resolved-dummy-server: several modernization

- use sd-event,
- use DEFINE_MAIN_FUNCTION(),
- use log_setup().

4 months agotest: introduce a dummy DNS test server
Frantisek Sumsal [Mon, 8 Jan 2024 13:20:30 +0000 (14:20 +0100)] 
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.

4 months agoresolve: export sendmsg_loop()
Frantisek Sumsal [Mon, 8 Jan 2024 18:23:06 +0000 (19:23 +0100)] 
resolve: export sendmsg_loop()

So we can use it in tests.

4 months agoresolve: notify DNSSEC failure, EDE code, and EDE message
Yu Watanabe [Wed, 10 Jan 2024 03:37:36 +0000 (12:37 +0900)] 
resolve: notify DNSSEC failure, EDE code, and EDE message

4 months agoresolve: make manager_monitor_send() take DnsQuery*
Yu Watanabe [Wed, 10 Jan 2024 03:07:19 +0000 (12:07 +0900)] 
resolve: make manager_monitor_send() take DnsQuery*

4 months agoresolve: also read EDE code and message from cached packet
Yu Watanabe [Wed, 10 Jan 2024 04:01:31 +0000 (13:01 +0900)] 
resolve: also read EDE code and message from cached packet

4 months agoresolve: introduce DNSSEC_UPSTREAM_FAILURE
Yu Watanabe [Wed, 10 Jan 2024 02:34:44 +0000 (11:34 +0900)] 
resolve: introduce DNSSEC_UPSTREAM_FAILURE

and include EDE code and message in the error messages.

This replaces 9ca133e97a0c8795b1f293ccea4965b4ad1accc4, and implements
originally suggested at
https://github.com/systemd/systemd/pull/30513#discussion_r1433823737

4 months agoresolvectl: use JSON_ALLOW_EXTENSIONS
Yu Watanabe [Tue, 9 Jan 2024 20:05:29 +0000 (05:05 +0900)] 
resolvectl: use JSON_ALLOW_EXTENSIONS

Follow-up for f0e4244b2fda1b3de3da1c2792ed1cd21c72087b.

4 months agoresolve: several follow-ups for 9ca133e97a0c8795b1f293ccea4965b4ad1accc4.
Yu Watanabe [Sat, 6 Jan 2024 21:01:05 +0000 (06:01 +0900)] 
resolve: several follow-ups for 9ca133e97a0c8795b1f293ccea4965b4ad1accc4.

- 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 9ca133e97a0c8795b1f293ccea4965b4ad1accc4.

Fixes #30752.

4 months agopam_systemd_home: move two bool flags into a proper flags parameter
Lennart Poettering [Mon, 27 Nov 2023 20:22:31 +0000 (21:22 +0100)] 
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.

4 months agofirstboot: fix memory leak 30870/head
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 16:31:49 +0000 (17:31 +0100)] 
firstboot: fix memory leak

4 months agofirstboot: fix typo and add missing option to help text
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 16:29:56 +0000 (17:29 +0100)] 
firstboot: fix typo and add missing option to help text

4 months agoMerge pull request #30786 from yuwata/udev-net-link-property
Lennart Poettering [Wed, 10 Jan 2024 14:56:29 +0000 (15:56 +0100)] 
Merge pull request #30786 from yuwata/udev-net-link-property

udev/net: introduce [Link] Property= setting and friends

4 months agohwdb: add Teclast X98 Pro sensor info (#30859)
Damien Challet [Wed, 10 Jan 2024 14:12:56 +0000 (15:12 +0100)] 
hwdb: add Teclast X98 Pro sensor info (#30859)

added Teclast X98 Pro

4 months agokernel-install: clarify what is currently supported with --root and --image
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 10:56:36 +0000 (11:56 +0100)] 
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.

4 months agotest-network: add test case for MACAddress=none in .netdev and MACAddressPolicy=none...
Yu Watanabe [Wed, 10 Jan 2024 06:01:26 +0000 (15:01 +0900)] 
test-network: add test case for MACAddress=none in .netdev and MACAddressPolicy=none in .link

Prompted by #30813.

4 months agoMerge pull request #30860 from aafeijoo-suse/kernel-install-leak-fix
Lennart Poettering [Wed, 10 Jan 2024 09:47:32 +0000 (10:47 +0100)] 
Merge pull request #30860 from aafeijoo-suse/kernel-install-leak-fix

kernel-install/coredumpctl: fix memory leaks

4 months agotest: skip test_exec_networknamespacepath if netns setup fails
Nick Rosbrook [Tue, 9 Jan 2024 16:40:52 +0000 (11:40 -0500)] 
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.

4 months agoMerge pull request #30839 from yuwata/detect-virt-google
Lennart Poettering [Wed, 10 Jan 2024 08:55:44 +0000 (09:55 +0100)] 
Merge pull request #30839 from yuwata/detect-virt-google

detect-virt: add Google Compute Engine support

4 months agoMerge pull request #30849 from YHNdnzj/daemon-modernization
Lennart Poettering [Wed, 10 Jan 2024 08:55:12 +0000 (09:55 +0100)] 
Merge pull request #30849 from YHNdnzj/daemon-modernization

Modernize a couple of daemons that use bus_event_loop_with_idle

4 months agocreds-util: make read_credential_strings_many behave the same as comment
Mike Yuan [Tue, 9 Jan 2024 07:00:53 +0000 (15:00 +0800)] 
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.

4 months agoMerge pull request #30853 from YHNdnzj/mount-accept-fstab-node
Lennart Poettering [Wed, 10 Jan 2024 08:54:18 +0000 (09:54 +0100)] 
Merge pull request #30853 from YHNdnzj/mount-accept-fstab-node

core: allow fstab-style nodes in mount/swap What=

4 months agocoredumpctl: fix memory leak 30860/head
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 08:30:50 +0000 (09:30 +0100)] 
coredumpctl: fix memory leak

4 months agokernel-install: fix memory leak
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 08:20:15 +0000 (09:20 +0100)] 
kernel-install: fix memory leak

4 months agoresolve: drop DNS_TRANSACTION_UPSTREAM_DNSSEC_FAILURE
Yu Watanabe [Wed, 10 Jan 2024 01:10:06 +0000 (10:10 +0900)] 
resolve: drop DNS_TRANSACTION_UPSTREAM_DNSSEC_FAILURE

This partially reverts commit 9ca133e97a0c8795b1f293ccea4965b4ad1accc4.

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

Fixes #30776, #30779.

4 months agoresolve: several follow-ups for ac6844460ca1c01eaf2cb209ffa21c200d21a8f8
Yu Watanabe [Sat, 6 Jan 2024 18:57:11 +0000 (03:57 +0900)] 
resolve: several follow-ups for ac6844460ca1c01eaf2cb209ffa21c200d21a8f8

- 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 ac6844460ca1c01eaf2cb209ffa21c200d21a8f8.

4 months agoresolve: cleanup dns_packet_ede_rcode()
Yu Watanabe [Sat, 6 Jan 2024 18:28:19 +0000 (03:28 +0900)] 
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 ac6844460ca1c01eaf2cb209ffa21c200d21a8f8.

4 months agoresolve: update rcode table and align enum definitions
Yu Watanabe [Sat, 6 Jan 2024 17:58:15 +0000 (02:58 +0900)] 
resolve: update rcode table and align enum definitions

4 months agoTODO: drop implemented feature 30786/head
Yu Watanabe [Tue, 9 Jan 2024 18:52:02 +0000 (03:52 +0900)] 
TODO: drop implemented feature

4 months agotest: add test for [Link] Property= and friends
Yu Watanabe [Fri, 5 Jan 2024 13:41:06 +0000 (22:41 +0900)] 
test: add test for [Link] Property= and friends

4 months agoudev/net: introduce [Link] Property=, ImportProperty=, and UnsetProperty= settings
Yu Watanabe [Fri, 5 Jan 2024 11:08:26 +0000 (20:08 +0900)] 
udev/net: introduce [Link] Property=, ImportProperty=, and UnsetProperty= settings

The applied order is equivalent to Environment=, PassEnvironment=, and
UnsetEnvironment= for [Service] or so.

4 months agoudev: split out check that udev property can be updated
Yu Watanabe [Mon, 8 Jan 2024 17:54:43 +0000 (02:54 +0900)] 
udev: split out check that udev property can be updated

4 months agoudev/net: split out udev property assignment logic
Yu Watanabe [Fri, 5 Jan 2024 11:36:52 +0000 (20:36 +0900)] 
udev/net: split out udev property assignment logic

No functional change, just refactoring.

4 months agoudev/net: do not set unapplied .link file name to ID_NET_LINK_FILE
Yu Watanabe [Fri, 5 Jan 2024 11:36:33 +0000 (20:36 +0900)] 
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.

4 months agoudev-builtin-path_id: drop redundant debugging logs
Yu Watanabe [Tue, 9 Jan 2024 19:12:45 +0000 (04:12 +0900)] 
udev-builtin-path_id: drop redundant debugging logs

The function udev_builtin_add_property() internally logs the failure.

4 months agoudev/builtin: introduce udev_builtin_import_property() helper function
Yu Watanabe [Mon, 8 Jan 2024 16:12:20 +0000 (01:12 +0900)] 
udev/builtin: introduce udev_builtin_import_property() helper function

This is not used in this commit, but will be used later commits.

4 months agoman: fix indentation
Yu Watanabe [Fri, 5 Jan 2024 11:07:23 +0000 (20:07 +0900)] 
man: fix indentation

4 months agovirt: add Google Compute Engine support 30839/head
Yu Watanabe [Tue, 9 Jan 2024 01:52:49 +0000 (10:52 +0900)] 
virt: add Google Compute Engine support

See https://cloud.google.com/run/docs/container-contract#sandbox

4 months agocore: allow fstab-style nodes in mount/swap What= 30853/head
Mike Yuan [Tue, 9 Jan 2024 14:29:18 +0000 (22:29 +0800)] 
core: allow fstab-style nodes in mount/swap What=

Closes #28989

4 months agocore/load-fragment: use unit_path_printf where appropriate
Mike Yuan [Tue, 9 Jan 2024 16:05:49 +0000 (00:05 +0800)] 
core/load-fragment: use unit_path_printf where appropriate

4 months agoMerge pull request #30844 from keszybz/rename-uid-alloc-range
Lennart Poettering [Tue, 9 Jan 2024 17:51:35 +0000 (18:51 +0100)] 
Merge pull request #30844 from keszybz/rename-uid-alloc-range

Rename uid-alloc-range.[ch] files

4 months agonspawn: drop empty #if/#endif section
Lennart Poettering [Mon, 8 Jan 2024 22:48:01 +0000 (23:48 +0100)] 
nspawn: drop empty #if/#endif section

Follow-up for adb29d588ed8497d2c51f1d6d5e45a1e0d80a1dd

4 months agomkosi: Update to latest
Daan De Meyer [Tue, 9 Jan 2024 10:55:37 +0000 (11:55 +0100)] 
mkosi: Update to latest

The mkosi github action doesn't set up the host machine for building
full images anymore. Instead, only sufficient packages are installed
to be able to build tools trees so we configure a fedora tools tree
to build the actual images.

4 months agolocaled: modernization 30849/head
Mike Yuan [Tue, 9 Jan 2024 11:59:02 +0000 (19:59 +0800)] 
localed: modernization

4 months agohostnamed: use Type=notify
Mike Yuan [Tue, 9 Jan 2024 11:53:18 +0000 (19:53 +0800)] 
hostnamed: use Type=notify

4 months agoimportd: use Type=notify
Mike Yuan [Tue, 9 Jan 2024 11:51:54 +0000 (19:51 +0800)] 
importd: use Type=notify

4 months agotimedated: modernization
Mike Yuan [Tue, 9 Jan 2024 11:48:39 +0000 (19:48 +0800)] 
timedated: modernization

Switch to sd_event_set_signal_exit() and use Type=notify

4 months agomachined,portabled: remove unneeded NOTIFY_STOPPING
Mike Yuan [Tue, 9 Jan 2024 11:43:41 +0000 (19:43 +0800)] 
machined,portabled: remove unneeded NOTIFY_STOPPING

This is done internally by bus_event_loop_with_idle().

4 months agoMerge pull request #30843 from keszybz/test-relative-paths
Luca Boccassi [Tue, 9 Jan 2024 12:23:35 +0000 (12:23 +0000)] 
Merge pull request #30843 from keszybz/test-relative-paths

Use relative paths in test units

4 months agoMerge pull request #30833 from poettering/hostnamed-varlink
Lennart Poettering [Tue, 9 Jan 2024 11:38:58 +0000 (12:38 +0100)] 
Merge pull request #30833 from poettering/hostnamed-varlink

hostnamed: add simple varlink interface

4 months agoupdate TODO
Lennart Poettering [Tue, 9 Jan 2024 11:34:33 +0000 (12:34 +0100)] 
update TODO

4 months agoMerge pull request #30842 from aafeijoo-suse/analyze-q-man-help-fix
Luca Boccassi [Tue, 9 Jan 2024 10:40:19 +0000 (10:40 +0000)] 
Merge pull request #30842 from aafeijoo-suse/analyze-q-man-help-fix

analyze: minor fixes

4 months agoMerge pull request #30826 from YHNdnzj/networkd-wireguard-credential
Lennart Poettering [Tue, 9 Jan 2024 10:26:11 +0000 (11:26 +0100)] 
Merge pull request #30826 from YHNdnzj/networkd-wireguard-credential

networkd/wireguard: support network.wireguard.* credentials

4 months agoTEST-07: minor simplification 30843/head
Zbigniew Jędrzejewski-Szmek [Tue, 9 Jan 2024 09:59:31 +0000 (10:59 +0100)] 
TEST-07: minor simplification

4 months agosrc/basic: rename uid-alloc-range.[ch] to uid-classification.[ch] 30844/head
Zbigniew Jędrzejewski-Szmek [Tue, 9 Jan 2024 09:37:27 +0000 (10:37 +0100)] 
src/basic: rename uid-alloc-range.[ch] to uid-classification.[ch]

We had both uid-range.h and uid-alloc-range.h. The latter now contains helpers
like {uid,gid}_is_{system,dynamic,container}(), uid_for_system_journal(), so
the existing name is outdated. I think the uid-range.[ch] should stay separate
because it has a bunch of helpers for parsing and printing of uid ranges. So
let's rename as in $subject to better reflect the contents of the file and make
the two sets of files harder to confuse.

4 months agosrc/basic: "UidRange" → "UIDRange"
Zbigniew Jędrzejewski-Szmek [Tue, 9 Jan 2024 09:33:49 +0000 (10:33 +0100)] 
src/basic: "UidRange" → "UIDRange"

We don't "uncapitalize" parts of an already-capitalized name when concatenating
words. In particular, we had UidRange in basic/uid-range.h and UGIDAllocationRange
in basic/uid-alloc-range.h, which is annoying.

4 months agotests: use relative paths in ExecStart= and friends
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2024 14:24:52 +0000 (15:24 +0100)] 
tests: use relative paths in ExecStart= and friends

We want to retain *some* of the full paths in order to test more code paths.
But the default should be to use the command name only. This makes the tests
less visually cluttered.

4 months agohostnamed: always include VSockCID property in describe JSON 30833/head
Lennart Poettering [Mon, 8 Jan 2024 15:45:07 +0000 (16:45 +0100)] 
hostnamed: always include VSockCID property in describe JSON

that way clients can distinguish whether there is no cid or whether
hostnamed doesn't support it nicely, by just looking if the prop exists
(but is null) or not.

This is similar how we already handle all other props in the JSON
record.

4 months agohostnamed: add simple Varlink API, too
Lennart Poettering [Mon, 8 Jan 2024 14:13:07 +0000 (15:13 +0100)] 
hostnamed: add simple Varlink API, too

4 months agotestsuite-71: reset startlimit counter manually
Lennart Poettering [Mon, 8 Jan 2024 15:42:00 +0000 (16:42 +0100)] 
testsuite-71: reset startlimit counter manually

The test cases will call quite a lot of "systemctl stop
systemd-hostnamed", hence let's make sure we reset the start limit
counter each time, to not make this eventually fail.

(At other places we disabled the start limit counter, but here I opted
for resetting it manually via 'systemctl reset-failed', to test another
facet of the mechanism)

4 months agoid128-util: do not expose product UUID when running in a container
Lennart Poettering [Mon, 8 Jan 2024 15:14:44 +0000 (16:14 +0100)] 
id128-util: do not expose product UUID when running in a container

When we run in a container we should show our own system's info, not the
hosts hence suppress this info in that case.

This matches the behaviour of most other calls in hostnamed to expose
system properties.

4 months agohostnamed: move bus and event loop object into Context object
Lennart Poettering [Mon, 8 Jan 2024 12:57:41 +0000 (13:57 +0100)] 
hostnamed: move bus and event loop object into Context object

It's a bit weird to keep this separate in particular as the polkit
object is already part of the context.

4 months agohostnamed: port to sd_event_set_signal_exit()
Lennart Poettering [Mon, 8 Jan 2024 12:51:44 +0000 (13:51 +0100)] 
hostnamed: port to sd_event_set_signal_exit()

4 months agoanalyze: man and --help fixes 30842/head
Antonio Alvarez Feijoo [Tue, 9 Jan 2024 09:11:59 +0000 (10:11 +0100)] 
analyze: man and --help fixes

man:
- `verify` requires an argument
- `security` does not require an argument
- `fdstore` requires an argument
- `image-policy` requires an argument

`--help` text:
- missing `image-policy` command
- `cat-config` requires NAME or PATH

4 months agoanalyze: fix -q option
Antonio Alvarez Feijoo [Tue, 9 Jan 2024 08:05:50 +0000 (09:05 +0100)] 
analyze: fix -q option

Follow-up to 52117f5af831a816c47ceebb83c8244ee93b72fe

4 months agonetworkd/wireguard: support network.wireguard.* credentials 30826/head
Mike Yuan [Wed, 27 Dec 2023 13:38:32 +0000 (21:38 +0800)] 
networkd/wireguard: support network.wireguard.* credentials

Closes #26702

4 months agococci: merge mfree.cocci and mfree_return.cocci (#30838)
AtariDreams [Tue, 9 Jan 2024 03:24:37 +0000 (22:24 -0500)] 
cocci: merge mfree.cocci and mfree_return.cocci (#30838)

It makes sense that these should be one file instead of two, as they both involve mfree()

4 months agoman: drop unexpected dot
Yu Watanabe [Tue, 9 Jan 2024 01:52:18 +0000 (10:52 +0900)] 
man: drop unexpected dot

4 months agosimplify bitwise checking (#30722)
AtariDreams [Tue, 9 Jan 2024 01:18:10 +0000 (20:18 -0500)] 
simplify bitwise checking (#30722)

Some of these checks before bitwise operations are redundant and compilers
do not always recognize them, so let's simplify the code to make the intentions
clearer.

4 months agoMerge pull request #30837 from poettering/varlink-over-ssh
Yu Watanabe [Tue, 9 Jan 2024 01:14:03 +0000 (10:14 +0900)] 
Merge pull request #30837 from poettering/varlink-over-ssh

varlink: add "ssh:" transport for talking to remote servers

4 months agosocket-util: modernize socknameinfo_pretty() a bit
Lennart Poettering [Mon, 8 Jan 2024 14:47:55 +0000 (15:47 +0100)] 
socket-util: modernize socknameinfo_pretty() a bit

4 months agodiscover-image: don't accidentally set /run/systemd/nspawn/ access mode too strict
Lennart Poettering [Fri, 5 Jan 2024 21:20:32 +0000 (22:20 +0100)] 
discover-image: don't accidentally set /run/systemd/nspawn/ access mode too strict

mkdir_p() uses the specified access mode for all dirs that are missing,
hence if we call it on /run/systemd/nspawn/locking and
/run/systemd/nspawn/ doesn't exist yet, we#d create it 0700 here. But
that was never the intention, and all other code creating that dir sets
the mode to 0755. Fix this here to match the rest.

4 months agosd-bus: also intrepret $SYSTEMD_SSH env var 30837/head
Lennart Poettering [Mon, 8 Jan 2024 22:06:48 +0000 (23:06 +0100)] 
sd-bus: also intrepret $SYSTEMD_SSH env var

To make things symmetric to the $SYSTEMD_SSH logic that the varlink
transport supports, let's also honour such a variable in sd-bus when
picking ssh transport.

4 months agovarlink: add "ssh:" transport
Lennart Poettering [Mon, 8 Jan 2024 21:26:17 +0000 (22:26 +0100)] 
varlink: add "ssh:" transport

This uses openssh 9.4's -W support for AF_UNIX. Unfortunately older versions
don't work with this, and I couldn#t figure a way that would work for
older versions too, would not be racy and where we'd still could keep
track of the forked off ssh process.

Unfortunately, on older versions -W will just hang (because it tries to
resolve the AF_UNIX path as regular host name), which sucks, but hopefully this
issue will go away sooner or later on its own, as distributions update.

Fedora is still stuck at 9.3 at the time of posting this (even on
Fedora), even though 9.4, 9.5, 9.6 have all already been released by
now.

Example:
        varlinkctl call -j ssh:root@somehost:/run/systemd/io.systemd.Credentials io.systemd.Credentials.Encrypt '{"text":"foobar"}'

4 months agovarlink: turn off O_NONBLOCK in exec: transport
Lennart Poettering [Mon, 8 Jan 2024 17:49:12 +0000 (18:49 +0100)] 
varlink: turn off O_NONBLOCK in exec: transport

If we invoke our own varlink implementation we'll turn on O_NONBLOCK
right-away again, hence there is little point in turning it off,
however, I generally think we probably should always path this fd as
blocking, since that is the default after all, and invoked processes
might want to use it like that.

Or to see this differently: I think the varlink fd passed for activation
in many ways is similar to and as fundamental as stdin/stderr/stdout,
hence should probably be synchronous by default.

4 months agoprocess-util: turn off O_NONBLOCK on stdio fds when rearranging fds
Lennart Poettering [Mon, 8 Jan 2024 21:25:22 +0000 (22:25 +0100)] 
process-util: turn off O_NONBLOCK on stdio fds when rearranging fds

We often create our fds O_NONBLOCK, but when we want to invoke some
program with them as stdin/stdout/stderr we really should turn it off
again.

4 months agoenv-util: add new setenvf() helper
Lennart Poettering [Mon, 8 Jan 2024 17:48:53 +0000 (18:48 +0100)] 
env-util: add new setenvf() helper

And convert some pieces of code over.

4 months agohexdecoct: make unbase64mem and unhexmem always use SIZE_MAX
Mike Yuan [Mon, 8 Jan 2024 09:22:33 +0000 (17:22 +0800)] 
hexdecoct: make unbase64mem and unhexmem always use SIZE_MAX

4 months agotmpfiles: fix memory leak in arg_exclude_prefixes
Antonio Alvarez Feijoo [Mon, 8 Jan 2024 15:08:26 +0000 (16:08 +0100)] 
tmpfiles: fix memory leak in arg_exclude_prefixes

When using the `--image` or `-E` options, `arg_exclude_prefixes` is extended via
the `exclude_default_prefixes` function, which calls `strv_extend_strv`, adding
values using `strdup` that must be freed on exit.

Also changing `arg_include_prefixes` to use the same model, although there is no
leak here.

4 months agobus-polkit: fix memory leak
Lennart Poettering [Mon, 8 Jan 2024 14:54:42 +0000 (15:54 +0100)] 
bus-polkit: fix memory leak

We need to destroy the hashmap entry keyed by the varlink object in case
this is a varlink request.

Follow-up for: d04c1a1c8e7c95daa483d8d52d5fc4c25fbc67f2

4 months agotimesync: IPTOS_LOWDELAY --> IPTOS_DSCP_EF
Cristian Rodríguez [Sun, 7 Jan 2024 22:49:45 +0000 (19:49 -0300)] 
timesync: IPTOS_LOWDELAY --> IPTOS_DSCP_EF

Deprecated IPTOS_LOWDELAY is ignored by most of today's
network equipment that only ever care about DSCP.

Use the DSCP found in other NTP implementations and set the appropiate
TCLASS for IPv6.

4 months agovirt: fix detection of avx2 and friends
Yu Watanabe [Mon, 8 Jan 2024 10:59:32 +0000 (19:59 +0900)] 
virt: fix detection of avx2 and friends

To get the CPUID with EAX=7, we need explicitly set 0 to ECX.

From Intel® Architecture Instruction Set Extensions Programming
Reference and Related Specifications,
===
Leaf 07H output depends on the initial value in ECX.
If ECX contains an invalid sub leaf index, EAX/EBX/ECX/EDX return 0
===

Fixes #30822.

4 months agoMerge pull request #30827 from poettering/network-generator-creds
Lennart Poettering [Mon, 8 Jan 2024 14:02:02 +0000 (15:02 +0100)] 
Merge pull request #30827 from poettering/network-generator-creds

network-generator: pick up .netdev/.link/.network configuration via c…

4 months agoMerge pull request #30787 from poettering/hostnamed-cid
Lennart Poettering [Mon, 8 Jan 2024 13:36:57 +0000 (14:36 +0100)] 
Merge pull request #30787 from poettering/hostnamed-cid

hostnamed: expose AF_VSOCK CID among hostnamed/hostnamectl info

4 months agonetwork-generator: pick up .netdev/.link/.network configuration via credentials 30827/head
Lennart Poettering [Mon, 8 Jan 2024 10:25:56 +0000 (11:25 +0100)] 
network-generator: pick up .netdev/.link/.network configuration via credentials

To me this is the last major basic functionality that couldn't be
configured via credentials: the network.

We do not invent any new format for this, but simply copy relevant creds
1:1 into /run/systemd/network/ to open up the full functionality of
networkd to VM hosts.

4 months agohostnamed: expose local AF_VSOCK CID among other host info 30787/head
Lennart Poettering [Fri, 5 Jan 2024 15:34:33 +0000 (16:34 +0100)] 
hostnamed: expose local AF_VSOCK CID among other host info

This is a host identifier of major relevance, since it is how you
connect to this system if it is a VM, hence expose this nicely.

4 months agosocket-util: add helper for querying the local AF_VSOCK CID
Lennart Poettering [Fri, 5 Jan 2024 15:33:58 +0000 (16:33 +0100)] 
socket-util: add helper for querying the local AF_VSOCK CID

4 months agoMerge pull request #30815 from yuwata/resolve-ixfr
Yu Watanabe [Sun, 7 Jan 2024 23:49:15 +0000 (08:49 +0900)] 
Merge pull request #30815 from yuwata/resolve-ixfr

resolve: NSCOUNT of DNS query may not be zero

4 months agotest: check how systemd-resolved deals with zone transfers 30815/head
Frantisek Sumsal [Sun, 7 Jan 2024 21:22:52 +0000 (22:22 +0100)] 
test: check how systemd-resolved deals with zone transfers

Even though systemd-resolved doesn't support zone transfers (AXFR/IXFR),
it should still just refuse such requests without choking on them.

See: https://github.com/systemd/systemd/pull/30809#issuecomment-1880102804

4 months agotest: merge config sections
Frantisek Sumsal [Sun, 7 Jan 2024 12:32:14 +0000 (13:32 +0100)] 
test: merge config sections

4 months agotest: zone-check with --force to fail on warnings
Frantisek Sumsal [Sun, 7 Jan 2024 12:29:50 +0000 (13:29 +0100)] 
test: zone-check with --force to fail on warnings

4 months agoresolve: NSCOUNT of DNS query may not be zero
Yu Watanabe [Sun, 7 Jan 2024 17:02:33 +0000 (02:02 +0900)] 
resolve: NSCOUNT of DNS query may not be zero

This also separates check for DNS and LLMNR, as the existing comments
are for LLMNR, not DNS. And this moves the comment for mDNS.

Fixes the issue reported at
https://github.com/systemd/systemd/pull/30809#issuecomment-1880102804.

4 months agonetwork/route-metric: invalidate [Route] section if an invalid string is specified 30811/head
Yu Watanabe [Sun, 7 Jan 2024 02:53:27 +0000 (11:53 +0900)] 
network/route-metric: invalidate [Route] section if an invalid string is specified

Follow-up for 18c4c5d84f756b144a1823f3de8bc0e61264b976.