Commit Graph
79729 Commits
Author SHA1 Message Date
Yu Watanabe 914d1ec171 tmpfiles: fix output value assignment
Fixes a bug in 7eeda1da90 (v256).
2025-02-28 23:38:02 +09:00
Yu Watanabe 91421f8379 recurse-dir: fix wrong assertion and error code in log
Fixes a bug in b5a07e524e (v250).
2025-02-28 23:37:52 +09:00
Yu Watanabe 649c63d6ac profile: return earlier if it is loaded from non-bash shell
Follow-up for dadbb34919.
2025-02-28 21:24:06 +09:00
Justinas Kairys 12b3ed44f3 po: Translated using Weblate (Lithuanian)
Currently translated at 70.0% (180 of 257 strings)

Co-authored-by: Justinas Kairys <j.kairys@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/lt/
Translation: systemd/main
2025-02-28 09:40:25 +00:00
Yu Watanabe 94dc76c996 test-network: extend test case for static routes
- split out verifications into two functions,
- also check the following scenarios:
  * unmanaging an existing interface,
  * re-managing an unmanaged interface,
  * adding a new unmanaged interface,
  * removing an unmanaged interface.
2025-02-28 08:51:14 +01:00
Luca Boccassi 80b55e4ac3 mkosi: update debian commit reference
* 4dab786933 Install new files
* a57877706d Install new files
* a6a26c4294 Install new files for upstream profile
* 2cc2784bbe Install new files for upstream
* 191edb6aa3 d/t/tests-in-lxd: skip test on any setup error
* 47c0a694b0 systemd-sysv: add Protected: yes
* 62ed7598fa README: add note about out-of-tree patches being forbidden
* dfd1b0409f systemd-resolved: recommend libidn2-0
* 88291172bc d/rules: ignore more blhc false positives
2025-02-28 15:57:10 +09:00
Yu Watanabe 3694397994 osc-context: fix typo
Follow-up for 91aa93ec8d.
2025-02-28 15:51:07 +09:00
Dan McGregor 113c159ba9 machine-id-setup: bhyve also provides a uuid
When using UEFI with bhyve it behaves similarly to qemu, and provides
a product_uuid. Use it if found, just like with qemu.
2025-02-28 13:15:35 +09:00
Lennart Poettering 46bd501faa Issue OSC ANSI sequence whenever we change "context" of a TTY, i.e. acquire privs, enter container or VM or similar (#35224)
This is mostly a strawman to get a discussion going regarding how to
communicate to terminal emulators such as ptyxis about run0 (and nspawn,
and vmspawn, and moe) and what it does.

It's hierarchical and I think still relatively simple.

/cc @chergert
2025-02-27 22:12:54 +01:00
Yu Watanabe 78f2c17454 parse-util: extend the maximum length of nftable identifiers
Since kernel v4.14, more specifically, after the following four commits,
https://github.com/torvalds/linux/commit/e46abbcc05aa8a16b0e7f5c94e86d11af9aa2770
https://github.com/torvalds/linux/commit/b7263e071aba736cea9e71cdf2e76dfa7aebd039
https://github.com/torvalds/linux/commit/387454901bd62022ac1b04e15bd8d4fcc60bbed4
https://github.com/torvalds/linux/commit/615095752100748e221028fc96163c2b78185ae4
the maximum length of nftable identifiers are extended to 255.

Now, our kernel baseline is 5.4, hence we can freely use the extended
name length.

This also modernizes code a bit, and adds test cases.

Closes #36542.
2025-02-28 04:57:00 +09:00
Yu Watanabe b8358967e6 sbsign: trivial coding style cleanups
Follow-ups for 8c0098d486.
2025-02-28 04:04:18 +09:00
Martin Wilck 505c2f2137 libfido2-util: accept cached pin in fido2_generate_hmac_hash()
fido2_generate_hmac_hash() sets req->keyring to "fido2-pin" when
calling ask_password_auto(), suggesting that a key by this name
can be read from the kernel keyring. But the keyring is never
opened because the ASK_PASSWORD_ACCEPT_CACHED flag is not set.

Set ASK_PASSWORD_ACCEPT_CACHED to allow automated / scripted
setup of encrypted volumes with FIDO2. If the PIN turns out to
be invalid, clear ASK_PASSWORD_ACCEPT_CACHED to avoid retrying
and possible lockout.
2025-02-27 17:35:47 +01:00
Lennart Poettering 250118f3f0 sbsign: Add support for offline signing (#36485)
Add new options --prepare-offline-signing, --signed-data= and
--signed-data-signature= which allow for offline signing in a
similar manner to pesign.
2025-02-27 17:34:05 +01:00
Lennart Poettering cf20b5d1dc units: measure additional phases into PCR 11 when entering storage target mode or factory reset (#36543)
Let's "spoil" access to TPM secrets when we boot into these two modes.
This matters in particular for storagetm: if the host gets exploited
while booted into storage target mode any secrets kept by the TPM might
remain accessible otherwise. By measuring a new "phase" word into PCR 11
we "blow the fuse" however on this boot.
2025-02-27 15:29:48 +01:00
Lennart Poettering bbdad5c025 core: also issue OSC 3008 from service context
(Note: we also change TEST-13-NSPAWN.machined.sh minimally here, because
it checks for byte precise output of a pty allocated for a service
invocation - which it's not going to get if it claims that the pty is an
all-powerful one. After all this PR ensures that we'll generate the new
OSC sequence on non-dumb terminals associated with services. Hence, set
TERM=dumb explicitly to ensure no ANSI sequences are generated, ever.
Which is a nice test btw that TERM=dumb really does its thing here.)
2025-02-27 15:17:34 +01:00
Lennart Poettering 5b3eaf9e68 terminal-util: change conditioning in terminal_reset_defensive()
So far we conditioned the logic that issues ansi sequences for resetting
the TTY based on whether something is a pty is not (under the assumption
we need no reset on ptys, since they are shortlived).

This is simply wrong though. The pty that a container getty is invoked
on is generally long-lived: as long as the container is up, and it will
be reused between getty instances/sessions all the time. In such a case
we really should reset properly.

Let's instead make the logic dependent on whether TERM is set to
anything other than "dumb". The previous commit made sure we always set
TERM in a sensible way in systemd-run, hence this
*explicit* logic sounds like a much better choice now, as it mea
2025-02-27 15:17:34 +01:00
Lennart Poettering 9ab703d8e1 terminal-util: change 2nd parameter of terminal_reset_defensive() to flags
let's convert the 2nd argumeng form a boolean to a proper flags
parameter. Doesn't change behaviour in anyway, but is more readable, and
prepares ground for adding more flags soon.
2025-02-27 15:13:15 +01:00
Lennart Poettering ddb503b7f6 nspawn: set TERM to "dumb" if we are invoked outside of TTY context 2025-02-27 15:13:15 +01:00
Lennart Poettering 4d6eb6441a run: tweak logic how we set $TERM for activated services
There are two cases when we invoke a service on a TTY:

1. We ourselves are connected to a TTY and would intend to enable PTY
   forwarding.
2. We are allocating a TTY but are not ourselves connected to a TTY and
   just want to input/output to pipe or other non-TTY fd.

Let's propagate $TERM only as-is in the first case. In the 2nd case,
let's explicitly set $TERM to "dumb", so that invoked progams do not
issue needless ansi sequences, since we are not propagating them to a
terminal either.

This should be a much safer result, for cases where people include
invocations of systemd-nspawn with full TTY allocation in a shell
pipeline or so.

(of course, the user can always explicitly override this)
2025-02-27 15:13:15 +01:00
Lennart Poettering dadbb34919 profile: generate shell + command OSC events 2025-02-27 15:13:15 +01:00
Lennart Poettering d8069b8add pam_systemd: issue context OSC sequences when allocating new TTY session
note: this also adds making a copy of the session type string after
registering the session. That's because we need to check the session
type we settled on later to condition out the OSC sequence (because it
should only be issued on TTY sessions). However, the session type string
originally quite likely points into the PAM environment block, which we
update in the meantime, invalidating that pointer. hence, make an
explicit copy first, and use that.
2025-02-27 15:11:31 +01:00
Lennart Poettering 575922c914 run: generate OSC context sequence in run0/system-run 2025-02-27 15:09:25 +01:00
Lennart Poettering ff03ac8730 machinectl: add OSC context support to login/shell commands 2025-02-27 15:09:25 +01:00
Lennart Poettering 5eb39a385a vmspawn: generate vm context OSC 2025-02-27 15:09:25 +01:00
Lennart Poettering 466b285bdb nspawn: output context OSC 2025-02-27 15:09:25 +01:00
Lennart Poettering 98c283131c pid1: issue boot context issue at boot 2025-02-27 15:09:25 +01:00
Lennart Poettering 91aa93ec8d osc-util: add helpers for writing OSC context events 2025-02-27 15:03:17 +01:00
Lennart Poettering 09b130c9cd doc: add OSC 3008 spec 2025-02-27 15:03:17 +01:00
Daan De Meyer d9c7d47f99 Update TODO 2025-02-27 14:55:00 +01:00
Daan De Meyer 8c0098d486 sbsign: Add support for offline signing
Add new options --prepare-offline-signing, --signed-data= and
--signed-data-signature= which allow for offline signing in a
similar manner to pesign.
2025-02-27 13:47:07 +01:00
Daan De Meyer 6f3ef02067 sbsign: Split out functions and switch to lower level APIs
Preparation for adding offline signing support. Some additional
features and fixes are included as well:

- We make sure to add an empty SMIMECAP attribute instead of a populated
  one to mimick pesign more.
- We switch to PKCS7_dataFinal() instead of PKCS7_final() as all that the
  latter does is an unnecessary copy before calling PKCS7_dataFinal().
- We add support for passing in the signing time via $SOURCE_DATE_EPOCH.
2025-02-27 13:47:05 +01:00
Lennart Poettering bc9414832d man: clean up how we name our PEM files in examples (#36541)
Kinda a follow-up for 2cc58b6c8a
2025-02-27 13:27:42 +01:00
Lennart Poettering 6ee3bc046b units: measure "factory-reset" into PCR 11 when we request factory reset
Let's make sure that the moment where factory reset is requested is
visible in the TPM PCR state, so that access to secrets is terminated.

This is particulary interesting when the system is booted with
systemd.unit=factory-reset.target on the kernel command line, requesting
a factory reset on the following boot. The preparations done in
userspace should already lose access to the TPM in that case.
2025-02-27 13:20:23 +01:00
Lennart Poettering b493502475 units: measure the fact we enter storage target mode into TPM
storagetm mode means we we are network accessible. let's lock down
access to TPM secrets in this case: let's measure a pcr "phase" string
into PCR 11.

This is good as it means that if we are exploited in this state FDE
secrets protected by TPM are likely to remain protected, since the PCR
values wouldn't allow access.
2025-02-27 13:20:23 +01:00
Lennart Poettering 2f093d8364 man: follow our own naming rules more closely
In some examples we inserted "-initrd" after the "public-key" instead of
before when naming PEM files. Let's fix that, and stick to common
suffixes.
2025-02-27 10:08:50 +01:00
Lennart Poettering da468d61ee man: follow our certificate/public-key/private-key PEM file naming rules
In 2cc58b6c8a and related we established
rules on naming certs/public-keys/private-keys:

*-public-key.pem
*-private-key.pem
*-certificate.pem

Let's follow that naming in repart's man page too.
2025-02-27 10:08:39 +01:00
Daan De Meyer f0372d5883 sbsign: Copy source to dest later
Preparation for later commit.
2025-02-27 10:03:42 +01:00
Daan De Meyer d8877019fb keyutil: Use fopen_tmpfile_linkable() 2025-02-27 10:03:29 +01:00
Daan De Meyer 27e040f742 keyutil: Reword pkcs7 documentation string a little 2025-02-27 10:03:12 +01:00
Daan De Meyer d46b16aff2 openssl-util: Introduce pkcs7_new() 2025-02-27 09:52:38 +01:00
Daan De Meyer ba6a904442 sbsign: Fix wrong variable being passed to log_error_errno() 2025-02-27 09:49:03 +01:00
Daan De Meyer d9e41bfe02 exec-invoke: Fix unshare() error handling (#36537) 2025-02-27 09:16:07 +01:00
Daan De Meyer f215835cb8 exec-invoke: Fix invalid use of error variable
Follow up for 406f177501
2025-02-27 09:15:22 +01:00
Daan De Meyer c78b06b1d2 exec-invoke: Fix unshare() error handling
Follow up for cd58b5a135
2025-02-27 09:15:03 +01:00
Yu Watanabe 768cda38e6 storagetm: fix typo
Follow-up for 1761066b13.
2025-02-27 13:48:34 +09:00
Yu Watanabe 44dc0c8c51 test: fix typo
Follow-up for f01132aacf.
2025-02-27 13:42:09 +09:00
Yu Watanabe cf4b70aac4 docs: fix typo
Follow-ups for d5de148996.
2025-02-27 13:37:20 +09:00
Yu Watanabe 98fc082c31 man: fix typo
Follow-up for f8825c1364.
2025-02-27 13:37:20 +09:00
Yu Watanabe 71427850a3 journal-remote: fix typo
Follow-up for c259c9e253.
2025-02-27 13:37:20 +09:00
Yu Watanabe 4bfbf0fcdf network: fix typo
Follow-up for 6698795eda.
2025-02-27 13:37:20 +09:00