]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
9 months agopam-systemd: talk to logind via varlink 35264/head
Lennart Poettering [Mon, 18 Nov 2024 10:25:20 +0000 (11:25 +0100)] 
pam-systemd: talk to logind via varlink

This makes sure we now use Varlink per default as transport for
allocating sessions.

This reduces the time it takes to do one run0 cycle by roughly ~10% on my
completely synthetic test setup (assuming the target user's service
manager is already started)

The D-Bus codepaths are kept in place for two reasons:
* To make upgrades easy
* If the user actually sets resource properties on the PAM session we
  fall back to the D-Bus codepaths, as we currently have no way to
  encode the scope properties in JSON, this is only supported for D-Bus
  serialization.

The latter should be revisited once it is possible to allocate a scope
unit from PID1 via varlink.

9 months agologind: add basic Varlink API
Lennart Poettering [Tue, 19 Nov 2024 21:21:47 +0000 (22:21 +0100)] 
logind: add basic Varlink API

For now this only covers CreateSession() and ReleaseSession(), i.e. the
two operations pam_systemd cares about.

9 months agotest: Drop sandbox() from integration test wrapper (#36009)
Daan De Meyer [Wed, 15 Jan 2025 10:32:34 +0000 (11:32 +0100)] 
test: Drop sandbox() from integration test wrapper (#36009)

With the latest changes, this is not required anymore as mkosi sandbox
will set up the proper $PATH to make sure the executables from the build
directory are used.

9 months agoudev: several trivial fixlets (#36005)
Daan De Meyer [Wed, 15 Jan 2025 09:50:11 +0000 (10:50 +0100)] 
udev: several trivial fixlets (#36005)

split out of #35968.

9 months agomeson: add udev/hwdb build aliases
Luca Boccassi [Tue, 14 Jan 2025 23:22:04 +0000 (23:22 +0000)] 
meson: add udev/hwdb build aliases

Allows to do:

meson compile libudev udev hwdb
meson install --no-rebuild --tags libudev,udev,hwdb

9 months agoterminal-util: drop support for pre-TIOCGPTPEER kernels
Lennart Poettering [Tue, 14 Jan 2025 11:05:05 +0000 (12:05 +0100)] 
terminal-util: drop support for pre-TIOCGPTPEER kernels

Our minimum baseline is now far beyond 4.13, hence let's drop these
fallback paths.

9 months agoupdate TODO
Lennart Poettering [Wed, 15 Jan 2025 09:37:11 +0000 (10:37 +0100)] 
update TODO

9 months agosysusers: emit audit events for user and group creation (#35957)
Zbigniew Jędrzejewski-Szmek [Wed, 15 Jan 2025 09:36:07 +0000 (10:36 +0100)] 
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.

9 months agocore: use shared audit-fd wrappers 35957/head
Zbigniew Jędrzejewski-Szmek [Tue, 14 Jan 2025 14:45:07 +0000 (15:45 +0100)] 
core: use shared audit-fd wrappers

Two funcs are renamed to avoid naming conflict with the common
helper.

9 months agosysusers: emit audit events for user and group creation
Zbigniew Jędrzejewski-Szmek [Fri, 10 Jan 2025 14:35:13 +0000 (15:35 +0100)] 
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.

9 months agotest: Drop sandbox() from integration test wrapper 36009/head
Daan De Meyer [Wed, 15 Jan 2025 09:21:33 +0000 (10:21 +0100)] 
test: Drop sandbox() from integration test wrapper

With the latest changes, this is not required anymore as mkosi sandbox
will set up the proper $PATH to make sure the executables from the build
directory are used.

9 months agomkosi: Update to latest
Daan De Meyer [Wed, 15 Jan 2025 09:21:12 +0000 (10:21 +0100)] 
mkosi: Update to latest

9 months agoFollow-ups for recent namespace PRs (#35923)
Yu Watanabe [Wed, 15 Jan 2025 05:10:21 +0000 (14:10 +0900)] 
Follow-ups for recent namespace PRs (#35923)

9 months agoconfidential-virt: add detection for aarch64 CCA
Jeremy Linton [Fri, 10 Jan 2025 03:24:07 +0000 (21:24 -0600)] 
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>
9 months agoudev-rules: do not change maximum log level when running in test mode 36005/head
Yu Watanabe [Fri, 10 Jan 2025 21:07:55 +0000 (06:07 +0900)] 
udev-rules: do not change maximum log level when running in test mode

When udev rules are being tested, log level specified by SYSTEMD_LOG_LEVEL=
environment variable should be honored, and should not be overridden by
the rules.

9 months agoudev-rules: replace 'type *func()' -> 'type* func()'
Yu Watanabe [Fri, 10 Jan 2025 18:57:34 +0000 (03:57 +0900)] 
udev-rules: replace 'type *func()' -> 'type* func()'

9 months agoudevadm-test: add missing oom check
Yu Watanabe [Fri, 10 Jan 2025 20:27:44 +0000 (05:27 +0900)] 
udevadm-test: add missing oom check

9 months agoupdate TODO
Lennart Poettering [Tue, 14 Jan 2025 23:16:14 +0000 (00:16 +0100)] 
update TODO

9 months agoman: Clarify systemd-notify and sd_notify() PID documentation
Daan De Meyer [Tue, 14 Jan 2025 15:05:33 +0000 (16:05 +0100)] 
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.

9 months agomkosi: Install libxslt on CentOS/Fedora instead of xsltproc
Daan De Meyer [Tue, 14 Jan 2025 12:53:26 +0000 (13:53 +0100)] 
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.

9 months agoNEWS: mention mesg y/n
Lennart Poettering [Tue, 14 Jan 2025 09:03:24 +0000 (10:03 +0100)] 
NEWS: mention mesg y/n

9 months agodocs: fix markup (#35995)
Silvio Knizek [Tue, 14 Jan 2025 14:19:56 +0000 (15:19 +0100)] 
docs: fix markup (#35995)

9 months agooomd: support reloading configuration at runtime
Sea-Eun Lee [Mon, 18 Nov 2024 19:13:40 +0000 (19:13 +0000)] 
oomd: support reloading configuration at runtime

9 months agocore: serialize API bus id and validate before deserializing bus tracks, plus several...
Lennart Poettering [Tue, 14 Jan 2025 13:39:58 +0000 (14:39 +0100)] 
core: serialize API bus id and validate before deserializing bus tracks, plus several other bus util cleanups (#35970)

Follow-up for #35406

9 months agosysusers: some tweaks, mostly around chase() use (#35976)
Lennart Poettering [Tue, 14 Jan 2025 13:38:32 +0000 (14:38 +0100)] 
sysusers: some tweaks, mostly around chase() use (#35976)

9 months agoupdate TODO
Lennart Poettering [Tue, 14 Jan 2025 12:55:46 +0000 (13:55 +0100)] 
update TODO

9 months agoUpdate packaging specs (#35980)
Daan De Meyer [Tue, 14 Jan 2025 11:24:49 +0000 (12:24 +0100)] 
Update packaging specs (#35980)

9 months agofmf: Only move logs if corresponding directory exists
Daan De Meyer [Tue, 14 Jan 2025 10:41:17 +0000 (11:41 +0100)] 
fmf: Only move logs if corresponding directory exists

Otherwise find fails with an error.

9 months agodissect: Use COPY_MERGE
Daan De Meyer [Fri, 10 Jan 2025 14:53:59 +0000 (15:53 +0100)] 
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.

9 months agomkosi: update fedora commit reference 35980/head
Daan De Meyer [Mon, 13 Jan 2025 15:18:33 +0000 (16:18 +0100)] 
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

9 months agomkosi: update arch commit reference
Daan De Meyer [Mon, 13 Jan 2025 15:11:07 +0000 (16:11 +0100)] 
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

9 months agoci: Skip coverage workflow on forks
Daan De Meyer [Sat, 11 Jan 2025 09:52:26 +0000 (10:52 +0100)] 
ci: Skip coverage workflow on forks

Fixes #35964

9 months agolsm: improve logging about absence of lsm-bpf
Lennart Poettering [Mon, 13 Jan 2025 21:48:26 +0000 (22:48 +0100)] 
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.

9 months agotest: Only move journal file if we didn't just unlink it
Daan De Meyer [Tue, 14 Jan 2025 08:52:40 +0000 (09:52 +0100)] 
test: Only move journal file if we didn't just unlink it

9 months agocore/manager: restore bus track deserialization cleanup in manager_reload() 35970/head
Mike Yuan [Mon, 13 Jan 2025 16:30:51 +0000 (17:30 +0100)] 
core/manager: restore bus track deserialization cleanup in manager_reload()

There's zero explanation why it got (spuriously) removed in
8402ca04d1a063c3d8a9e3d5c16df8bb8778ae98...

9 months agoupdate-done: remove spurious trailing whitespace from MESSAGE.
Aman Verma [Mon, 13 Jan 2025 18:03:58 +0000 (12:03 -0600)] 
update-done: remove spurious trailing whitespace from MESSAGE.

9 months agocore: serialize API bus id and validate before deserializing bus tracks
Mike Yuan [Mon, 13 Jan 2025 16:06:35 +0000 (17:06 +0100)] 
core: serialize API bus id and validate before deserializing bus tracks

9 months agobus-util: introduce bus_get_instance_id()
Mike Yuan [Mon, 13 Jan 2025 15:42:34 +0000 (16:42 +0100)] 
bus-util: introduce bus_get_instance_id()

9 months agocore/manager: drop duplicate bus track deserialization
Mike Yuan [Sat, 11 Jan 2025 17:38:49 +0000 (18:38 +0100)] 
core/manager: drop duplicate bus track deserialization

bus_init_api() now does this internally
(after 8402ca04d1a063c3d8a9e3d5c16df8bb8778ae98).

9 months agocore/manager: use FOREACH_ARRAY at one more place
Mike Yuan [Mon, 13 Jan 2025 16:06:21 +0000 (17:06 +0100)] 
core/manager: use FOREACH_ARRAY at one more place

9 months agobus-util: do not reset the count returned by sd_bus_track_count_name()
Mike Yuan [Sat, 11 Jan 2025 15:26:55 +0000 (16:26 +0100)] 
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

9 months agoshared/serialize: introduce serialize_id128()
Mike Yuan [Mon, 13 Jan 2025 15:35:58 +0000 (16:35 +0100)] 
shared/serialize: introduce serialize_id128()

9 months agoshared/serialize: make input params const
Mike Yuan [Mon, 13 Jan 2025 15:35:13 +0000 (16:35 +0100)] 
shared/serialize: make input params const

9 months agoshared/bus-util: move string set append/get funcs to bus-message-util and bus-get...
Mike Yuan [Sat, 11 Jan 2025 17:04:37 +0000 (18:04 +0100)] 
shared/bus-util: move string set append/get funcs to bus-message-util and bus-get-properties, respectively

9 months agoshared/bus-util: move bus_message_hash_ops to bus-message-util
Mike Yuan [Sat, 11 Jan 2025 16:10:43 +0000 (17:10 +0100)] 
shared/bus-util: move bus_message_hash_ops to bus-message-util

9 months agoshared/bus-util: move bus_message_read_id128() to bus-message-util
Mike Yuan [Sat, 11 Jan 2025 15:52:05 +0000 (16:52 +0100)] 
shared/bus-util: move bus_message_read_id128() to bus-message-util

9 months agotmpfiles: move two commands to the right --help sections
Lennart Poettering [Fri, 10 Jan 2025 22:45:07 +0000 (23:45 +0100)] 
tmpfiles: move two commands to the right --help sections

9 months agosysusers: use chase_and_stat() where appropriate 35976/head
Lennart Poettering [Fri, 10 Jan 2025 22:50:41 +0000 (23:50 +0100)] 
sysusers: use chase_and_stat() where appropriate

9 months agosysusers: add missing assert()
Lennart Poettering [Fri, 10 Jan 2025 22:50:10 +0000 (23:50 +0100)] 
sysusers: add missing assert()

9 months agosysusers: modernize loading of user/group databases
Lennart Poettering [Fri, 10 Jan 2025 22:48:53 +0000 (23:48 +0100)] 
sysusers: modernize loading of user/group databases

Let's use chase(), and let's allocate sets/hashmaps on-the-fly.

9 months agosysusers: rework --help to do sections, and ANSI highlighting
Lennart Poettering [Fri, 10 Jan 2025 22:45:43 +0000 (23:45 +0100)] 
sysusers: rework --help to do sections, and ANSI highlighting

9 months agotest: Fix bug in integration test wrapper
Daan De Meyer [Mon, 13 Jan 2025 09:33:20 +0000 (10:33 +0100)] 
test: Fix bug in integration test wrapper

9 months agoconvert more code to PidRef (#35895)
Lennart Poettering [Sat, 11 Jan 2025 22:14:33 +0000 (23:14 +0100)] 
convert more code to PidRef (#35895)

9 months agonamespace-util: use pidref_namespace_open_by_type() where appropriate 35923/head
Mike Yuan [Wed, 8 Jan 2025 13:02:28 +0000 (14:02 +0100)] 
namespace-util: use pidref_namespace_open_by_type() where appropriate

Several logs are dropped, since all callers log loudly already.

9 months agouid-range: make uid_map_search_root() take UIDRangeUsernsMode
Mike Yuan [Wed, 8 Jan 2025 11:44:33 +0000 (12:44 +0100)] 
uid-range: make uid_map_search_root() take UIDRangeUsernsMode

9 months agonamespace-util: introduce userns_enter_and_pin() helper
Mike Yuan [Wed, 8 Jan 2025 11:43:05 +0000 (12:43 +0100)] 
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

9 months agonamespace-util: group userns functions together
Mike Yuan [Sat, 11 Jan 2025 14:42:15 +0000 (15:42 +0100)] 
namespace-util: group userns functions together

9 months agoREADME: document kernel version for idmapped mounts
Mike Yuan [Sat, 11 Jan 2025 14:41:55 +0000 (15:41 +0100)] 
README: document kernel version for idmapped mounts

9 months agobasic: move nsfs ioctls from missing_fs to missing_namespace
Mike Yuan [Wed, 8 Jan 2025 11:25:04 +0000 (12:25 +0100)] 
basic: move nsfs ioctls from missing_fs to missing_namespace

Addresses https://github.com/systemd/systemd/pull/35833#discussion_r1905333757

9 months agoprocess-util: drop duplicate assertions
Mike Yuan [Wed, 8 Jan 2025 12:50:51 +0000 (13:50 +0100)] 
process-util: drop duplicate assertions

9 months agoExtend elf package metadata to pe/coff files (#35681)
Zbigniew Jędrzejewski-Szmek [Sat, 11 Jan 2025 12:12:39 +0000 (13:12 +0100)] 
Extend elf package metadata to pe/coff files (#35681)

9 months agoREADME: add OBS status icon and link to instructions to add bleeding edge repo
Luca Boccassi [Sat, 11 Jan 2025 00:53:49 +0000 (00:53 +0000)] 
README: add OBS status icon and link to instructions to add bleeding edge repo

9 months agohomectl: fix minor spelling mistake (#35963)
Eaterminer [Sat, 11 Jan 2025 05:17:05 +0000 (18:17 +1300)] 
homectl: fix minor spelling mistake (#35963)

9 months agostub: drop PE sections parsing cap
Luca Boccassi [Fri, 10 Jan 2025 21:02:55 +0000 (21:02 +0000)] 
stub: drop PE sections parsing cap

This was added originally as it was thought that Windows applied
the same cap. Nowadays the specs do not mention it, and it is
believed Windows no longer applies it either, so drop it in order
to allow an arbitrary number of DTBs to be included

Fixes https://github.com/systemd/systemd/issues/35943

9 months agomachine: follow ups for varlink PRs recently merged (#35940)
Lennart Poettering [Fri, 10 Jan 2025 21:12:22 +0000 (22:12 +0100)] 
machine: follow ups for varlink PRs recently merged (#35940)

Follow ups for:
- https://github.com/systemd/systemd/pull/35880
- https://github.com/systemd/systemd/pull/35066

9 months agoTest improvements (#35955)
Daan De Meyer [Fri, 10 Jan 2025 20:30:58 +0000 (21:30 +0100)] 
Test improvements (#35955)

9 months agofmf: Skip TEST-21-DFUZZER 35955/head
Daan De Meyer [Fri, 10 Jan 2025 14:29:28 +0000 (15:29 +0100)] 
fmf: Skip TEST-21-DFUZZER

Similar to Github Actions, since we don't build with sanitizers in
the packit job, let's skip TEST-21-DFUZZER.

9 months agofmf: Use different heuristic on beefy systems
Daan De Meyer [Fri, 10 Jan 2025 14:26:54 +0000 (15:26 +0100)] 
fmf: Use different heuristic on beefy systems

If we save journals in /tmp, we can run a larger number of tests in
parallel so let's make use of the larger number of CPUs if the tests
run on a beefy machine.

9 months agofmf: Bump inotify limits to avoid systemd-nspawn failures
Daan De Meyer [Fri, 10 Jan 2025 14:26:37 +0000 (15:26 +0100)] 
fmf: Bump inotify limits to avoid systemd-nspawn failures

9 months agotest: Move StateDirectory= directive into dropin
Daan De Meyer [Fri, 10 Jan 2025 13:51:24 +0000 (14:51 +0100)] 
test: Move StateDirectory= directive into dropin

The integration-test-setup calls require StateDirectory= but some
tests override the test unit used which then won't have StateDirectory=
so let's move StateDirectory= into the dropin as well to avoid this
issue.

9 months agotest: Don't register machines with machined unless we're in interactive mode
Daan De Meyer [Fri, 10 Jan 2025 13:29:58 +0000 (14:29 +0100)] 
test: Don't register machines with machined unless we're in interactive mode

9 months agotest: Add option to save in progress test journals to /tmp
Daan De Meyer [Fri, 10 Jan 2025 13:27:33 +0000 (14:27 +0100)] 
test: Add option to save in progress test journals to /tmp

The journal isn't the best at being fast, especially when writing
to disk and not to memory, which can cause integration tests to
grind to a halt on beefy systems due to all the systemd-journal-remote
instances not being able to write journal entries to disk fast enough.

Let's introduce an option to allow writing in progress test journals
to use /tmp which can be used on beefy systems with lots of memory to
speed things up.

9 months agovarlink: send linux errno name along with errno number in generic system error replie...
Lennart Poettering [Fri, 10 Jan 2025 14:40:48 +0000 (15:40 +0100)] 
varlink: send linux errno name along with errno number in generic system error replies (#35912)

Let's make things a bit less Linux specific, and more debuggable, by
including not just the error number but also the error name in the
generic io.systemd.System errors we generate when all we have is an
"errno".

9 months agopam_systemd: two refactorings (#35924)
Lennart Poettering [Fri, 10 Jan 2025 14:04:10 +0000 (15:04 +0100)] 
pam_systemd: two refactorings (#35924)

This is prepartion (and split out of) for #35264. The refactors make a
ton of sense on their own however, too I htink.

9 months agonamespace-util: port namespace_get_leader() to PidRef 35895/head
Lennart Poettering [Tue, 7 Jan 2025 08:54:15 +0000 (09:54 +0100)] 
namespace-util: port namespace_get_leader() to PidRef

9 months agoprocess-util: make pidref_safe_fork_full() work with FORK_WAIT
Lennart Poettering [Wed, 8 Jan 2025 09:50:06 +0000 (10:50 +0100)] 
process-util: make pidref_safe_fork_full() work with FORK_WAIT

(This is useful for the test case added in the next commit, where it's
kinda nice being able to use pidref_safe_fork_full() and acquiring a
pidref of the child in the child in one go. There's no other value in
this than a bit of synctactic sugar for that test. But otoh thre's no
good reason to prohibit FORK_WAIT use like this, hence either way, this
commit should be a good thing.)

9 months agocoredump: port to pidref_namespace_open()
Lennart Poettering [Tue, 7 Jan 2025 09:13:42 +0000 (10:13 +0100)] 
coredump: port to pidref_namespace_open()

9 months agocoredump: acquire further attributes via pidref rather than pid
Lennart Poettering [Tue, 7 Jan 2025 09:12:10 +0000 (10:12 +0100)] 
coredump: acquire further attributes via pidref rather than pid

9 months agoprocess-util: add new helper pidref_get_ppid_as_pidref()
Lennart Poettering [Tue, 7 Jan 2025 08:53:53 +0000 (09:53 +0100)] 
process-util: add new helper pidref_get_ppid_as_pidref()

9 months agotree-wide: port more code to namespace_open_by_type()
Lennart Poettering [Tue, 7 Jan 2025 08:29:27 +0000 (09:29 +0100)] 
tree-wide: port more code to namespace_open_by_type()

9 months agoterminal-util: pidref'ify two terminal related calls
Lennart Poettering [Tue, 7 Jan 2025 08:28:57 +0000 (09:28 +0100)] 
terminal-util: pidref'ify two terminal related calls

9 months agotest-varlink: add superficial test that validates varlink/errno translation both... 35912/head
Lennart Poettering [Tue, 7 Jan 2025 17:54:39 +0000 (18:54 +0100)] 
test-varlink: add superficial test that validates varlink/errno translation both ways

9 months agovarlink: tweak what we include in "system error" messages
Lennart Poettering [Tue, 7 Jan 2025 17:51:10 +0000 (18:51 +0100)] 
varlink: tweak what we include in "system error" messages

We so far only included the numeric Linux errno. That's pretty Linux
specific however. Hence, let's improve things and include an origin
string, that clearly marks Linux as origin. Also, include the string
name of the error.

Take these two fields into account when translating back, too. So that
we prefer going by symbolic name rather than by numeric id.

9 months agosd-json: make it safe to call sd_json_dispatch_full() with a NULL table
Lennart Poettering [Tue, 7 Jan 2025 13:41:22 +0000 (14:41 +0100)] 
sd-json: make it safe to call sd_json_dispatch_full() with a NULL table

This is useful for generating good errors when dispatching varlink
methods that take no parameters, as we'll still generate precise errors
in that case, taking a NULL table as equivalent as one with no
entries.

9 months agologind: split create session reply handling in two 35924/head
Lennart Poettering [Tue, 19 Nov 2024 22:25:31 +0000 (23:25 +0100)] 
logind: split create session reply handling in two

This prepares ground so that later on we can reply with either D-Bus or
Varlink depending on the client's request.

9 months agologind: rework session creation logic, to be more reusable for varlink codepaths
Lennart Poettering [Tue, 19 Nov 2024 21:16:25 +0000 (22:16 +0100)] 
logind: rework session creation logic, to be more reusable for varlink codepaths

This separates the preparatory checks that generate D-Bus errors from
the code that actually allocates the session. This make the logic easier
to follow and prepares ground so that we can reuse the 2nd part later
when exposing session creation via Varlink.

9 months agouserdb: define new 64K "foreign UID" range (#35932)
Lennart Poettering [Fri, 10 Jan 2025 12:49:11 +0000 (13:49 +0100)] 
userdb: define new 64K "foreign UID" range (#35932)

This is establish the basic concepts for #35685, in the hope to get this
merged first.

This defines a special, fixed 64K UID range that is supposed to be used
by directory container images on disk, that is mapped to a dynamic UID
range at runtime (via idmapped mounts).

This enables a world where each container can run with a dynamic UID
range, but this in no way leaks onto the disk, thus making supposedly
dynamic, transient UID range assignments persistent.

This is infrastructure later used for the primary part of #35685: unpriv
container execution with directory images inside user's home dirs, that
are assigned to this special "foreign UID range".

This PR only defines the ranges, synthesizes NSS records for them via
userdb, and then exposes them in a new "systemd-dissect --shift" command
that can re-chown a container directory tree into this range (and in
fact any range).

This comes with docs. But no tests. There are tests in #35685 that cover
all this, but they are more comprehensive and also test nspawn's hook-up
with this, hence are excluded from this PR.

9 months agomachine: VARLINK_ERROR_MACHINE_IMAGE_* defines 35940/head
Ivan Kruglov [Thu, 9 Jan 2025 14:24:58 +0000 (15:24 +0100)] 
machine: VARLINK_ERROR_MACHINE_IMAGE_* defines

9 months agomachine: VARLINK_ERROR_MACHINE_* defines
Ivan Kruglov [Thu, 9 Jan 2025 14:13:22 +0000 (15:13 +0100)] 
machine: VARLINK_ERROR_MACHINE_* defines

9 months agomachine: fix logging of errno in machine_open_root_directory()
Ivan Kruglov [Fri, 10 Jan 2025 10:48:39 +0000 (11:48 +0100)] 
machine: fix logging of errno in machine_open_root_directory()

9 months agobasic: fixes in read_errno()
Ivan Kruglov [Thu, 9 Jan 2025 14:02:08 +0000 (15:02 +0100)] 
basic: fixes in read_errno()

follow ups for https://github.com/systemd/systemd/pull/35880

9 months agoprocess-util: do not unblock unrelated signals while forking
Lennart Poettering [Thu, 9 Jan 2025 10:15:49 +0000 (11:15 +0100)] 
process-util: do not unblock unrelated signals while forking

This makes sure when we are blocking signals in preparation for fork()
we'll not temporarily unblock any signals previously set, by mistake.

It's safe for us to block more, but not to unblock signals already
blocked. Fix that.

Fixes: #35470
9 months agorepart: modernize set_gpt_flags()
Lennart Poettering [Thu, 9 Jan 2025 10:17:40 +0000 (11:17 +0100)] 
repart: modernize set_gpt_flags()

9 months agomeson: add install tags for udev and hwdb
Luca Boccassi [Thu, 9 Jan 2025 21:37:26 +0000 (21:37 +0000)] 
meson: add install tags for udev and hwdb

Allows building and installing them individually, like
other existing components

9 months agotree-wide: Fix python formatting
Daan De Meyer [Thu, 9 Jan 2025 15:24:22 +0000 (16:24 +0100)] 
tree-wide: Fix python formatting

The new release of ruff formats a few more things which causes linter
failures in CI so let's fix those formatting nits.

9 months agofmf: Move meson logs and failed test journals to test artifacts dir (#35939)
Yu Watanabe [Fri, 10 Jan 2025 05:57:57 +0000 (14:57 +0900)] 
fmf: Move meson logs and failed test journals to test artifacts dir (#35939)

9 months agofmf: Use one fewer than number of available CPUs again 35939/head
Daan De Meyer [Thu, 9 Jan 2025 14:45:41 +0000 (15:45 +0100)] 
fmf: Use one fewer than number of available CPUs again

This effectively reverts b8582198ca1e6fe390f7169e623a9130b68a6b36
as I can not get the testing farm bare metal machines working
downstream and even if I managed to, without also using the testing
farm bare metal machines upstream (for which there is no capacity),
the setup would very quickly bitrot anyway so we'll just run the
container based tests for now.

9 months agofmf: Log clock source
Daan De Meyer [Thu, 9 Jan 2025 14:24:51 +0000 (15:24 +0100)] 
fmf: Log clock source

9 months agofmf: Move meson logs and failed test journals to test artifacts dir
Daan De Meyer [Thu, 9 Jan 2025 14:13:18 +0000 (15:13 +0100)] 
fmf: Move meson logs and failed test journals to test artifacts dir

9 months agoupdate TODO
Lennart Poettering [Thu, 9 Jan 2025 13:40:17 +0000 (14:40 +0100)] 
update TODO