]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
8 months agovirt: detect "linux,dummy-virt" devicetree VMs 36655/head
Lennart Poettering [Fri, 7 Mar 2025 10:57:43 +0000 (11:57 +0100)] 
virt: detect "linux,dummy-virt" devicetree VMs

So apparently "linux,dummy-virt" is a devicetree in popular use by
various hypervisors, including crosvm:

https://github.com/google/crosvm/blob/e5d7a64d377d00b9b96bc026548769ab59cf216b/aarch64/src/fdt.rs#L692

and qemu:

https://github.com/qemu/qemu/blob/98c7362b1efe651327385a25874a73e008c6549e/hw/arm/virt.c#L283

and that's because the kernel ships support for that natively:

https://www.kernel.org/doc/Documentation/devicetree/bindings/arm/linux%2Cdummy-virt.yaml

It's explicitly for using in virtualization. Hence it's suitable for
detecting it as generic fallback.

This hence adds the check, similar to how we already look for one other
qemu-specific devicetree.

I ran into this while playing around with the new Pixel "Linux Terminal"
app from google which runs a Debian in a crosvm apparently. So far
systemd didn't recognize execution in it at all. Let's at least
recognize it as VM at all, even if this doesn't recognize it as
crosvm.

8 months agovirt: some modernizations
Lennart Poettering [Fri, 7 Mar 2025 10:56:33 +0000 (11:56 +0100)] 
virt: some modernizations

Reduce scope of certain allocations, add more debug logging, and improve
some log messages.

8 months agoupdate TODO
Lennart Poettering [Fri, 7 Mar 2025 13:55:38 +0000 (14:55 +0100)] 
update TODO

8 months agopid1: lower log level if BPF LSM is not available
Lennart Poettering [Fri, 7 Mar 2025 09:37:54 +0000 (10:37 +0100)] 
pid1: lower log level if BPF LSM is not available

Currently, if you boot PID 1 in a container you always see a complaint
that BPF LSM won't work. That's fine, and log worthy, but probably not
above debug level. After all this is a really common case, and we should
gracefully adopt to our execution environment.

8 months agoload-fragment: Fix config_parse_namespace_flags() for DelegateNamespaces= (#36633)
Luca Boccassi [Fri, 7 Mar 2025 11:58:13 +0000 (11:58 +0000)] 
load-fragment: Fix config_parse_namespace_flags() for DelegateNamespaces= (#36633)

Boolean values have to be handled separately for RestrictNamespaces=
because
they get stored in a field with reverse meaning (which namespaces are
retained),
so let's check which field we're parsing and set the proper value
accordingly.

8 months agocore: Debug log if we cannot change the controlling terminal
Daan De Meyer [Thu, 6 Mar 2025 19:26:07 +0000 (20:26 +0100)] 
core: Debug log if we cannot change the controlling terminal

8 months agohostnamectl: show image info in hostnamectl (#36638)
Luca Boccassi [Thu, 6 Mar 2025 22:36:20 +0000 (22:36 +0000)] 
hostnamectl: show image info in hostnamectl (#36638)

On image-based systems these properties are quite fundamental, hence
show them in the hostnamed output.

8 months agodissect: accept --usr-hash=… too, similar to --root-hash=…
Lennart Poettering [Thu, 6 Mar 2025 08:30:48 +0000 (09:30 +0100)] 
dissect: accept --usr-hash=… too, similar to --root-hash=…

This addresses an omission, given that we have both kinds of hashes
these days.

8 months agoadd vsock-mux/* in ssh config drop-in
Дамјан Георгиевски [Thu, 6 Mar 2025 20:29:44 +0000 (21:29 +0100)] 
add vsock-mux/* in ssh config drop-in

https://github.com/systemd/systemd/pull/32941
added support for firecracker/cloud-hypervisor and
their unix-domain socket to AF_VSOCK multiplex.

but I forgot to add the pattern in the ssh config drop-in.
fix it now!

8 months agoTEST-13-NSPAWN: Set TERM=dumb when calling machinectl shell
Daan De Meyer [Thu, 6 Mar 2025 16:31:49 +0000 (17:31 +0100)] 
TEST-13-NSPAWN: Set TERM=dumb when calling machinectl shell

We only consider something not a tty if it's not connected to a tty
and not connected to /dev/null, so let's use the environment variable
instead to tell machinectl shell that it shouldn't do any of its TTY
stuff.

8 months agoterminal-util: during terminal reset clear from beginning of line to end of screen
Lennart Poettering [Thu, 6 Mar 2025 15:07:02 +0000 (16:07 +0100)] 
terminal-util: during terminal reset clear from beginning of line to end of screen

tianocore does some weird shit with its terminal emulation and regular
fills half the terminal with grey background and then invokes us with
this not cleared up. Hence let us clear this up for it: as part of the
ansi sequence based reset let's position the cursor explicitly at the
beginning of the current line, and erase everything till the end of the
screen. This makes boot output in tianocore vms much much cleaner.

Note that this does *not* erase any terminal output *before* the cursor
position where we take over, because that typically contains valuable
information still we should not erase.

8 months agoupdate TODO
Lennart Poettering [Thu, 6 Mar 2025 22:11:20 +0000 (23:11 +0100)] 
update TODO

8 months agoupdate TODO
Lennart Poettering [Thu, 6 Mar 2025 17:30:09 +0000 (18:30 +0100)] 
update TODO

8 months agoFactory reset followup (#36621)
Lennart Poettering [Thu, 6 Mar 2025 16:43:04 +0000 (17:43 +0100)] 
Factory reset followup (#36621)

@poettering hrm, there's still one thing unclear to me: we currently
have no way for canceling factory reset via IPC. And adding that to
varlink service solely doesn't seem feasible either, since the state
departs from the active state of `factory-reset.target` and it would
become impossible to re-request it without restarting
`factory-reset.target` _and all dependencies_, which feels
unmaintainable.

8 months agodocs: mention when /var/ has to be writable
Lennart Poettering [Thu, 6 Mar 2025 15:06:35 +0000 (16:06 +0100)] 
docs: mention when /var/ has to be writable

In light of https://github.com/systemd/systemd/issues/36635 let's
clarify things a bit regarding writability of /var/.

8 months agohostnamectl: add usual ansi underlining to --help text 36638/head
Lennart Poettering [Thu, 6 Mar 2025 10:42:11 +0000 (11:42 +0100)] 
hostnamectl: add usual ansi underlining to --help text

8 months agohostnamectl: show image info in hostnamectl
Lennart Poettering [Thu, 6 Mar 2025 11:02:10 +0000 (12:02 +0100)] 
hostnamectl: show image info in hostnamectl

On image-based systems these properties are quite fundamental, hence
show them in the hostnamed output.

8 months agoportable: Set DelegateNamespaces=no for all portable profiles 36633/head
Daan De Meyer [Thu, 6 Mar 2025 13:17:14 +0000 (14:17 +0100)] 
portable: Set DelegateNamespaces=no for all portable profiles

We don't want to delegate any namespaces to portable services, so
let's explicitly set DelegateNamespaces=no in the portable profiles.

8 months agoload-fragment: Fix config_parse_namespace_flags() for DelegateNamespaces=
Daan De Meyer [Thu, 6 Mar 2025 13:15:34 +0000 (14:15 +0100)] 
load-fragment: Fix config_parse_namespace_flags() for DelegateNamespaces=

Boolean values have to be handled separately for RestrictNamespaces= because
they get stored in a field with reverse meaning (which namespaces are retained),
so let's check which field we're parsing and set the proper value accordingly.

8 months agosysext,sysupdate: resolve incompatibilities (#36617)
Lennart Poettering [Thu, 6 Mar 2025 13:05:35 +0000 (14:05 +0100)] 
sysext,sysupdate: resolve incompatibilities (#36617)

Fixes #24562.
Fixes #34445.
Replaces #36311.

8 months agoudev-builtin-blkid: ignore root partitions with name "_empty"
Lennart Poettering [Wed, 5 Mar 2025 15:13:02 +0000 (16:13 +0100)] 
udev-builtin-blkid: ignore root partitions with name "_empty"

This is how sysupdate marks empty partitions, hence ignore that.

Kinda a follow-up for 54ae0edc4aabb6017f6169b1eac5faf0a407d67b

8 months agotree-wide: drop unnecessary break in default branch
Yu Watanabe [Wed, 5 Mar 2025 13:30:48 +0000 (22:30 +0900)] 
tree-wide: drop unnecessary break in default branch

8 months agoupdate TODO
Lennart Poettering [Thu, 6 Mar 2025 10:30:06 +0000 (11:30 +0100)] 
update TODO

8 months agogpt-auto: image policy fixes (#36629)
Lennart Poettering [Thu, 6 Mar 2025 10:27:35 +0000 (11:27 +0100)] 
gpt-auto: image policy fixes (#36629)

Let's make sure we can define a proper image policy on ParticleOS
images.

8 months agosysupdate: don't get confused by sysext on /usr/ 36617/head
Lennart Poettering [Wed, 5 Mar 2025 13:23:17 +0000 (14:23 +0100)] 
sysupdate: don't get confused by sysext on /usr/

Fixes: #24562
8 months agosysext: export backing devnum in metadata dir
Lennart Poettering [Wed, 5 Mar 2025 14:22:45 +0000 (15:22 +0100)] 
sysext: export backing devnum in metadata dir

8 months agosysext: execute merge even if no extensions are installed as long as --mutable= is on
Lennart Poettering [Wed, 5 Mar 2025 13:22:54 +0000 (14:22 +0100)] 
sysext: execute merge even if no extensions are installed as long as --mutable= is on

This way we can make an immutable OS mutable, without any extensions or
so.

Fixes: #34445
8 months agogpt-auto-generator: do not apply image policy on the root fs and /usr/ fs 36629/head
Lennart Poettering [Thu, 6 Mar 2025 08:38:25 +0000 (09:38 +0100)] 
gpt-auto-generator: do not apply image policy on the root fs and /usr/ fs

At the moment the gpt-auto generator does its things we already
transitioned into the host OS, i.e. the root fs and /usr/ are mounted.
Hence suppress image policy checks for those two partitions.

This actually matters, because the root hash/usr hash is taken into
consideration for the image policy checks, but we don't have that in
gpt-auto and hence would refuse operation claiming policy conflicts
event though we never actually operate on the root fs via the dissection
logic.

8 months agogpt-auto-generator: move around in_initrd() tests
Lennart Poettering [Thu, 6 Mar 2025 08:35:59 +0000 (09:35 +0100)] 
gpt-auto-generator: move around in_initrd() tests

The partition enumeration only runs on the main system, and we test that
early, hence no point in repeating this in functions further down the
call chain. But let's keep it in place as assert()s, just in case.

Also, move the top-level in_initrd() into add_mounts(), so that the
tests are nicely encapsulated in the code they protect.

8 months agoimage-policy: add image_policy_ignore_designators() helper
Lennart Poettering [Thu, 6 Mar 2025 08:33:53 +0000 (09:33 +0100)] 
image-policy: add image_policy_ignore_designators() helper

This new helper patches a provide image policy, setting the policy for
specified designators to "ignore".

This is useful for contexts where we only want to mount some subset of
the available partitions, and hence don't care about the parts of the
policy that cover the others. Specifically this is useful in
systemd-gpt-auto-generator, which runs at a moment the root file system
is already established, and hence the policy for the root file system
can be ignored, the facts are already established.

8 months agomkosi: update debian commit reference
Luca Boccassi [Wed, 5 Mar 2025 21:37:13 +0000 (21:37 +0000)] 
mkosi: update debian commit reference

dfdab6b205 Install new files
e00bee5b4a Install new files

8 months agomkosi: update fedora commit reference
Daan De Meyer [Wed, 5 Mar 2025 20:27:17 +0000 (21:27 +0100)] 
mkosi: update fedora commit reference

4ab2a9e539 Drop old self-Obsoletes and provides
ec182495e7 Drop libbpf versioned dependency version to 1.4.7
1f8d2b0ebd Make self-obsoletes for the sysusers split conditional
0d95af264f Include epoch in versioned libbpf dependency
8230f501b6 Make sure we pull in libbpf >= 1.5.0 if libbpf is installed

8 months agomkosi: Don't install dnf anymore on Fedora
Daan De Meyer [Wed, 5 Mar 2025 19:07:59 +0000 (20:07 +0100)] 
mkosi: Don't install dnf anymore on Fedora

We have dnf5 on Fedora, no need to install dnf there anymore

8 months agodissect: show basic image data even when can't enter the file systems
Lennart Poettering [Tue, 28 Jan 2025 15:52:01 +0000 (16:52 +0100)] 
dissect: show basic image data even when can't enter the file systems

8 months agohibernate-resume-config: log louder on invalid kernel version/os-release id 36621/head
Mike Yuan [Wed, 5 Mar 2025 15:25:48 +0000 (16:25 +0100)] 
hibernate-resume-config: log louder on invalid kernel version/os-release id

Prompted by 45623d4ad63243f96614013600167cf080efc353

We do make use of the os-release ids to determine whether to initial resume
if they're present, hence log at warning level if invalid. While at it,
raise the level for the kernel version too, which is generally interesting
to the user if something goes wrong.

8 months agofactory-reset-tool: error out if we can't cancel pending reset
Mike Yuan [Wed, 5 Mar 2025 16:01:04 +0000 (17:01 +0100)] 
factory-reset-tool: error out if we can't cancel pending reset

First of all, it seems very unlikely that we'd be in the pending state
if not booted via EFI in the first place. Moreover, the operation didn't
work out, hence let's not spurious report success.

8 months agotpm2-clear: fix typo
Yu Watanabe [Wed, 5 Mar 2025 16:09:12 +0000 (01:09 +0900)] 
tpm2-clear: fix typo

Follow-up for 73e53d2ee442896dc54e7a64e0a24ef235e8aff5.

8 months agofactory-reset: fix typo
Yu Watanabe [Wed, 5 Mar 2025 16:07:38 +0000 (01:07 +0900)] 
factory-reset: fix typo

Follow-up for 41d9ed93d9089f0d18da4bbade8986ba6a35349a.

8 months agotpm2-clear: make it clear that we default to true for systemd.tpm2_allow_clear
Mike Yuan [Wed, 5 Mar 2025 15:13:55 +0000 (16:13 +0100)] 
tpm2-clear: make it clear that we default to true for systemd.tpm2_allow_clear

8 months agotpm2-clear: make getenv() failure fatal, correct one log level
Mike Yuan [Wed, 5 Mar 2025 15:07:50 +0000 (16:07 +0100)] 
tpm2-clear: make getenv() failure fatal, correct one log level

This operation is destructive, and we bail if the proc_cmdline_get_bool()
call below fails already. Better be safe than sorry.

8 months agotpm2-clear: use plain DEFINE_MAIN_FUNCTION
Mike Yuan [Wed, 5 Mar 2025 15:06:00 +0000 (16:06 +0100)] 
tpm2-clear: use plain DEFINE_MAIN_FUNCTION

We don't return any positive exit status.

8 months agounits/meson: remove unneeded linebreak
Mike Yuan [Wed, 5 Mar 2025 14:59:14 +0000 (15:59 +0100)] 
units/meson: remove unneeded linebreak

8 months agounits: refuse manual operations on factory-reset-now.target and friends
Mike Yuan [Wed, 5 Mar 2025 14:54:26 +0000 (15:54 +0100)] 
units: refuse manual operations on factory-reset-now.target and friends

It is strictly mandatory that this is done during initial
transaction, and not later when the system is already running.
Hence let's refuse manual start for all of the involved units.
Additionally, refuse manual stop for systemd-factory-reset-complete.service,
as it flags the factory reset completion through
/run/systemd/factory-reset-complete, which never gets removed
for the whole boot.

8 months agosysupdate: fix features and vaccum if all features are disabled
Thorsten Kukuk [Fri, 28 Feb 2025 13:01:16 +0000 (14:01 +0100)] 
sysupdate: fix features and vaccum if all features are disabled

If all transfer definitions are features and disabled, a wrong error
is reported that there are no transfer definitions.
This breaks the features and vaccum verb, as they work on disabled
features, too.

8 months agofactory-reset: rework infrastructure, make it work with gpt-auto, and add support...
Lennart Poettering [Wed, 5 Mar 2025 14:25:36 +0000 (15:25 +0100)] 
factory-reset: rework infrastructure, make it work with gpt-auto, and add support for resetting TPM as part of factory reset (#36512)

8 months agosd-varlink: fix typo
Yu Watanabe [Wed, 5 Mar 2025 14:17:05 +0000 (23:17 +0900)] 
sd-varlink: fix typo

Follow-up for 837849561b8c453f1ff8126d63788c00af8dba47.

8 months agoTODO: fix typo
Yu Watanabe [Wed, 5 Mar 2025 14:15:42 +0000 (23:15 +0900)] 
TODO: fix typo

Follow-up for 31ec0d8a2ea326658adc4e1bc607e1bf84e231b4.

8 months agotest-async: Wait for asynchronous_sync() to finish (#36611)
Luca Boccassi [Wed, 5 Mar 2025 12:36:45 +0000 (12:36 +0000)] 
test-async: Wait for asynchronous_sync() to finish (#36611)

Otherwise, if the system is busy, TEST-02-UNITTESTS will fail as
systemd will time out trying to kill the transient unit that we're
running test-async in.

8 months agorun0: run agents during setup, until pty forwarder takes over
Lennart Poettering [Fri, 28 Feb 2025 22:32:08 +0000 (23:32 +0100)] 
run0: run agents during setup, until pty forwarder takes over

When services start up they might query for passwords, or issue polkit
requests. Hence it makese sense to run the password query agent and
polkit agent from systemd-run. We already ran the polkit agent, this
also ensures we run the password query agent.

There's one tweak to the story though: running the agents and the pty
forwarder concurrently is messy, since they both try to read from stdin
(one potentially, the other definitely). Hence, let's time the agents
properly: invoke them when we initialize, but stop them once the start
job for the unit we are supposed to run is complete, and only then run
the pty forwarder.

With this in place, the following series of commands starts to work
really nicely (which previously deadlocked):

    # homectl create foobar
    # run0 -u foobar

What happens in the background in run0 is this: a new session is invoked
for "foobar", which pulls in the user@.service instance for the user.
That user@.service instance will need to unlock the homedir first. Since
8af1b296cb2cec8ddbb2cb47f4194269eb6cee2b this will happen via the askpw
logic. With this commit here this prompt will now be shown by run0. Once
the password is entered the directory is unlocked and the real session
begins. Nice!

This new behaviour is conditioned behind --pty-late (distinct from the
existing --pty switches). For systemd-run we will never enable this mode
by default, for compat with command lines that use ExecStartPre=
(because we won't process the pty anymore during that command) For
run0 however this changes the default to --pty-late (unless
--no-ask-password is specified). This reflects the fact that run0 is
more of an interctive tool and unlikely to be used in more complex
service start-up situations with ExecStartPre= and suchlike.

This also merges JobDoneContext into RunContext, since it doesn't really
make sense to have two contexts around to communicate between outer
stack frame and event handlers. Let's just have one, and pass it around
to all handlers the same way. In particular as we should delay exit only
until both the unit's job is complete *and* in case of --wait the unit
is exited, one of the two should not suffice.

8 months agoupdate TODO 36512/head
Lennart Poettering [Tue, 25 Feb 2025 08:01:57 +0000 (09:01 +0100)] 
update TODO

8 months agogpt-auto: add common parse_gpt_auto_root() parser
Lennart Poettering [Mon, 3 Mar 2025 13:35:29 +0000 (14:35 +0100)] 
gpt-auto: add common parse_gpt_auto_root() parser

8 months agodocs: document factory reset logic
Lennart Poettering [Wed, 26 Feb 2025 13:10:55 +0000 (14:10 +0100)] 
docs: document factory reset logic

8 months agogpt-auto-generator: if root=gpt-auto-force is specified ignore factory reset state
Lennart Poettering [Fri, 21 Feb 2025 16:23:22 +0000 (17:23 +0100)] 
gpt-auto-generator: if root=gpt-auto-force is specified ignore factory reset state

8 months agogpt-auto symlinks: take factory reset mode into consideration
Lennart Poettering [Fri, 21 Feb 2025 16:18:12 +0000 (17:18 +0100)] 
gpt-auto symlinks: take factory reset mode into consideration

In relevant factory reset situation the root disk itself is subject to
removal. This somewhat conflicts with automatic root disk discovery,
since the system first comes up with one candidate for the root disk,
which is then replaced by another.

Let's address this by determining at the moment of probing for the
gpt-root logic what the factory reset state currently is. This is then
used to maintain two distinct symlinks to the gpt auto root device: one
which is always available and one that is only available if factory
reset is off or complete.

The new symlinks is not used by anything yet. This will be added in a
later commit.

8 months agoudev: add builtin that reports current factory reset state
Lennart Poettering [Thu, 27 Feb 2025 10:21:26 +0000 (11:21 +0100)] 
udev: add builtin that reports current factory reset state

8 months agotpm2-clear: optionally reset TPM during a factory reset
Lennart Poettering [Thu, 20 Feb 2025 22:53:24 +0000 (23:53 +0100)] 
tpm2-clear: optionally reset TPM during a factory reset

8 months agounits: also require /dev/tpm0 to be around before tpm2.target can be reached
Lennart Poettering [Wed, 26 Feb 2025 21:41:34 +0000 (22:41 +0100)] 
units: also require /dev/tpm0 to be around before tpm2.target can be reached

While we typically just use /dev/tpmrm0 for accessing the TPM chip (i.e
via the kernel's own resource manager), some sysfs properties that
matter are on /dev/tpm0 only (i.e. the version without the kernel TPM
resource manager). Hence, wait for both to show up in tpm2.target, so
that we can be sure the full API is available.

This matters because we want to access /sys/class/tpm/tpm0/ppi/request
in the next commit.

8 months agofactory-reset: revamp infrastructure
Lennart Poettering [Thu, 20 Feb 2025 22:19:01 +0000 (23:19 +0100)] 
factory-reset: revamp infrastructure

This introduces a bunch of facilities:

1. The factory-reset.target unit that requests a factory reset is now
   complemented by factory-reset-now.target that executes it at next
   boot.

2. This latter is added to the initial transaction via the new trivial
   systemd-factory-reset-generator.

3. A tool systemd-factory-reset has been added to query, request,
   cancel, complete factory reset operations (via EFI variables). Two of
   these are wrapped into units that are plugged into
   factory-reset.target and factory-reset-now.target respectively. The
   tool also provides a simple Varlink API.

This should make things a lot cleaner, and both be useful as explicit
implementation on UEFI, and as template + hookpoints for alternative
implementations on non-UEFI.

8 months agorepart: port to new factory reset state apis
Lennart Poettering [Thu, 20 Feb 2025 22:18:27 +0000 (23:18 +0100)] 
repart: port to new factory reset state apis

8 months agoshared: add generic factory reset state apis
Lennart Poettering [Thu, 20 Feb 2025 22:18:12 +0000 (23:18 +0100)] 
shared: add generic factory reset state apis

Let's provide a generic implementation of the systemd.factory_reset
kernel cmdline checking repart implements. Moreover add support for
leaving the factory reset state again.

This only establishes the basic APIs, it does not hook them up with
anything.

8 months agoUkify tweaks (#36389)
Luca Boccassi [Wed, 5 Mar 2025 11:26:47 +0000 (11:26 +0000)] 
Ukify tweaks (#36389)

8 months agocryptsetup: align tpm2-blob
Aaron Rogers [Wed, 5 Mar 2025 01:20:09 +0000 (20:20 -0500)] 
cryptsetup: align tpm2-blob

8 months agoupdate TODO
Lennart Poettering [Wed, 5 Mar 2025 10:40:17 +0000 (11:40 +0100)] 
update TODO

8 months agoukify: avoid treating invalid option as an argument 36389/head
Zbigniew Jędrzejewski-Szmek [Fri, 14 Feb 2025 10:16:03 +0000 (11:16 +0100)] 
ukify: avoid treating invalid option as an argument

For some reason, argparse treats undefined options as positional args in
certain scenarios:

$ src/ukify/ukify.py --badopt='11'
ukify.py: error: unrecognized arguments: --badopt=11
$ src/ukify/ukify.py --badopt '11'
ukify.py: error: unrecognized arguments: --badopt
$ src/ukify/ukify.py --badopt '11 12'
Assuming obsolete command line syntax with no verb. Please use 'build'.
Traceback (most recent call last):
  File "/home/zbyszek/src/systemd/src/ukify/ukify.py", line 2497, in <module>
    main()
    ~~~~^^
  File "/home/zbyszek/src/systemd/src/ukify/ukify.py", line 2485, in main
    check_inputs(opts)
    ~~~~~~~~~~~~^^^^^^
  File "/home/zbyszek/src/systemd/src/ukify/ukify.py", line 671, in check_inputs
    value.open().close()
    ~~~~~~~~~~^^
  File "/usr/lib64/python3.13/pathlib/_local.py", line 537, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '--badopt=11 12'

I suspect that this is some crap compat for Windows, where option parsing is
an even bigger mess than here.

Being told about positional args, when no positional args were specified is
confusing, so add a check for this.

8 months agotest-async: Wait for asynchronous_sync() to finish 36611/head
Daan De Meyer [Tue, 4 Mar 2025 21:31:39 +0000 (22:31 +0100)] 
test-async: Wait for asynchronous_sync() to finish

Otherwise, if the system is busy, TEST-02-UNITTESTS will fail as
systemd will time out trying to kill the transient unit that we're
running test-async in.

8 months agoasync: Port to PidRef
Daan De Meyer [Tue, 4 Mar 2025 21:22:40 +0000 (22:22 +0100)] 
async: Port to PidRef

8 months agotest-network: drop deprecated ExecStart= modifier
Yu Watanabe [Tue, 4 Mar 2025 17:29:03 +0000 (02:29 +0900)] 
test-network: drop deprecated ExecStart= modifier

8 months agoglibc bump followup (#36609)
Yu Watanabe [Wed, 5 Mar 2025 09:16:44 +0000 (18:16 +0900)] 
glibc bump followup (#36609)

8 months agonspawn: add hotkey for rebooting/powering off container (#36583)
Luca Boccassi [Wed, 5 Mar 2025 01:55:11 +0000 (01:55 +0000)] 
nspawn: add hotkey for rebooting/powering off container (#36583)

8 months agomissing_syscall: drop raw_getpid() 36609/head
Mike Yuan [Tue, 4 Mar 2025 17:49:04 +0000 (18:49 +0100)] 
missing_syscall: drop raw_getpid()

This used to be relevant since in old versions of glibc an internal
cache is maintained, while we might sidestep their invalidation
with raw_clone(). After glibc 2.25 getpid() is a trivial wrapper
for the syscall, and hence there's no need to have a separate
raw_getpid().

8 months agolocale-util: modernize is_locale_utf8() a bit
Mike Yuan [Tue, 4 Mar 2025 17:42:24 +0000 (18:42 +0100)] 
locale-util: modernize is_locale_utf8() a bit

8 months agosd-journal/journal-send: use is_main_thread() where appropriate
Mike Yuan [Tue, 4 Mar 2025 17:41:23 +0000 (18:41 +0100)] 
sd-journal/journal-send: use is_main_thread() where appropriate

8 months agobasic/sys/mount: sort includes
Mike Yuan [Tue, 4 Mar 2025 17:08:21 +0000 (18:08 +0100)] 
basic/sys/mount: sort includes

8 months agomissing_fs: drop FS_KEY_DESCRIPTOR_SIZE
Mike Yuan [Tue, 4 Mar 2025 16:25:42 +0000 (17:25 +0100)] 
missing_fs: drop FS_KEY_DESCRIPTOR_SIZE

We now directly import linux/fscrypt.h, so this def is duplicate

8 months agonspawn: add ability to poweroff container cleanly with ^]^]p 36583/head
Lennart Poettering [Sun, 2 Mar 2025 20:43:12 +0000 (21:43 +0100)] 
nspawn: add ability to poweroff container cleanly with ^]^]p

It's sometimes very useful to be able to terminate a container quickly
but cleanly while talking to it. Introduce a hotkey for that: ^]^]p for
powering it off. In similar style add ^]^]r for rebooting it.

8 months agoptyfwd: add support for additional out-of-band hotkeys in ptyfwd
Lennart Poettering [Sun, 2 Mar 2025 20:40:50 +0000 (21:40 +0100)] 
ptyfwd: add support for additional out-of-band hotkeys in ptyfwd

Let's add the ability that ptyfwd tools can register additional hotkeys
that they then can handle.

So far the only hotkey we support is ^]^]^] to exit the ptyfwd session
abruptly. Staying close to this let's add ^]^]<char> for additional
commands.

8 months agoptyfwd: rename handler to hangup_handler
Lennart Poettering [Sun, 2 Mar 2025 06:51:34 +0000 (07:51 +0100)] 
ptyfwd: rename handler to hangup_handler

We'll add another type of handler callback in the next commit, hence
rename the existing handler to be more precise what it is about:
handling hangups (either inline via tty, or explicit via user request)

8 months agodirent-util: add several assertions in posix_getdents()
Yu Watanabe [Tue, 4 Mar 2025 15:05:31 +0000 (00:05 +0900)] 
dirent-util: add several assertions in posix_getdents()

Follow-up for e86a492ff08526e5adf85fa881c76f80adc3c84a.

8 months agopath: Close inotify FD asynchronously
Michal Koutný [Mon, 17 Feb 2025 14:40:24 +0000 (15:40 +0100)] 
path: Close inotify FD asynchronously

inotify FD may take several milliseconds to close.  We measured
daemon-reload

        default: (0.427 ± 0.05) s
        async:   (0.323 ± 0.02) s

with 5 path units out of 422 units. I.e. ~1% of units cause ~25% of
delay, hence this fix seems like low-hanging fruit on the daemon-reload
critical path.

Particular inotify slowness pointed out by @fbuihuu.

8 months agopam-systemd: default to "lightweight" sessions if area is selected
Lennart Poettering [Mon, 3 Mar 2025 12:24:18 +0000 (13:24 +0100)] 
pam-systemd: default to "lightweight" sessions if area is selected

We currently don't support invoking a per-area service manager instance,
hence don't try to pull in one if we log into an area.

Once we add support for per-area service managers we can relax this
again.

8 months agovarlink: optionally create leading dirs when binding AF_UNIX socket
Lennart Poettering [Tue, 4 Mar 2025 14:39:46 +0000 (15:39 +0100)] 
varlink: optionally create leading dirs when binding AF_UNIX socket

This is such a common case, let's make it easy to do this.

8 months agolog: explicitly size log_target_max_level()
Lennart Poettering [Tue, 4 Mar 2025 14:41:12 +0000 (15:41 +0100)] 
log: explicitly size log_target_max_level()

We always validate that the target value is below _LOG_TARGET_SINGLE_MAX
before acessing it, but we don't actually size the array like that.
let's fix that.

This doesn#t effectively change anything, but it makes things more
explicit what the limit here is.

8 months agotest: Connect test unit to console when running interactively (#36586)
Daan De Meyer [Tue, 4 Mar 2025 16:06:49 +0000 (17:06 +0100)] 
test: Connect test unit to console when running interactively (#36586)

8 months agodns-stream: only read DNS packet data if we identified the peer properly 36531/head
Lennart Poettering [Mon, 3 Mar 2025 23:17:21 +0000 (00:17 +0100)] 
dns-stream: only read DNS packet data if we identified the peer properly

If we use TCP fastopen to connect to a DNS server via TCP, and it
responds really quickly between our connection attempt and our immediate
check back, then we have not identified the peer yet, and will not be
able to use the peer metadata to fill in our packet info.

Let's fix that, and simply not read from the socket until identification
is complete.

Fixes: #34956
8 months agoresolved: pick up new DNSSEC KSC from 2024
Lennart Poettering [Mon, 3 Mar 2025 21:40:05 +0000 (22:40 +0100)] 
resolved: pick up new DNSSEC KSC from 2024

Import thew new key from https://data.iana.org/root-anchors/root-anchors.xml.

The old one remains valid, as per provided data.

Fixes: #36260
8 months agoukify: drop dots from exception messages
Zbigniew Jędrzejewski-Szmek [Mon, 3 Feb 2025 09:38:01 +0000 (10:38 +0100)] 
ukify: drop dots from exception messages

In Python, exception messages are often embedded in surrounding text, so in
general they should not contain punctuation.

Also, no need to instantiate the exception object if no arguments are used.

8 months agobasic: remove unnecessary definition in missing_xyz.h (#36565)
Daan De Meyer [Tue, 4 Mar 2025 07:41:14 +0000 (08:41 +0100)] 
basic: remove unnecessary definition in missing_xyz.h (#36565)

8 months agohwdb: add rotation profile matrix for Rog Ally X (2024) (#36591)
Harrison Vanderbyl [Tue, 4 Mar 2025 04:15:23 +0000 (15:15 +1100)] 
hwdb: add rotation profile matrix for Rog Ally X (2024) (#36591)

8 months agochattr-util: two trivial cleanups (#36593)
Yu Watanabe [Tue, 4 Mar 2025 04:13:25 +0000 (13:13 +0900)] 
chattr-util: two trivial cleanups (#36593)

8 months agotree-wide: several cleanups and fixlets prompted by Coverity (#36431)
Lennart Poettering [Mon, 3 Mar 2025 22:17:28 +0000 (23:17 +0100)] 
tree-wide: several cleanups and fixlets prompted by Coverity (#36431)

8 months agoCoverity fixups (#36503)
Lennart Poettering [Mon, 3 Mar 2025 21:54:42 +0000 (22:54 +0100)] 
Coverity fixups (#36503)

Details in individual commits.

8 months agoexec-invoke: add missing assertions and drop unnecessary conditions 36431/head
Yu Watanabe [Tue, 18 Feb 2025 19:46:08 +0000 (04:46 +0900)] 
exec-invoke: add missing assertions and drop unnecessary conditions

Fixes CID#1534358.

8 months agoexec-invoke: modernize get_supplementary_groups()
Yu Watanabe [Tue, 18 Feb 2025 19:43:59 +0000 (04:43 +0900)] 
exec-invoke: modernize get_supplementary_groups()

- drop unused argument 'group',
- rename output arguments,
- add missing assertions for output arguments,
- always initialize output arguments on success.

8 months agohwdb-util: drop unused value assignment
Yu Watanabe [Tue, 18 Feb 2025 18:46:55 +0000 (03:46 +0900)] 
hwdb-util: drop unused value assignment

The values assigned to 'r' were never used, and overwritten by the next
call of read_line_full().

Fixes CID#1548043 and CID#1548064.

8 months agope-binary: fix array overrun
Yu Watanabe [Tue, 18 Feb 2025 18:09:38 +0000 (03:09 +0900)] 
pe-binary: fix array overrun

This is a kind of paranoia, as memeqzero() does not read anyting if
length is zero. But, strictly speaking C language does not allow such,
and Coverity warn about that.

Fixes CID#1561177.

8 months agope-binary: trivial coding style fixlets
Yu Watanabe [Tue, 18 Feb 2025 18:02:32 +0000 (03:02 +0900)] 
pe-binary: trivial coding style fixlets

8 months agogenerator: insert parentheses to make the code clearer
Yu Watanabe [Tue, 18 Feb 2025 17:45:30 +0000 (02:45 +0900)] 
generator: insert parentheses to make the code clearer

Silence CID#1563781.

8 months agofileio: move call of label_ops_post() before error handling of creating files
Yu Watanabe [Tue, 18 Feb 2025 17:41:03 +0000 (02:41 +0900)] 
fileio: move call of label_ops_post() before error handling of creating files

Fixes CID#1563946.

8 months agoasync: voidify call of fsync()
Yu Watanabe [Tue, 18 Feb 2025 17:34:13 +0000 (02:34 +0900)] 
async: voidify call of fsync()

Fixes CID#1564787.

8 months agonetwork: Use RTNH_COMPARE_MASK in route_can_update() (#36585)
Daan De Meyer [Mon, 3 Mar 2025 20:00:33 +0000 (21:00 +0100)] 
network: Use RTNH_COMPARE_MASK in route_can_update() (#36585)

Let's only compare flags that can be set by userspace and not all flags.

Fixes a bug introduced by 7027cdbd79c26d5a8890759a37d70165c8aeb214 (v256).
Fixes #36544