Commit Graph

81865 Commits

Author SHA1 Message Date
Eisuke Kawashima
9521222222 chore: fix editorconfig pattern and add setting for zsh 2025-05-30 14:53:45 +09:00
Jörg Behrmann
5b5155dbf8 NEWS: fix typos 2025-05-30 06:26:57 +09:00
Mike Yuan
c51379e6d8 Use DCS sequence to query terminal name and set $TERM automatically (#37538)
This code seems to work quickly and nicely for a bunch of modern
terminals. Setting $TERM automatically removes an common annoyance for
users. This code will not work for all terminal emulators, but by adding
it in systemd we'll entice maintainers of those terminals to add support
for the sequences. For the terminals that don't support the sequence, we
get a bit of a slowdown of `< 1 ms`, which seems hardly noticeable. The
user can always set TERM explicitly to avoid this if upgrading to a
newer terminal emulator is not possible.

Closes https://github.com/systemd/systemd/issues/36994.
2025-05-29 21:01:01 +02:00
Temuri Doghonadze
b222e71211 po: Translated using Weblate (Georgian)
Currently translated at 100.0% (257 of 257 strings)

Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ka/
Translation: systemd/main
2025-05-30 02:55:28 +09:00
Zbigniew Jędrzejewski-Szmek
f256e48d4e basic/terminal-util: drop now-unused default_term_for_tty 2025-05-29 19:20:31 +02:00
Zbigniew Jędrzejewski-Szmek
ad6ca4a612 core: use terminal DCS sequence to set $TERM
query_term_for_tty() is used in two places: in fixup_environment(),
which affects PID1 itself, and in build_environment(), which affects
spawned services. There is obviously some cost to the extra call,
but I think it's worthwhile to do it. When $TERM is set incorrectly,
basic output works OK, but then there are various annoying corner
cases. In particular, we get the support for color (or lack of it)
wrong, and when output is garbled, users are annoyed. Things like
text editors are almost certain to behave incorrectly. Testing in
test-terminal-util indicates that the time required to make a successful
query is on the order of a dozen microseconds, and an unsuccessful
query costs as much as our timeout, i.e. currently 1/3 ms. I think
this is an acceptable tradeoff.

No caching is used, because fixup_environment() is only called once,
and the other place in build_environment(), only affects services
which are connected to a tty, which is only a handful of services,
and often only started in special circumstances.

Fixes https://github.com/systemd/systemd/issues/36994.
2025-05-29 19:20:31 +02:00
Zbigniew Jędrzejewski-Szmek
e3b050a5c2 basic/terminal-util: add a heuristic check whether terminfo file exists 2025-05-29 19:20:31 +02:00
Zbigniew Jędrzejewski-Szmek
38b79aa0ea test-terminal-util: print how long the asynchronous queries take 2025-05-29 19:20:31 +02:00
Zbigniew Jędrzejewski-Szmek
5321b957b4 basic/terminal-util: query terminal name by DCS
As requested in https://github.com/systemd/systemd/issues/36994,
use DCS + q name ST. This works, but has limited terminal support:
xterm, foot, kitty.
2025-05-29 19:20:31 +02:00
Zbigniew Jędrzejewski-Szmek
505a5d2bcd Merge remote-tracking branch 'systemd-security/coredump-d' 2025-05-29 17:22:19 +02:00
Luca Boccassi
f13bc8533c login: receive synthetic events for devices with 'uaccess' tag (#37654)
Fixes #37579.
2025-05-29 15:11:14 +01:00
Luca Boccassi
5cfc9c34f4 sysupdate: change status once operation has completed
Otherwise after the service exits it will still show
"Installing 'foobar'" as the status, which is confusing
2025-05-29 15:44:31 +02:00
Allison Karlitskaya
1994426f90 NEWS: fix description of CopyFiles==::fsverity=copy
This doesn't enable fs-verity on every file, but preserves the fs-verity
status that was present to start with.
2025-05-29 18:54:05 +09:00
Shubhendra Kushwaha
fbad1beae4 docs: add man pages for sd_device_enumerator_add_match_* (#37589)
Add man pages for:
- `sd_device_enumerator_add_all_parents`
- `sd_device_enumerator_add_match_parent`
- `sd_device_enumerator_add_match_property`
- `sd_device_enumerator_add_match_property_required`
- `sd_device_enumerator_add_match_subsystem`
- `sd_device_enumerator_add_match_sysattr`
- `sd_device_enumerator_add_match_sysname`
- `sd_device_enumerator_add_match_tag`
- `sd_device_enumerator_add_nomatch_sysname`
- `sd_device_enumerator_allow_uninitialized`.

Related to #20929
2025-05-29 18:40:18 +09:00
Yu Watanabe
50e518a96a login: add several debugging logs about synthetic events 2025-05-29 11:41:25 +09:00
Yu Watanabe
392b9ab647 login: add device monitor instance to receive events for devices with uaccess tag
With c960ca2be1, logind triggers uevents
for devices with uaccess tag, and waits for the events being processed
by udevd.
However, logind received not all triggered events, and might lose some
events. That causes session and user state file not updated, and many
desktop environment application handled the session and user were inactive.

This introduces one more device monitor instance which monitor events
for devices with 'uaccess' tag. Hence, all triggered events will be
recieved by logind, and session and user state file will be updated.

Follow-up for c960ca2be1.
Fixes #37579.
2025-05-29 11:41:25 +09:00
Mike Yuan
4313aeedf5 ssh-generator: two cleanups (#37649) 2025-05-29 02:26:44 +02:00
Luca Boccassi
60491ceb12 test: fix TEST-84-STORAGETM with nvme-cli < 2.7
The -vv parameter was added in version 2.7, check before using it

Follow-up for ebc0514a65
2025-05-29 01:15:56 +01:00
Zbigniew Jędrzejewski-Szmek
9ce8e3e449 Define helper to call PR_SET_DUMPABLE 2025-05-29 00:19:24 +02:00
Zbigniew Jędrzejewski-Szmek
76e0ab49c4 coredump: introduce an enum to wrap dumpable constants
Two constants are described in the man page, but are not defined by a header.
The third constant is described in the kernel docs. Use explicit values to
show that those are values are defined externally.
2025-05-29 00:12:10 +02:00
Zbigniew Jędrzejewski-Szmek
e6a8687b93 coredump: when %F/pidfd is used, again allow forwarding to containers 2025-05-29 00:10:55 +02:00
Luca Boccassi
868d95577e coredump: add support for new %F PIDFD specifier
A new core_pattern specifier was added, %F, to provide a PIDFD
to the usermode helper process referring to the crashed process.
This removes all possible race conditions, ensuring only the
crashed process gets inspected by systemd-coredump.
2025-05-29 00:10:55 +02:00
Zbigniew Jędrzejewski-Szmek
13902e0253 coredump: get rid of a bogus assertion
The check looks plausible, but when I started checking whether it needs
to be lowered for the recent changes, I realized that it doesn't make
much sense.

context_parse_iovw() is called from a few places, e.g.:
- process_socket(), where the other side controls the contents of the
  message. We already do other checks on the correctness of the message
  and this assert is not needed.
- gather_pid_metadata_from_argv(), which is called after
  inserting MESSAGE_ID= and PRIORITY= into the array, so there is no
  direct relation between _META_ARGV_MAX and the number of args in the
  iovw.
- gather_pid_metadata_from_procfs(), where we insert a bazillion fields,
  but without any relation to _META_ARGV_MAX.

Since we already separately check if the required stuff was set, drop this
misleading check.
2025-05-29 00:10:55 +02:00
Zbigniew Jędrzejewski-Szmek
8fc7b2a211 coredump: also stop forwarding non-dumpable processes
See the comment in the patch for details.

Suggested-by: Qualys Security Advisory <qsa@qualys.com>
2025-05-29 00:10:55 +02:00
Zbigniew Jędrzejewski-Szmek
0c49e0049b coredump: use %d in kernel core pattern
The kernel provides %d which is documented as
"dump mode—same as value returned by prctl(2) PR_GET_DUMPABLE".

We already query /proc/pid/auxv for this information, but unfortunately this
check is subject to a race, because the crashed process may be replaced by an
attacker before we read this data, for example replacing a SUID process that
was killed by a signal with another process that is not SUID, tricking us into
making the coredump of the original process readable by the attacker.

With this patch, we effectively add one more check to the list of conditions
that need be satisfied if we are to make the coredump accessible to the user.

Reportedy-by: Qualys Security Advisory <qsa@qualys.com>

In principle, %d might return a value other than 0, 1, or 2 in the future.
Thus, we accept those, but emit a notice.
2025-05-29 00:10:08 +02:00
Lennart Poettering
a5b713630f update NEWS 2025-05-28 23:01:21 +02:00
Mike Yuan
ce449b226b meson: improve -ffinite-math-only option detection and silence warning when build with -Ofast (#37638) 2025-05-28 22:42:39 +02:00
Mike Yuan
e72bd8dbc8 ssh-generator: add missing newline before [Service] and trailing NL to generated service 2025-05-28 22:30:46 +02:00
Mike Yuan
0aa4c3f0f9 ssh-generator: fix typo 2025-05-28 22:30:39 +02:00
Yu Watanabe
f1b7b34cc7 NEWS: fix typo 2025-05-29 04:03:00 +09:00
Luca Boccassi
24ee70d4f5 NEWS: fix typos and formatting 2025-05-28 19:49:56 +01:00
Jan Čermák
c9f931b737 journal-gatewayd: add /boots endpoint (#37574)
Add endpoint for listing boots. Output format mimics `journalctl
--list-boots -o json`, so it's a plain array containing index, boot ID
and timestamps of the first and last entry. Initial implementation
returns boots ordered starting with the current one and doesn't allow
any filtering (i.e. equivalent of --lines argument).

Fixes: #37573
2025-05-29 03:33:03 +09:00
Luca Boccassi
7a232071d0 Man page fixes (#37645) 2025-05-28 19:15:46 +01:00
Mike Yuan
46bcfe651f NEWS: fix typo, reorganize a few entries 2025-05-28 19:25:39 +02:00
Lennart Poettering
5b94cdf888 update TODO 2025-05-28 18:29:47 +02:00
Lennart Poettering
e08ee8fdd3 update NEWS in preparation for v258 2025-05-28 18:29:47 +02:00
Tim Vangehugten
082f2556a6 po: Translated using Weblate (Dutch)
Currently translated at 92.2% (237 of 257 strings)

Co-authored-by: Tim Vangehugten <timvangehugten@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/nl/
Translation: systemd/main
2025-05-28 16:33:03 +01:00
Zbigniew Jędrzejewski-Szmek
b082968d19 man: better tags, more links, minor grammar and formatting improvements
Closes https://github.com/systemd/systemd/issues/35751.
2025-05-28 15:35:53 +02:00
Zbigniew Jędrzejewski-Szmek
acf3bdf813 man/systemd.network: reword description of MulticastIGMPVersion= 2025-05-28 15:34:47 +02:00
Zbigniew Jędrzejewski-Szmek
f56d9b82b1 man/systemd.timer: change to positive wording 2025-05-28 15:34:47 +02:00
Zbigniew Jędrzejewski-Szmek
de8d2894b8 man: reword descriptions of numerical fields
A "string" is a concept in C. In a text-based API, this is implicit, especially
if we say that something was "formatted". So change occurences of "decimal
string" to just "decimal". Similarly, "numerics" is unclear, say "digits".

Also, a "timestamp is in a clock" just sounds wrong. Reword those sentences.
2025-05-28 15:34:47 +02:00
Zbigniew Jędrzejewski-Szmek
948369983c man/systemd-resolved: update description of routing 2025-05-28 15:34:47 +02:00
Zbigniew Jędrzejewski-Szmek
8bfdba3cb1 man/systemd-analyze: rewrite "Exit status" section 2025-05-28 15:34:47 +02:00
Zbigniew Jędrzejewski-Szmek
3a23e96b67 man/pam_systemd: use <constant> consistently
For some reason, <constant> and <literal> were used interchangeably.
2025-05-28 15:33:39 +02:00
Zbigniew Jędrzejewski-Szmek
001ae86a73 man: introduce openssl as man page provider and use it for ukify.1 2025-05-28 15:33:39 +02:00
Luca Boccassi
5a01c7c5f4 network: fix handling of ENODATA when reading IFLA_MASTER attribute (#37633)
Fixes #37629.
2025-05-28 12:20:00 +01:00
Yu Watanabe
d117687ab3 sd-bus: rename internal structs and enums
This renames e.g. struct bus_body_part -> BusMessageBodyPart to
follow our usual coding style. Also, several struct and enum
declarations are moved to relevant headers.
Also, this introduces bus-forward.h.
2025-05-28 09:52:28 +02:00
Eisuke Kawashima
39c3638445 zsh-completion: improve systemd-run
- add missed options
- improve completion for property
2025-05-28 09:50:53 +02:00
Yu Watanabe
4e36b79a84 cgroup-util: drop CGROUP_MASK_EXTEND_JOINED; move CGROUP_CPU_SHARES/BLKIO* to nspawn-oci (#37639) 2025-05-28 09:50:05 +09:00
Yu Watanabe
816a852324 core/exec-invoke: don't set $TMPDIR if sandboxing is disabled (#37637)
Follow-ups for #37271.
2025-05-28 09:46:06 +09:00