1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-01 08:58:29 +03:00

78749 Commits

Author SHA1 Message Date
Lennart Poettering
390dffb862 man: also fix documentation of start-limit-hit 2025-01-15 10:42:10 +01:00
Lennart Poettering
a7620f5dd1 bus-wait-for-jobs: fix service result table
We were missing one service result (oom-kill), and the ratelimit one is
called differently. Correct that so that we generate proper log messages
for these cases.
2025-01-15 10:41:11 +01:00
Lennart Poettering
1d522f1a86 terminal-util: drop support for pre-TIOCGPTPEER kernels
Our minimum baseline is now far beyond 4.13, hence let's drop these
fallback paths.
2025-01-15 10:39:04 +01:00
Lennart Poettering
3eafa5e23c update TODO 2025-01-15 10:37:19 +01:00
Zbigniew Jędrzejewski-Szmek
69c9629da7
sysusers: emit audit events for user and group creation (#35957)
Background: Fedora/RHEL are switching to sysusers.d metadata for
creation of users and groups for system users defined by packages
(https://fedoraproject.org/wiki/Changes/RPMSuportForSystemdSysusers).
Packages carry sysusers files. During package installation, rpm calls an
program to execute on this config. This program may either be
/usr/lib/rpm/sysusers.sh which calls useradd/groupadd, or
/usr/bin/systemd-sysusers. To match the functionality provided by
useradd/groupadd from the shadow-utils project, systemd-sysusers must
emit audit events so that it provides a drop-in replacement.

systemd-sysuers will emit audit events AUDIT_ADD_USER/AUDIT_ADD_GROUP
when adding users and groups. The operation "names" are copied from
shadow-utils, so the format of the events that is generated on success
should be identical. On failure, things are more complicated. We write
the whole file at once, once, so we first generate "success" messages
for each entry, then we try to write the files, and if things fail, we
generate failure messages to all entries that we failed to write.
2025-01-15 10:36:07 +01:00
Zbigniew Jędrzejewski-Szmek
0dba7b5c6b core: use shared audit-fd wrappers
Two funcs are renamed to avoid naming conflict with the common
helper.
2025-01-15 10:35:28 +01:00
Zbigniew Jędrzejewski-Szmek
9c6afab6b6 sysusers: emit audit events for user and group creation
Background: Fedora/RHEL are switching to sysusers.d metadata for creation of
users and groups for system users defined by packages
(https://fedoraproject.org/wiki/Changes/RPMSuportForSystemdSysusers).
Packages carry sysusers files. During package installation, rpm calls an
program to execute on this config. This program may either be
/usr/lib/rpm/sysusers.sh which calls useradd/groupadd, or
/usr/bin/systemd-sysusers. To match the functionality provided by
useradd/groupadd from the shadow-utils project, systemd-sysusers must emit
audit events so that it provides a drop-in replacement.

systemd-sysuers will emit audit events AUDIT_ADD_USER/AUDIT_ADD_GROUP when
adding users and groups. The operation "names" are copied from shadow-utils in
Fedora (which has a patch to change them from the upstream version), so the
format of the events that is generated on success should be identical.

The helper code is shared between sysusers and utmp-wtmp. I changed the
audit_fd variable to be unconditional. This way we can avoid ugly iffdefery
every time the variable would be used. The cost is that 4 bytes of unused
storage might be present. This is negligible, and the compiler might even be
able to optimize that away if it inlines things.
2025-01-15 10:35:28 +01:00
Yu Watanabe
132a164d97
Follow-ups for recent namespace PRs (#35923) 2025-01-15 14:10:21 +09:00
Jeremy Linton
2572bf6a39 confidential-virt: add detection for aarch64 CCA
The arm confidential compute architecture (CCA) provides a platform design for
confidential VMs running in a new realm context.

This can be detected by the existence of a platform device exported for the
arm-cca-guest driver, which provides attestation services via the realm
services interface (RSI) to the Realm Management Monitor (RMM).

Like the other methods systemd uses to detect Confidential VM's, checking
the sysfs entry suggests that this is a confidential VM and should only be
used for informative purposes, or to trigger further attestation.

Like the s390 detection logic, the sysfs path being checked is not labeled
as ABI, and may change in the future. It was chosen because its
directly tied to the kernel's detection of the realm service interface rather
to the Trusted Security Module (TSM) which is what is being triggered by the
device entry. The TSM module has a provider string of 'arm-cca-guest' which
could also be used, but that (IMHO) doesn't currently provide any additional
benefit except that it can fail of the module isn't loaded.

More information can be found here:
https://developer.arm.com/documentation/den0125/0300

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
2025-01-15 13:51:12 +09:00
Lennart Poettering
28425b73ee update TODO 2025-01-15 00:26:00 +01:00
Daan De Meyer
bbe9e03f80 man: Clarify systemd-notify and sd_notify() PID documentation
Let's clarify more explicitly that privileged calls to
systemd-notify --pid= and sd_pid_notify() effectively override any
configured NotifyAccess=main|exec for a service.
2025-01-14 21:07:06 +00:00
Daan De Meyer
05932f4768 mkosi: Install libxslt on CentOS/Fedora instead of xsltproc
Same package, but xsltproc is a very recently introduced Provides
for libxslt, and isn't available on CentOS Stream 9, so let's install
the package directly instead.
2025-01-14 16:01:56 +01:00
Lennart Poettering
f54390de87 NEWS: mention mesg y/n 2025-01-14 15:38:39 +01:00
Silvio Knizek
6731769320
docs: fix markup (#35995) 2025-01-14 15:19:56 +01:00
Sea-Eun Lee
015a3b8cb1 oomd: support reloading configuration at runtime 2025-01-14 14:42:23 +01:00
Lennart Poettering
857ddc2e55
core: serialize API bus id and validate before deserializing bus tracks, plus several other bus util cleanups (#35970)
Follow-up for #35406
2025-01-14 14:39:58 +01:00
Lennart Poettering
4ba24c46b3
sysusers: some tweaks, mostly around chase() use (#35976) 2025-01-14 14:38:32 +01:00
Lennart Poettering
255468d7f2 update TODO 2025-01-14 13:59:54 +01:00
Daan De Meyer
603a3a8f22
Update packaging specs (#35980) 2025-01-14 12:24:49 +01:00
Daan De Meyer
3c2fa8e050 fmf: Only move logs if corresponding directory exists
Otherwise find fails with an error.
2025-01-14 12:07:53 +01:00
Daan De Meyer
6309efbf31 dissect: Use COPY_MERGE
When copying a directory from or to an image, let's always merge
with existing directories instead of failing with "File Exists".

Fixes https://github.com/systemd/mkosi/issues/3342.
2025-01-14 11:13:25 +01:00
Daan De Meyer
9876c27390 mkosi: update fedora commit reference
* fd36e4c562 Rebuilt for the bin-sbin merge (2nd attempt)
* cddeca136f Rebuilt for the bin-sbin merge (2nd attempt)
* 20cc578e59 Enable signing systemd-boot on OBS builds
* b1bd57ecce Revert use of PrivateTmp=disconnected
* 30f50b1870 Drop patch numbers
* 1814bfe794 remove STI test
* 3a9c32b8a9 Version 257.2
* 4df2711a9f Add bcond for OBS-specific quirks
* e570cd53df spec: drop trailing whitespace
* c7379c9460 Replace 'udevadm hwdb' with systemd-hwdb
* 3386f5d704 Rename source .abignore file
* fd860fd12d Drop a build dependency on a linter package: pytest-flakes
* 133ae30e33 Drop patches based on %upstream macro instead of patch number
* e157552c6c Always build in release mode
* fc47a92e4a Re-enable upstream behaviour of systemd-tmpfiles --purge
* 62abb21906 Version 257.1
* 35e6814ef4 Add patch for test-time-util
* bd8339bf00 sysusers: support new ! line flag for creating fully locked accounts
* c2f5f4a68a Version 257
* 31aaef8e17 Enable slow tests during build
2025-01-14 11:05:02 +01:00
Daan De Meyer
55455280da mkosi: update arch commit reference
* 8160e63e52 Limit logic required for building locally
* 3a62443e41 OBS build: add support for xz and zst compression formats
* 9667464ad7 Get rid of _tag variable
* 73dc492b5e upgpkg: 257.2-2: rebuild with changes for service restart
* 6b7355b5bb do not restart any templated units
* 332718f955 exclude vmspawn units from restart as well
* 5a749a6716 exclude systemd-nspawn@* services from restart
* 8a10796f8b upgpkg: 257.2-1: new upstream release
* 16294a0b44 Add support for building from git in OBS
* 38b664eed4 upgpkg: 257.1-1: new upstream release
* e26158dda9 upgpkg: 257-1: new upstream release
* c984b75c3f restart services after upgrade...
* 27fae2c192 upgpkg: 256.9-1: new upstream release
* 1afdd08a60 upgpkg: 256.8-2: apply: shutdown: close DM block device before issuing DM_DEV_REMOVE ioctl
2025-01-14 11:05:02 +01:00
Daan De Meyer
6e5fb09d1c ci: Skip coverage workflow on forks
Fixes #35964
2025-01-14 11:04:05 +01:00
Lennart Poettering
5e35b6a5f7 lsm: improve logging about absence of lsm-bpf
In containers securityfs is typically not mounted. Our lsm-bpf code
so far detected this situation and claimed the kernel was lacking
lsm-bpf support. Which isn't quite true though, it might very well
support it. This made boots of systemd in systemd-nspawn a bit ugly,
because of the misleading log message at boot.

Let's improve things, and make clearer what is going on.
2025-01-14 09:53:56 +00:00
Daan De Meyer
1d77ac19cf test: Only move journal file if we didn't just unlink it 2025-01-14 10:21:45 +01:00
Mike Yuan
34f4b817f6
core/manager: restore bus track deserialization cleanup in manager_reload()
There's zero explanation why it got (spuriously) removed in
8402ca04d1a063c3d8a9e3d5c16df8bb8778ae98...
2025-01-13 23:08:35 +01:00
Aman Verma
9b10bc107f update-done: remove spurious trailing whitespace from MESSAGE. 2025-01-13 22:54:42 +01:00
Mike Yuan
1446e3c392
core: serialize API bus id and validate before deserializing bus tracks 2025-01-13 21:52:19 +01:00
Mike Yuan
a9a8d2e12f
bus-util: introduce bus_get_instance_id() 2025-01-13 21:52:19 +01:00
Mike Yuan
af0e10354e
core/manager: drop duplicate bus track deserialization
bus_init_api() now does this internally
(after 8402ca04d1a063c3d8a9e3d5c16df8bb8778ae98).
2025-01-13 21:52:19 +01:00
Mike Yuan
a7516260b3
core/manager: use FOREACH_ARRAY at one more place 2025-01-13 21:52:19 +01:00
Mike Yuan
33eeea4128
bus-util: do not reset the count returned by sd_bus_track_count_name()
Follow-up for 8402ca04d1a063c3d8a9e3d5c16df8bb8778ae98

While at it, turn the retval check for sd_bus_track_count_name()
into assertion, given we're working with already established tracks
(service_name_is_valid() should never yield false in this case).

Addresses https://github.com/systemd/systemd/pull/35406#discussion_r1912066774
2025-01-13 21:52:18 +01:00
Mike Yuan
38a2c2bf6a
shared/serialize: introduce serialize_id128() 2025-01-13 21:52:13 +01:00
Mike Yuan
3f03d39ca3
shared/serialize: make input params const 2025-01-13 16:56:08 +01:00
Mike Yuan
91080bc973
shared/bus-util: move string set append/get funcs to bus-message-util and bus-get-properties, respectively 2025-01-13 16:55:42 +01:00
Mike Yuan
e3d37628aa
shared/bus-util: move bus_message_hash_ops to bus-message-util 2025-01-13 16:24:44 +01:00
Mike Yuan
ab33edb05b
shared/bus-util: move bus_message_read_id128() to bus-message-util 2025-01-13 16:24:44 +01:00
Lennart Poettering
3d6f14d327 tmpfiles: move two commands to the right --help sections 2025-01-13 15:05:41 +01:00
Lennart Poettering
0fd2c1fa59 sysusers: use chase_and_stat() where appropriate 2025-01-13 11:46:56 +01:00
Lennart Poettering
48b176cb2d sysusers: add missing assert() 2025-01-13 11:46:56 +01:00
Lennart Poettering
ca7d68f7f0 sysusers: modernize loading of user/group databases
Let's use chase(), and let's allocate sets/hashmaps on-the-fly.
2025-01-13 11:46:56 +01:00
Lennart Poettering
1696bc55f9 sysusers: rework --help to do sections, and ANSI highlighting 2025-01-13 11:46:56 +01:00
Daan De Meyer
79ac78e368 test: Fix bug in integration test wrapper 2025-01-13 11:06:37 +01:00
Lennart Poettering
361327e929
convert more code to PidRef (#35895) 2025-01-11 23:14:33 +01:00
Mike Yuan
95a5c658a3
namespace-util: use pidref_namespace_open_by_type() where appropriate
Several logs are dropped, since all callers log loudly already.
2025-01-11 16:06:38 +01:00
Mike Yuan
a0e3dbdef5
uid-range: make uid_map_search_root() take UIDRangeUsernsMode 2025-01-11 15:53:15 +01:00
Mike Yuan
8c2c8235a6
namespace-util: introduce userns_enter_and_pin() helper
which generalizes forking a process into userns and freeze()

Addresses https://github.com/systemd/systemd/pull/35833/files#r1905508153
2025-01-11 15:53:14 +01:00
Mike Yuan
c7704ecd04
namespace-util: group userns functions together 2025-01-11 15:53:14 +01:00
Mike Yuan
1a669ea7e1
README: document kernel version for idmapped mounts 2025-01-11 15:53:14 +01:00