Commit Graph
52580 Commits
Author SHA1 Message Date
Daan De Meyer 64c4961e80 sd-json: replace ASSERT_PTR() with assert_return() (#35849) 2025-01-04 11:06:36 +01:00
Yu Watanabe c10fbe2cf8 libsystemd: drop duplicated symbol
Follow-up for 107986a33e.
2025-01-04 09:28:14 +01:00
Yu Watanabe 37a393b99e sd-json,sd-varlink: trivial coding style fixlets 2025-01-04 13:20:50 +09:00
Yu Watanabe c882735596 sd-json: replace ASSERT_PTR() with assert_return() in public functions 2025-01-04 13:10:38 +09:00
Yu Watanabe aac9d150ed tpm2: tweaks to PCR mask parsing (#35835) 2025-01-04 12:42:54 +09:00
Lennart Poettering b1fb2d971c nspawn: move uid shift/chown() code into shared/ 2025-01-04 12:23:31 +09:00
Yu Watanabe e10a748400 libsystemd: drop duplicated symbol
Follow-up for 107986a33e.
2025-01-04 12:01:24 +09:00
Daan De Meyer 276890d629 ptyfwd: Add --read-only option 2025-01-03 21:14:47 +01:00
Lennart Poettering 57e55f93bb terminal-util: modernize vtnr_from_tty() a bit 2025-01-03 21:05:58 +01:00
Daan De Meyer d0d647e084 Introduce systemd-pty-forward (#35761)
This allows running a command with tinted terminal background.
2025-01-03 19:34:42 +01:00
Daan De Meyer 8224a48da9 Introduce systemd-pty-forward
This allows running a command with tinted terminal background.
2025-01-03 17:07:33 +01:00
Daan De Meyer 37ce3fd2b7 core: do not disconnect from bus when failed to install signal match (#35779)
If bus_add_match_full() is called without install callback and we failed
to install the signal match e.g. by timeout, then add_match_callback()
will disconnect from the bus. Let's use a custom install handler and
handle failures gracefully.

This does not *solve* the root cause of issue
https://github.com/systemd/systemd/issues/30573, but should improve the
situation when the issue is triggered.
2025-01-03 16:45:50 +01:00
Lennart Poettering 9f97f2899a dissect-image: rename ReplyParameters → MountImageReplyParameters 2025-01-03 16:44:08 +01:00
Lennart Poettering bacc04bedc dissect: minor simplifications 2025-01-03 16:43:43 +01:00
Lennart Poettering 3866e9ce9d sd-json: add json_dispatch_const_path() helper
The new json_dispatch_const_path() is to json_dispatch_path() what
sd_json_dispatch_const_string() is to sd_json_dispatch_ string(), i.e.
doesn't implicitly strdup() the string, but gives you the pointer into
the JSON structure, and thus requires you to keep it pinned.
2025-01-03 16:38:56 +01:00
Daan De Meyer b0d0b08c62 dissect: minor additions to the systemd-dissect tool (#35829) 2025-01-03 16:05:30 +01:00
Daan De Meyer b6507d81ce nspawn: trivial tweaklets (#35831) 2025-01-03 15:54:43 +01:00
Daan De Meyer 568988bec4 vmspawn: Switch to virtconsole for headless console (#35836)
virtconsole is the modern way to set up a headless serial connection
to a virtual machine so let's make use of it instead of -serial. This
also allows us to get rid of the per architecture serial console device
names and makes vmspawn more consistent with mkosi qemu which already
uses
virtconsole.
2025-01-03 13:54:09 +01:00
Daan De Meyer b0e9ac018d machine: introduce io.systemd.Machine.BindMount method (#35066)
This PR introduces io.systemd.Machine.BindMount method which is
alternative to DBus's BindMountMachine.
2025-01-03 13:19:48 +01:00
Lennart Poettering 8beb8c3e35 fs-util: teach xopenat_full() to pick automatically if given as MODE_INVALID 2025-01-03 12:58:43 +01:00
Lennart Poettering 4b9203ac65 nspawn: rework userns_mkdir() around chase() 2025-01-03 12:56:52 +01:00
Lennart Poettering f8bbf4061b udev: split udev_manager_init() and udev_manager_main() into small pieces (#35735) 2025-01-03 12:27:14 +01:00
Noel Georgi 0ad1fd7a80 fix: sd-measure dtbauto and hwdids arg parsing
Commit 630cf4e7da introduced `.dtbauto`,
but since it's before `.hwdids` commit 4c0b7f4250
made `dtbauto` the last argument whereas it should have been `hwdids`.

Otherwise the code was measuring the content of hwdids into dtbauto
section and vice-versa.

Found this while adding the new `dtbauto` and `.hwdids` fields in the go
implementation of `sd-measure` at
https://github.com/siderolabs/talos/blob/main/internal/pkg/secureboot/measure/measure.go.

Signed-off-by: Noel Georgi <git@frezbo.dev>
2025-01-03 12:23:24 +01:00
Daan De Meyer 470c213bd9 vmspawn: Switch to virtconsole for headless console
virtconsole is the modern way to set up a headless serial connection
to a virtual machine so let's make use of it instead of -serial. This
also allows us to get rid of the per architecture serial console device
names and makes vmspawn more consistent with mkosi qemu which already uses
virtconsole.
2025-01-03 11:16:16 +01:00
Daan De Meyer 33c1736082 vmspawn: Use vmspawn in drive ID name instead of mkosi 2025-01-03 11:14:09 +01:00
Lennart Poettering 3085782020 tpm2-util: refuse hash algorithm/value specification when we only parse a mask
tpm2_parse_pcr_argument_to_mask() is supposed to parse a PCR mask
string, and uses the full blown tpm2_parse_pcr_argument() call at its
core, which parses more than just a mask, i.e. values and algorithms
too. Which is very confusing at times, because commands such as
"systemd-cryptenroll --tpm2-device=auto
--tpm2-public-key-pcrs=1:sha1=09dbdbc7f6cdd8029cc90b57a915c19a0ac21bce"
are very confusing, since they suggest enrollment with a specific
algorithm and has value, but this is not in fact what happens: both are
entirely ignored.

That this was accepted this way was more an accident than intended,
which is already visible in the fact that extensive test case entirely
ignores the fact that strings like this are accepted.
2025-01-03 10:44:26 +01:00
Lennart Poettering 982e791f1c tpm2-util: optionally do wildcard hash check in tpm2_pcr_values_to_mask()
If TPM2_ALG_ERROR (aka "0") is specified as algorithm in
tpm2_pcr_values_to_mask() we'll simply match all algorithms. This allows
us to shorten tpm2_parse_pcr_argument_to_mask() a bit. The function
accepts but ignores a hash algorithm specification currently, hence this
should not really much effect.
2025-01-03 10:39:10 +01:00
Lennart Poettering 0db32a3bfb tpm2-util: drop ret_x prefix from two arguments that are not just return but also input params 2025-01-03 10:39:10 +01:00
Lennart Poettering 2623052e14 nspawn: improve log messages a bit 2025-01-03 10:21:34 +01:00
Lennart Poettering ef99711d0f nspawn: drop some redundant {} 2025-01-03 10:21:27 +01:00
Lennart Poettering bd2fd85501 dissect: employ vpick also if we operate on a directory-based image 2025-01-03 10:14:20 +01:00
Lennart Poettering 8ef117ff4b dissect: add a bit of color to --discover table 2025-01-03 10:13:13 +01:00
Lennart Poettering 41c2a5b0b9 dissect: show all kinds of images in --discover
Given that systemd-dissect can nowadays operate on plain directories,
let's include directory images in the --discover output too.

Replace the filter with a filter for hidden images instead, as suddenly
the root fs image (which is a directory image ".host") otherwise shows up.
2025-01-03 10:12:23 +01:00
Lennart Poettering 36d2096b84 debug-generator: rework from post-merge review #35410 (#35696)
- https://github.com/systemd/systemd/pull/35410#discussion_r1893664993
- https://github.com/systemd/systemd/pull/35410#discussion_r1893667581
2025-01-03 09:34:50 +01:00
Daan De Meyer 9fbecf12fb tree-wide: Rename ret_slave to ret_peer 2025-01-03 09:28:13 +01:00
Daan De Meyer de8466e436 random-util: our baseline includes getrandom() (v3.17) now (#35816) 2025-01-03 09:23:06 +01:00
Luca Boccassi 2976730a4d resolved: stop mdns/lnrr when config changes to disabled on reload
Currently on reload mdns/lnrr are enabled if they were disabled,
but not viceversa. Fix it.

Follow-up for 14a5217679
2025-01-03 09:22:45 +01:00
Daan De Meyer 96cf4d3243 terminal-util: introduce terminal_{new,detach}_session helpers (#35811) 2025-01-03 09:21:19 +01:00
Daan De Meyer 628a3fc287 network/dhcp: introduce global setting for DHCPv4 client identifier (#35783)
Typically, the same client identifier setting is used for all
interfaces. Hence, better to provide the system-wide setting to specify
the client identifier.
2025-01-03 09:19:55 +01:00
Antonio Alvarez Feijoo aeb97a49c3 debug-generator: use helper to check breakpoint validity 2025-01-03 08:32:27 +01:00
Mike Yuan 1de1282320 terminal-util: introduce terminal_{new,detach}_session helpers
Prompted by #35761
2025-01-02 21:14:38 +01:00
Mike Yuan 217bd588c2 terminal-util: regroup some functions 2025-01-02 20:42:20 +01:00
Mike Yuan c439bd25ca random-util: our baseline includes getrandom() (v3.17) now
Plus, linux/random.h never defined getrandom(), hence remove
the custom machinery for sys/random.h vs linux/random.h
in favor of single HAVE_GETRANDOM.
2025-01-02 20:40:45 +01:00
Mike Yuan 2627cd1343 random-util: drop needless conditionalization of sys/auxv.h
We assume its existence in basic/build-path.c, shared/userdb.c,
and coredump/coredump.c already, for which nothing has been reported
so far. So this seems safe to drop.
2025-01-02 20:34:21 +01:00
Mike Yuan aad028e187 missing_syscall: mandate __NR_memfd_create
Follow-up for 6db5a6e799

For basic system functionality we require memfd nowadays,
so fail the build if syscall number not available.
2025-01-02 20:34:20 +01:00
Mike Yuan dfe3fe77f7 shared/hibernate-util: handle the case where no swap has available backing dev (#35802)
Fixes https://github.com/systemd/systemd/issues/35798
Replaces https://github.com/systemd/systemd/pull/35801
2025-01-02 19:26:58 +01:00
Lennart Poettering 5ff7046e61 ask-password: add varlink IPC interface and various other additions and fixes (#35074) 2025-01-02 18:21:35 +01:00
Lennart Poettering ed8e7e2393 core/socket: several fixlets (#35637)
Fixes https://github.com/systemd/systemd/issues/35635
2025-01-02 18:20:48 +01:00
Ivan Kruglov d12b63f168 machine: introduce io.systemd.Machine.BindMount method 2025-01-02 16:58:16 +01:00
Lennart Poettering 7fd0ea6cf6 ask-password: add comment with well-known errors from ask_password_auto() 2025-01-02 16:39:30 +01:00