Commit Graph
79705 Commits
Author SHA1 Message Date
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
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 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 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
Jaroslav Škarvada 9d7b2daef0 hwdb: add GOLD WARRIOR SIM PhoenixRC 10411R
Fixes #36522
2025-02-27 12:40:08 +09:00
Daan De Meyer 461bd9277a meson: Add missing dbus_programs dependency on update-dbus-docs
All dbus programs have to be up-to-date for update-dbus-docs to
produce the expected output, so add the missing dependency.
2025-02-27 12:39:52 +09:00
Yu Watanabe 587124d587 pam_systemd/pam_systemd_home: various fixes (#36505) 2025-02-27 12:37:05 +09:00
Mike Yuan c337a1301f core/service: do not propagate reload for combined RELOADING=1 + READY=1 when notify-reload
Follow-up for 3bd28bf721

SERVICE_RELOAD_SIGNAL state can only be reached via explicit reload jobs,
and we have a clear distinction between that and plain RELOADING=1
notifications, the latter of which is issued by clients doing reload
outside of our job engine. I.e. upon SERVICE_RELOAD_SIGNAL + RELOADING=1
we don't propagate reload jobs again, since that's done during transaction
construction stage already. The handling of combined RELOADING=1 + READY=1
so far is bogus however, as it tries to propagate duplicate reload jobs.
Amend this by following the logic for standalone RELOADING=1.
2025-02-26 23:41:33 +00:00
Justinas Kairys ecf85d8389 po: Translated using Weblate (Lithuanian)
Currently translated at 69.6% (179 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-27 08:21:40 +09:00
Lennart Poettering 4ec864162d update TODO 2025-02-26 22:07:05 +01:00
Lennart Poettering 263ea62468 test: extend test case to validate per-area $XDG_RUNTIME_DIR 2025-02-26 22:07:05 +01:00
Lennart Poettering cfb7abc7fc pam_systemd: complement per-area $HOME management with per-area $XDG_RUNTIME_DIRECTORY mgmt
When a user logs into a non-default area we give them a private
$HOME for that area (that's what 'area' is supposed to be after all). We
so far left $XDG_RUNTIME_DIRECTORY as it was. Let's change that and
mirror the subdirectory logic there too.

Why? $XDG_RUNTIME_DIR is generally the place where AF_UNIX sockets are
bound that can be used to connect to per-user services. (in particular
all those which are behind D-Bus.) If we don't patch $XDG_RUNTIME_DIR
like this then this means all the backing services will use the main
area, which is problematic (since clients and services will disagree on
$HOME), and makes it impossible to support the area concept for
graphical logins properly.

This does not actually make graphical logins work, but it at least makes
them fail cleanly. That's because this patch alone won't make sure a
per-area service manager/dbus instance is invoked automatically. That
however can be added later, in a patch to logind.
2025-02-26 22:07:05 +01:00
Lennart Poettering e35b78f14f pam-systemd: rework update_environment()
Let's tweak update_environment() a bit: instead of being a NOP when no
value is specified, let's actively unset the specified environment
variable if it is set.

This shouldn't change much, since for the cases we call the function so
far the env vars in question should not be set before us in a way we'd
set them differently. However, this is nice preparation for later, as we
can make use of this for XDG_AREA which we might want to unset if we
consider the area dir invalid.
2025-02-26 18:29:19 +01:00
Lennart Poettering c9802426cf pam-systemd: modernize export_legacy_dbus_address() a bit
Let's log about unexpected access() failures among other things
2025-02-26 18:29:19 +01:00
Lennart Poettering 9a4f9e84c4 pam_systemd_home: tweak order in authentication stack
Let's move pam_systemd_home before pam_unix in the authentication hook.

Since a while we are exposing shadow entries for homed log entries via
NSS. This means that pam_unix now potentially has enough data for
authenticating a user on its own, without letting pam_systemd_home do
that. This is superficially OK, but also means that authentication will
always go via password, even if pkcs11/fido2 is registered.

Let's move this around, but be careful about it: let's list the precise
errors which we think are enough to terminating further PAM processing,
so that pam_unix comes into control in all cases where it's not clear
that pam_systemd_home owns the user record.

This previously wasn't visible to me, because on Fedora until authselect
1.5.1 (released earleir this year) the NSS shadow stuff was not enabled.

This does the same also for the "account" stack, except that the order
there already was as we want it.

Finally, shorten the account stack, by just requiring pam_unix.so and
dropping pam_permit.so, because it doesn't really serve much purpose
(and Fedora doesn't use it by default either.)
2025-02-26 18:12:08 +01:00
Lennart Poettering 5856e869bb pam_systemd_home: update comment
Follow-up for 563c5511ad, which turned
boolean parameters into flags.
2025-02-26 18:12:08 +01:00
Lennart Poettering c63c6413e7 fs-util: add some assert()s 2025-02-26 18:12:04 +01:00
Lennart Poettering 14871a6529 efivars: kill SystemdOptions efi var support
This has been depracted since v254 (2023). Let's kill it for
good now, it has been long enough with 2y. Noone has shown up who wants
to keep it. And given it doesn't work in SB world anyway, and is not
measured is quite problematic security wise.
2025-02-26 17:28:43 +01:00
Daan De Meyer 2dbc2d1d0f docs: Use mkosi -R instead of mkosi -t none (#36528)
mkosi now supports -R to rerun build scripts without rebuilding the
image so let's document that instead of the current hack to prevent
the rebuild by changing the output format.
2025-02-26 15:56:51 +01:00
Lennart Poettering 9287ec34d5 udev: make gcc static check shut up, regarding strncpy() 2025-02-26 15:43:15 +01:00
Lennart Poettering eee056443b udev: modernize udev-builtin-btrfs a bit
Let's in particular log an even if a device name is too long for the
btrfs ioctl structure, instead of truncating it (which could
theoretically reference a different device).
2025-02-26 15:06:06 +01:00
Lennart Poettering f36b0ec14b notify-recv: several followups, port pid1 over too (#36492) 2025-02-26 15:05:46 +01:00
Daan De Meyer 031a474c91 docs: Use mkosi -R instead of mkosi -t none
mkosi now supports -R to rerun build scripts without rebuilding the
image so let's document that instead of the current hack to prevent
the rebuild by changing the output format.
2025-02-26 14:58:53 +01:00
Daan De Meyer 6ccb14af88 mkosi: Update to latest 2025-02-26 14:58:39 +01:00
Mike Yuan c578bf6e17 Expose chassis asset tag in hostnamed (#36487)
Closes #36442
2025-02-26 14:28:26 +01:00
Antonio Alvarez Feijoo 5d2d0c055b import/pull-tar: fix flag set
There is a typo passing flags to `install_file()`, if `IMPORT_READ_ONLY` is set,
`IMPORT_SYNC` is never checked.
2025-02-26 13:06:31 +00:00
Mike Yuan 5d09689b5c core/manager: port to notify_recv_with_fds() 2025-02-26 13:27:39 +01:00
Mike Yuan 4a5b06c5d1 shared/async: introduce asynchronous_close_many() helper 2025-02-26 13:02:28 +01:00