1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00
Commit Graph

70957 Commits

Author SHA1 Message Date
Adrian Vovk
49e55abb7f
user-record: Add languages field
This field is like preferredLanguage, but takes a priority list of
languages instead. If an app isn't translated into a user's primary
language, it can fall back to one of the other languages in the list
thus making the app more accessible to the user.

For instance: in my experience, many Ukrainians are fluent in Russian,
often significantly better than English (especially if they are of a
generation that grew up during the USSR). Such a person might set this
new variable to ["uk_UA.UTF-8", "ru_UA.UTF-8"] so that software that
lacks Ukrainian translations will first try Russian translations before
defaulting to English.

Fixes #31290
2024-02-13 17:39:14 -05:00
Adrian Vovk
fa485e8fc5
locale-util: Restrict valid locales
This further restricts the charset of locales to better reflect what
locales actually look like.

This allows us to safely join locale names using the `:` character, for
instance, which cannot appear in a locale name and is used by the
`$LANGUAGE` env var
2024-02-13 17:31:36 -05:00
Adrian Vovk
592ca6f0ef
pam_systemd: Let user record override env vars
The user record should be the source of truth for the user's environment
variables, and the user should be able to override them in much the same
way that they can if they simply append the variable to their ~/.profile

For example, before $LANG would never get set to the user's preferred
language, because the service manager always ensures that $LANG is set
to something (either the localed config, or a compiled-in default). Thus
the user's preferredLanguage setting was always ignored
2024-02-13 17:31:35 -05:00
Daan De Meyer
6d55e3a364 Use tilde for rc tag versioning
tilde sorts lower in the version comparison spec:
https://uapi-group.org/specifications/specs/version_format_specification/

➜  systemd git:(strip) systemd-analyze compare-versions 249\~rc1 249
249\~rc1 < 249
➜  systemd git:(strip) systemd-analyze compare-versions 249-rc1 249
249-rc1 > 249

Also update tools/meson-vcs-tag.sh to use carets instead of hyphens
for the git part of the version as carets are allowed to be part of
a version by pacman while hyphens are not and both sort higher than
a version without the git part.
2024-02-13 18:14:36 +01:00
김인수
ccc5673cc9 po: Translated using Weblate (Korean)
Currently translated at 100.0% (227 of 227 strings)

Co-authored-by: 김인수 <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
2024-02-13 10:49:37 +01:00
Lennart Poettering
c9cdbaed17
Merge pull request #30380 from keszybz/tmpfiles-dry-run
Make tmpfiles/sysusers nicer with local files and implement tmpfiles --dry-run
2024-02-13 09:45:50 +01:00
Ondrej Kozina
c5daf14c88 cryptsetup: Add optional support for linking volume key in keyring.
cryptsetup 2.7.0 adds feature to link effective volume key in custom
kernel keyring during device activation. It can be used later to pass
linked volume key to other services.

For example: kdump enabled systems installed on LUKS2 device.
This feature allows it to store volume key linked in a kernel keyring
to the kdump reserved memory and reuse it to reactivate LUKS2 device
in case of kernel crash.
2024-02-13 09:45:08 +01:00
Lennart Poettering
10048b2e20 update TODO 2024-02-13 09:17:43 +01:00
Frantisek Sumsal
16343f52ba
Merge pull request #31271 from fbuihuu/test-69-debugging-improvements
Test 69 debugging improvements
2024-02-12 21:14:43 +01:00
Lennart Poettering
9321b5187f
Merge pull request #31284 from poettering/btrfs-alignment
btrfs: various clean-ups including alignment fixes
2024-02-12 17:50:13 +01:00
cunshunxia
c18c7e2322 Fix OOMPolicy= version in manpage of systemd.scope
OOMPolicy in scope units is separately supported in
version v253, so I think it cannot be directly used
in the manpage with the version from the service.

fix:#30836
2024-02-12 16:49:42 +00:00
Luca Boccassi
27af7c2b4c
Merge pull request #31162 from poettering/tint-tweaks
ptyfwd: some tweaks to terminal handling
2024-02-12 16:47:09 +00:00
Franck Bui
cf14d11447 test/test-shutdown.py: optionally display the test I/Os in a dedicated log file
Given that the test involves screen(1), sending various control sequences to
resize/clear the screen, most of the logs sent from the python script were
nearly impossible to read or mixed with other messages sent to the console
hence making the debug harder when the test is run manually.

This patch introduces an option to redirect the pexpect IOs into a file (to be
used in $STATEDIR/TEST-69-SHUTDOWN/run-nspawn).

The pexpect logs are also enabled later so the boot logs are skipped since
those are already included in the journal.
2024-02-12 16:57:51 +01:00
Lennart Poettering
a85daa97d9
Merge pull request #31233 from poettering/pcrlock-varlink
pcrlock: add simple Varlink API + some varlinkctl tweaks
2024-02-12 15:48:03 +01:00
Lennart Poettering
801bf40c3b btrfs-util: apparently btrfs ioctls return unaligned data. deal with it.
Kinda sad, that interfaces like this exist in 2024. But let's deal with
it: before we access "struct btrfs_ioctl_search_header" let's copy it
out, and access it only in the aligned copy.

Fixes: #31282
2024-02-12 15:35:15 +01:00
Lennart Poettering
e5c41c6138 btrfs-util: use memdup_suffix0() instead of strndup() at one more place
The structure we copy this out is a large (unaligned) binary blob, hence
let's better use the memdup_suffix0() so that gcc doesn't make
assumption about the source being a valid string.
2024-02-12 15:35:11 +01:00
Lennart Poettering
05f38c897f btrfs-util: rework btrfs_is_nocow_fd() around fd_is_fs_type() + read_attr_fd()
Let's our safer helpers where appropriate.
2024-02-12 15:35:03 +01:00
Mike Yuan
eef2b1a7b1
core/load-fragment: fix typo (sanety -> sanity)
Follow-up for 435e1098ee
2024-02-12 21:44:50 +08:00
Lennart Poettering
8b68a199c2
Merge pull request #31242 from poettering/socket-uid-account
pid1: make MaxConnectionsPerSource= do something useful on AF_UNIX sockets
2024-02-12 14:07:51 +01:00
Lennart Poettering
39d69836ad missing: change our close_range() syscall wrapper to map glibc's
So glibc exposes a close_range() syscall wrapper now, but they decided
to use "unsigned" as type for the fds. Which is a bit weird, because fds
are universally understood to be "int". The kernel internally uses
"unsigned", both for close() and for close_range(), but weirdly,
userspace didn't fix that for close_range() unlike what they did for
close()... Weird.

But anyway, let's follow suit, and make our wrapper match glibc's.

Fixes #31270
2024-02-12 14:07:19 +01:00
Zbigniew Jędrzejewski-Szmek
2479f0bb09 TODO: add --dry-run/-n 2024-02-12 13:34:39 +01:00
Zbigniew Jędrzejewski-Szmek
b214427752 TEST-22: add --dry-run calls
aCdDefLprRwxXz are tested with --dry-run.
I added a primitive test of bc.
There were no tests for AhHt, and I didn't add those either.
2024-02-12 13:34:32 +01:00
Zbigniew Jędrzejewski-Szmek
983dbcefe8 systemd-tmpfiles: use statx_mount_same
It was pointed out in review that the preexisting code should be updated
(https://github.com/systemd/systemd/pull/30380#discussion_r1426899180).
2024-02-12 13:34:25 +01:00
Zbigniew Jędrzejewski-Szmek
9e90d4f42e tmpfiles: implement --dry-run
The idea is simple: skip the final operation that creates or removes things
or changes the attributes, but otherwise go through the rest of the code.
This results in quite a lot of fairly repetitive conditions in the low-level
code. Another approach would be to print earlier, at a higher level, but then
we'd have less precise information about what is about to happen.
2024-02-12 13:33:30 +01:00
Michal Koutný
5734d5d04c service: Demote log level of NotifyAccess= messages to debug
The situation is a service like

        Type=notify
        NotifyAccess=main

and the service uses some of the systemd helper utilities, e.g.
coredumpctl. The service process will pass NOTIFY_SOCKET to the helper
child (accidentally) and the result is a spurious notification and
the warning message:

> Jan 18 09:38:01 host systemd[1]: sdnotify.service: Got notification message from PID 13736, but reception only permitted for main PID 13549

Notification from helpers seem like an unintentional composition of the
commit c118b577fa ("coredumpctl: define main through macro") and commit
6b636c2d27 ("main-func: send main exit code to parent via sd_notify() on
exit"). The former used the handy macro for a main function, the latter
equipped any main function with the notification. (Further extended in
the commit 623a00020f ("notify: Add EXIT_STATUS field").)

Since notification from systemd utitilities are meant to extend
rudimentary exit()/wait() pair generally, they may happen to land into
service's NOTIFY_SOCKET. Tone down messages of notification that won't
match NotifyAccess=.
2024-02-12 12:20:39 +01:00
Lennart Poettering
a66ab6d801
Merge pull request #31076 from CodethinkLabs/vmspawn/directory_image_support
[vmspawn] directory type image support
2024-02-12 12:20:16 +01:00
Mike Yuan
d7ececa107
Merge pull request #31028 from yuwata/journalctl-raise
journalctl: call all cleanup functions before raise()
2024-02-12 19:16:15 +08:00
Mike Yuan
4d0b06d535
Merge pull request #31181 from fbuihuu/gpt-auto-more-defensive
gpt-auto-generator: be more defensive when checking the presence of E…
2024-02-12 19:12:17 +08:00
Lennart Poettering
e0abffe600 update TODO 2024-02-12 12:04:18 +01:00
Lennart Poettering
d02018afdb test: add brief test for prclock varlink interfaces and varlinkctl --collect 2024-02-12 12:04:18 +01:00
Lennart Poettering
24835e9933 varlinkctl: if "call" verb is used, imply "-j"
For the other verbs turning off JSON mode makes sense, but for "call"
not so much, after all the contents of a method call reply is JSON we
couldn't really show any other way.

Hence, when JSON output was not configured otherwise in "call", default
to the same as -j.
2024-02-12 12:04:18 +01:00
Lennart Poettering
7781d28fd7 varlinkctl: add new --collect switch
It exposes the varlink_collect() call we internally provide: it collects
all responses of a method call that is issued with the "more" method
call flag. It then returns the result as a single JSON array.
2024-02-12 12:04:18 +01:00
Lennart Poettering
9bca989183 varlink: rework varlink_collect()
This reworks varlink_collect() so that it is not just a wrapper around
varlink_observe(), varlink_bind_reply() and others. It becomes a first
class operation.

This has various benefits:

1. Memory management is normalized: the reply json variant is now
   tracked as part of the varlink object, and thus we do not pass
   ownership to the caller. This is just like we do it for simple method
   calls and removes a lot of confusion.
2. The bind reply/user data pointer can be used for user stuff, we'll
   not silently override this.
3. We enforce an overall time-out operation on the whole thing, so that
   this synchronous operation does no longer block forever.
2024-02-12 12:04:18 +01:00
Lennart Poettering
72226a2f95 varlink: properly return reply flags to callers
We so far have a reply flags return parameter on varlink_call_full(),
but we return 0 always. Let's fix that, and return the actual flags we
see.
2024-02-12 12:04:18 +01:00
Lennart Poettering
0430a11eb4 varlink: enforce a maximum size limit on replies collected via varlink_collect()
We should not allow servers to blow up client's memory without bounds,
hence set a (high) limit on replies we'll collect before failing.
2024-02-12 12:04:18 +01:00
Lennart Poettering
15138e7980 pcrlock: add basic Varlink interface
This can be used to make or delete a PCR policy via Varlink. It can also
be used to query the current event log in CEL format.
2024-02-12 12:04:18 +01:00
Lennart Poettering
9fe15ce84d pcrlock: split out generation of CEL objects into helper func
This way, we can reuse it later to generate Varlink replies

No change in behaviour, just some trivial split out.
2024-02-12 12:04:18 +01:00
Lennart Poettering
8279484a41 pcrlock: use log_setup() 2024-02-12 12:02:27 +01:00
Lennart Poettering
3456c89ac2 test: add a simple test for MaxConnectionsPerSocket= 2024-02-12 11:57:31 +01:00
Lennart Poettering
5d1e8cd3e0 units: enable MaxConnectionsPerSocket= for all our Accept=yes units
Let's make sure that user's cannot DoS services for other users so
easily, and enable MaxConnectionsPerSocket= by default for all of them.

Note that this is mostly paranoia for systemd-pcrextend.socket and
systemd-sysext.socket: the socket is only accessible to root anyway,
hence the accounting shouldn#t change anything. But this is just a
safety net, in preparation that we open up some functionality of these
services sooner or later.
2024-02-12 11:57:24 +01:00
Lennart Poettering
48930a5ded pid1: make MaxConnectionsPerSource= also work for AF_UNIX sockets
The setting currently puts limits on connections per IP address and
AF_UNIX CID. Let's extend it to cover AF_UNIX too, where it puts a limit
on connections per UID.

This is particularly useful for the various Accept=yes Varlink services
we now have, as it means, the number of per-user instance services
cannot grow without bounds.
2024-02-12 11:57:16 +01:00
Yu Watanabe
f43330eace
Merge pull request #30209 from yuwata/sd-journal-reduce-fstat
sd-journal: potentially reduce number of fstat call
2024-02-12 19:38:24 +09:00
Sam Leonard
a8f940c4b5
vmspawn: add support for --bind(-ro)= 2024-02-12 09:46:02 +00:00
Sam Leonard
7fe9c9909d
vmspawn: document --directory and --private-users 2024-02-12 09:46:01 +00:00
Sam Leonard
c05ca33af3
vmspawn: add support for --private-users 2024-02-12 09:46:01 +00:00
Sam Leonard
d4a58877e4
nspawn: use parse_userns_uid_range 2024-02-12 09:46:01 +00:00
Sam Leonard
acdef55ef7
basic/namespace-util: add parse_userns_uid_range 2024-02-12 09:46:00 +00:00
Sam Leonard
5c57a86506
vmspawn: add support for -D/--directory 2024-02-12 09:46:00 +00:00
Eric Daigle
321a8c595e firstboot: validate keymap entry
As described in #30940, systemd-firstboot currently does not perform
any validation on keymap entry, allowing nonexistent keymaps to be
written to /etc/vconsole.conf. This commit adds validation checks
based on those already performed on locale entry, preventing invalid
keymaps from being set.

Closes #30940

m
2024-02-12 10:23:38 +01:00
Frantisek Sumsal
3588c510d3
Merge pull request #31149 from YHNdnzj/restart-force-oneshot
core/service: allow RestartForceExitStatus= for oneshot service
2024-02-12 10:20:09 +01:00