1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-02 12:58:35 +03:00

78681 Commits

Author SHA1 Message Date
Luca Boccassi
8c5b359579 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
2025-01-10 22:51:46 +00:00
Lennart Poettering
97ac59f18d
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
2025-01-10 22:12:22 +01:00
Daan De Meyer
beca4655dd
Test improvements (#35955) 2025-01-10 21:30:58 +01:00
Daan De Meyer
e0c2fd6a33 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.
2025-01-10 16:14:01 +01:00
Daan De Meyer
53546c71fe 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.
2025-01-10 16:14:01 +01:00
Daan De Meyer
c32a8cdaa0 fmf: Bump inotify limits to avoid systemd-nspawn failures 2025-01-10 16:14:01 +01:00
Daan De Meyer
1f17ec0ed4 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.
2025-01-10 16:14:01 +01:00
Daan De Meyer
84b30442d2 test: Don't register machines with machined unless we're in interactive mode 2025-01-10 16:14:01 +01:00
Daan De Meyer
e49fdecd16 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.
2025-01-10 16:13:58 +01:00
Lennart Poettering
d4ed594a1a
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".
2025-01-10 15:40:48 +01:00
Lennart Poettering
5e4e1b323e
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.
2025-01-10 15:04:10 +01:00
Lennart Poettering
ed70124b2c test-varlink: add superficial test that validates varlink/errno translation both ways 2025-01-10 14:05:29 +01:00
Lennart Poettering
f249cc7618 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.
2025-01-10 14:05:29 +01:00
Lennart Poettering
14533598bd 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.
2025-01-10 14:03:21 +01:00
Lennart Poettering
a551f584e2 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.
2025-01-10 13:59:56 +01:00
Lennart Poettering
19cd2b6d20 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.
2025-01-10 13:59:56 +01:00
Lennart Poettering
fa8b70f2c8
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.
2025-01-10 13:49:11 +01:00
Ivan Kruglov
d423f231f7 machine: VARLINK_ERROR_MACHINE_IMAGE_* defines 2025-01-10 11:49:49 +01:00
Ivan Kruglov
c85e837744 machine: VARLINK_ERROR_MACHINE_* defines 2025-01-10 11:49:49 +01:00
Ivan Kruglov
6b77efe47e machine: fix logging of errno in machine_open_root_directory() 2025-01-10 11:49:49 +01:00
Ivan Kruglov
03b89cf213 basic: fixes in read_errno()
follow ups for https://github.com/systemd/systemd/pull/35880
2025-01-10 11:49:49 +01:00
Lennart Poettering
7893362508 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
2025-01-10 16:10:31 +09:00
Lennart Poettering
a71731bd2e repart: modernize set_gpt_flags() 2025-01-10 16:08:07 +09:00
Luca Boccassi
8442ac9c02 meson: add install tags for udev and hwdb
Allows building and installing them individually, like
other existing components
2025-01-10 15:15:13 +09:00
Daan De Meyer
96403d5121 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.
2025-01-10 14:58:56 +09:00
Yu Watanabe
ac27ee5fcb
fmf: Move meson logs and failed test journals to test artifacts dir (#35939) 2025-01-10 14:57:57 +09:00
Daan De Meyer
8965d57f4b 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.
2025-01-09 15:45:41 +01:00
Daan De Meyer
6e761c5a93 fmf: Log clock source 2025-01-09 15:24:51 +01:00
Daan De Meyer
0e444c948e fmf: Move meson logs and failed test journals to test artifacts dir 2025-01-09 15:13:18 +01:00
Lennart Poettering
46f881e321 update TODO 2025-01-09 14:40:17 +01:00
Lennart Poettering
0ae98d2f23 update TODO 2025-01-09 14:36:37 +01:00
Lennart Poettering
d8113a2863
Stash the subscriber list when we disconenct from the bus (#35406)
If we unexpectly disconnect from the bus, systemd would end up dropping
the list of subscribers, which breaks the ability of clients like logind
to monitor the state of units.

Stash the list of subscribers into the deserialized state in the event
of a disconnect so that when we recover we can renew the broken
subscriptions.

---

Fixes: #8672 #26744
2025-01-09 14:34:55 +01:00
Lennart Poettering
c0041cd8f1
pam: add session class "none" to disable logind sessions (#35171)
pam_systemd is used to create logind sessions and to apply extended
attributes from json user records. Not every application that creates a
pam session expects a login scope, but may be interested in the extended
attributes of json user records. Session class "none" implements this
service by disabling logind for this session altogether.

---

Closes: #34988
2025-01-09 14:08:06 +01:00
Daan De Meyer
606034cc1e
machine: introduce io.systemd.Machine.OpenRootDirectory method (#35880)
This PR introduces io.systemd.Machine.OpenRootDirectory method which is
DBus's alternative to OpenMachineRootDirectory.
2025-01-09 13:06:38 +01:00
Daan De Meyer
103e92810a mkosi: Re-enable TEST-21-DFUZZER when running with sanitizers
Similar to how CentOS CI did it previously, let's only run
TEST-21-DFUZZER when built with sanitizers for maximum effect.
2025-01-09 11:48:23 +00:00
Daan De Meyer
c286e8b616
Two integration test fixes (#35937) 2025-01-09 12:25:41 +01:00
Daan De Meyer
67a91b183b
TEST-06-SELINUX: Add knob to allow checking for AVCs (#35921)
When running the integration tests downstream, it's useful to be able to
test that a new systemd version doesn't introduce any AVC denials, so
let's add a knob to make that possible.
2025-01-09 11:59:58 +01:00
Daan De Meyer
e1c883bf32 fmf: Force SELinux relabel when running within testing farm
We expect to run as root within testing farm and to have permissions
to do selinux relabelling so let's enable it explicitly.
2025-01-09 11:59:34 +01:00
Daan De Meyer
de19520ec9 TEST-06-SELINUX: Add knob to allow checking for AVCs
When running the integration tests downstream, it's useful to be
able to test that a new systemd version doesn't introduce any AVC
denials, so let's add a knob to make that possible.
2025-01-09 11:59:30 +01:00
Daan De Meyer
794d456cf4 test: Only plug in integration-test-setup.sh in interactive mode
If we're not running interactively, there's no point in the features
from integration-test-setup.sh which are intended for interactive
development and debugging so lets skip adding it in that case.
2025-01-09 11:28:15 +01:00
Daan De Meyer
90538ede55 test: Drop set -x from integration-test-setup.sh 2025-01-09 11:27:51 +01:00
Ivan Kruglov
04bf637e25 machine: set SD_VARLINK_SERVER_ALLOW_FD_PASSING_OUTPUT for varlink server 2025-01-09 10:51:18 +01:00
Ivan Kruglov
3ddd3adfcd machine: tests for io.systemd.Machine.OpenRootDirectory 2025-01-09 10:51:18 +01:00
Ivan Kruglov
8633bf5836 machine: introduce io.systemd.Machine.OpenRootDirectory 2025-01-09 10:51:18 +01:00
Ivan Kruglov
307458a6f4 machine: use machine_open_root_directory() in dbus 2025-01-09 10:51:18 +01:00
Ivan Kruglov
65275cfbe5 machine: machine_open_root_directory() 2025-01-09 10:51:18 +01:00
Ivan Kruglov
64db44f7fb process-util: read_errno() 2025-01-09 10:47:24 +01:00
Yu Watanabe
b3d75a3b8a hostname: use sd_device to acquire fallback chassis
This makes
- also cache sd_device for ACPI device.
- split fallback_chassis() into small pieces,
- use sd_device to reading sysfs attributes.

No functional change, just refactoring.
2025-01-09 09:57:34 +01:00
Yu Watanabe
cdd53cb74b sd-device: make sd_device_new_from_path() accept relative path to device node
Even though udevadm accepts relative syspath, previously, udevadm
could not use relative path to device node:
===
$ cd /dev
$ udevadm info sda
Bad argument "sda", expected an absolute path in /dev/ or /sys/ or a unit name: Invalid argument
$ udevadm info /usr/../dev/sda
Unknown device "/usr/../dev/sda": No such device
===
With this change, both the above cases work fine.

Note, still sd_device_new_from_devname() requires absolute path starts
with /dev/, for safety.
2025-01-09 09:57:19 +01:00
Daan De Meyer
b8582198ca fmf: Use different heuristic for number of process with many CPUs
Downstream we sometimes end up with machines with lots of CPUs which
leads to running out of memory when trying to run the tests in VMs.
So let's switch to a different heuristic when we have lots of CPUs to
avoid running out of memory.
2025-01-09 09:15:18 +01:00