]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 weeks agomacro.h: move DEFER_VOID_CALL() to cleanup-util.h 41316/head
Lennart Poettering [Tue, 24 Mar 2026 08:03:49 +0000 (09:03 +0100)] 
macro.h: move DEFER_VOID_CALL() to cleanup-util.h

For some reason the IMDS PR for the first time triggers an issue with
the DEFER_VOID_CALL() logic relying on assert() and being places in
macro.h, let's hence move this elsewhere.

2 weeks agotest-iovec: add unit test for IOVEC_MAKE_BYTE()
Lennart Poettering [Tue, 24 Mar 2026 07:57:26 +0000 (08:57 +0100)] 
test-iovec: add unit test for IOVEC_MAKE_BYTE()

As requested here: https://github.com/systemd/systemd/pull/40980#discussion_r2964650885

2 weeks agoA batch of conversions to the new options parsers (#41302)
Zbigniew Jędrzejewski-Szmek [Wed, 25 Mar 2026 10:39:36 +0000 (11:39 +0100)] 
A batch of conversions to the new options parsers (#41302)

This was partially done with Claude, but it needed an insane amount of prodding to
not do stupid things.

2 weeks agonetwork: increase transmit/receive queues size to 16384 (#41289)
Walter McKelvie [Wed, 25 Mar 2026 10:37:31 +0000 (06:37 -0400)] 
network: increase transmit/receive queues size to 16384 (#41289)

A 10G Marvell AQC113 included in an ASRock TRX50WS motherboard NIC claims to
support tx/rx queues as large as 8184.

After boot 'ethtool -g eth0' outputs:
  Ring parameters for eth0:
  RX: 8184
  RX Mini: n/a
  RX Jumbo: n/a
  TX: 8184
  TX push buff len: n/a
  HDS thresh: n/a
  RX: 2048
  RX Mini: n/a
  RX Jumbo: n/a
  TX: 4096
  RX Buf Len: n/a
  CQE Size: n/a
  TX Push: off
  RX Push: off
  TX push buff len: n/a
  TCP data split: n/a
  HDS thresh: n/a

'ethtool --set-ring eth0 rx 8184 tx 8184 && ethtool -g eth0' yields:
  Ring parameters for eth0:
  RX: 8184
  RX Mini: n/a
  RX Jumbo: n/a
  TX: 8184
  TX push buff len: n/a
  HDS thresh: n/a
  RX: 8184
  RX Mini: n/a
  RX Jumbo: n/a
  TX: 8184
  RX Buf Len: n/a
  CQE Size: n/a
  TX Push: off
  RX Push: off
  TX push buff len: n/a
  TCP data split: n/a
  HDS thresh: n/a

I can measure a throughput difference between using using buffer sizes
4096 and 8184 on my hardware, so it really seems that this is doing
something beyond buggy firmware.

Original PR https://github.com/systemd/systemd/pull/17635 didn't give any
explanation for the limit of 4096, but that's probably what was supported by
the kernel drivers at the time.

A web search shows that CISCO VIC 15000 supports 16k, so allow up to that.

[zjs: edited the message]

2 weeks agoresolved: use the SOA to find chain of trust quicker
Ronan Pigott [Wed, 11 Mar 2026 17:52:49 +0000 (10:52 -0700)] 
resolved: use the SOA to find chain of trust quicker

sd-resolved does dnssec "backwards" compared to most resolvers.

A typical strategy is to start from the DNS root and gather the
requisite keys on the way down, but sd-resolved requests the final
answer it wants and then goes searching for the requisite keys later.

We don't know in advance under which names we should expect to find
those keys, because we don't know the zone cuts a priori, but we can use
what we have found in prior responses to make an educated guess. This
was more or less the intent of 47690634f157, but it was partially
regressed in d840783db520 while fixing a bug handling totally empty
responses.

Fixes #37472

Ref: 47690634f157 ("resolved: don't request the SOA for every dns label")
Fixes: d840783db520 ("resolved: always progress DS queries")
2 weeks agohomectl: apply all --member-of= groups from a comma-separated list
Frantisek Sumsal [Tue, 24 Mar 2026 13:29:27 +0000 (14:29 +0100)] 
homectl: apply all --member-of= groups from a comma-separated list

Commit 0e1ede4b4b6d1ce6b5b6cda5f803e4f1b5aa4a03 introduced a bug where
we'd always fetch the "original" (empty) list of groups when processing
a comma-separated list of groups from the --member-of= option, so only
the last group from the list would get applied. This bug was then later
(in 316e9887f2a48bd1c4efa3e31b4bfbaeb22de3a3) refactored into a separate
function.

Follow-up for 0e1ede4b4b6d1ce6b5b6cda5f803e4f1b5aa4a03.
Resolves: #41286

2 weeks agoresolved: resolve insecure answers with unsupported sig algorithms (#40778)
Zbigniew Jędrzejewski-Szmek [Wed, 25 Mar 2026 09:38:08 +0000 (10:38 +0100)] 
resolved: resolve insecure answers with unsupported sig algorithms (#40778)

sd-resolved does not support all the permissible DNSSEC signature
algorithms, and some are intentionally unsupported as a matter of
policy. Answers that can only be validated via unsupported algorithms
should be treated as if they were unsigned, per RFC4035 § 5.2.

Previously, sd-resolved tried to properly record insecure answers for
unsupported algortihms, but did not record this status for each of the
auxilliary DNSSEC transactions, so the primary transaction had no way to
know if there was a plausible DNSKEY with an unsupported signature
algorithm in the chain of trust.

This commit adds the insecure DNSKEYs that use unsupported algorithms to
the list of validated keys for each transaction, so that dependent
transactions can learn that a plausible chain of trust exists, even if
no authenticated one does, and report the insecure answer.

This should improve the situation in #35126.

2 weeks agovarious: fix typos 41302/head
Zbigniew Jędrzejewski-Szmek [Wed, 25 Mar 2026 00:43:29 +0000 (01:43 +0100)] 
various: fix typos

2 weeks agobless-boot: use the new option parser and verb macros
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 09:20:52 +0000 (10:20 +0100)] 
bless-boot: use the new option parser and verb macros

Co-developed-by: Claude <claude@anthropic.com>
2 weeks agoshared/verbs: add VERB_COMMON_HELP_HIDDEN macro and skip verbs with NULL help
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 11:54:40 +0000 (12:54 +0100)] 
shared/verbs: add VERB_COMMON_HELP_HIDDEN macro and skip verbs with NULL help

Co-developed-by: Claude <claude@anthropic.com>
2 weeks agoshared/verbs: allow multiple verbs to be handled by a single function
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 22:33:49 +0000 (23:33 +0100)] 
shared/verbs: allow multiple verbs to be handled by a single function

With the uintptr_t data parameter, it is actually quite nice to have
VERB(do_impl, "name-a", …)
VERB(do_impl, "name-b", …)
int do_impl(…) { … }

To make this work, the do_impl_data struct needs to have a unique name and
we also need to suppress the warning about the forward declaration for
do_impl being repeated. I think it's fine to suppress the warning, it's
not needed for anything. If somebody declares the function with the same
name by mistake, the implementations are going to conflict too.

2 weeks agovalidatefs: shorten and reindent code
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 10:40:12 +0000 (11:40 +0100)] 
validatefs: shorten and reindent code

2 weeks agovalidatefs: use the new option parser
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 10:47:09 +0000 (11:47 +0100)] 
validatefs: use the new option parser

Co-developed-by: Claude <claude@anthropic.com>
2 weeks agoupdate-done: use the new option parser
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 10:07:06 +0000 (11:07 +0100)] 
update-done: use the new option parser

While at it, add --version.

Co-developed-by: Claude <claude@anthropic.com>
2 weeks agoask-password: use the new option parser
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 09:12:13 +0000 (10:12 +0100)] 
ask-password: use the new option parser

--version was missing from the old help text and is now included.

Co-developed-by: Claude <claude@anthropic.com>
2 weeks agoshared/options: allow option help to be extended with fake lines
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 10:01:37 +0000 (11:01 +0100)] 
shared/options: allow option help to be extended with fake lines

Useful when we want to enumerate options rvalues with custom help
texts.

2 weeks agobinfmt: use the new option parser
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 08:46:16 +0000 (09:46 +0100)] 
binfmt: use the new option parser

Co-developed-by: Claude <claude@anthropic.com>
2 weeks agoshared/options: add common option macros for --cat-config and --tldr
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 08:40:17 +0000 (09:40 +0100)] 
shared/options: add common option macros for --cat-config and --tldr

Co-developed-by: Claude <claude@anthropic.com>
2 weeks agoac-power: use the new option parser
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 08:34:15 +0000 (09:34 +0100)] 
ac-power: use the new option parser

Co-developed-by: Claude <claude@anthropic.com>
2 weeks agoshared/options: add helper function to count positional args
Zbigniew Jędrzejewski-Szmek [Tue, 24 Mar 2026 23:32:20 +0000 (00:32 +0100)] 
shared/options: add helper function to count positional args

2 weeks agoresolved: add "static RRs" concept (#41213)
Lennart Poettering [Tue, 24 Mar 2026 21:45:22 +0000 (22:45 +0100)] 
resolved: add "static RRs" concept (#41213)

split out of #40980

2 weeks agovmspawn: Fix --help width
Daan De Meyer [Tue, 24 Mar 2026 21:01:40 +0000 (22:01 +0100)] 
vmspawn: Fix --help width

2 weeks agovmspawn: add disk type selection for root and extra drives (#41301)
Lennart Poettering [Tue, 24 Mar 2026 20:48:00 +0000 (21:48 +0100)] 
vmspawn: add disk type selection for root and extra drives (#41301)

  vmspawn previously hardcoded virtio-blk for all drives. This adds
  --image-disk-type= to select the root disk type (virtio-blk,
  virtio-scsi, or nvme) and allows per-drive overrides via a
  colon-separated prefix on --extra-drive=. The format and disk type
  prefixes can appear in any order since their value sets don't overlap.

  For virtio-scsi, a single shared controller is created with drives
  attached as scsi-hd devices. For nvme, each drive gets its own
controller. Both have serial number length limits (30 and 20 characters
  respectively), so long filenames are replaced with a truncated SHA-256
  hex digest.

2 weeks agovmspawn: Add headless console support
Daan De Meyer [Mon, 23 Mar 2026 21:00:03 +0000 (22:00 +0100)] 
vmspawn: Add headless console support

2 weeks agopo: Translated using Weblate (Kabyle)
Massii Aqvayli [Tue, 24 Mar 2026 19:58:45 +0000 (19:58 +0000)] 
po: Translated using Weblate (Kabyle)

Currently translated at 22.5% (60 of 266 strings)

Co-authored-by: Massii Aqvayli <massiin@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/kab/
Translation: systemd/main

2 weeks agoresolved: add ability to define additional local RRs via drop-ins 41213/head
Lennart Poettering [Thu, 26 Feb 2026 14:54:14 +0000 (15:54 +0100)] 
resolved: add ability to define additional local RRs via drop-ins

This is an extension of the /etc/hosts concept, but can provide any kind
of RRs (well, actually, we only parse A/AAAA/PTR for now, but the
concept is open for more).

Fixes: #17791
2 weeks agoresolved: also flush /etc/hosts on reload
Lennart Poettering [Wed, 4 Mar 2026 16:08:03 +0000 (17:08 +0100)] 
resolved: also flush /etc/hosts on reload

When we are told to reload our configuration also flush out /etc/hosts
explicitly. This is particularly relevant since we suppress too frequent
reloads, and hence a synchronous way to force a reload is very useful.

2 weeks agodns-rr: add dns_resource_record_from_json()
Lennart Poettering [Thu, 26 Feb 2026 14:50:26 +0000 (15:50 +0100)] 
dns-rr: add dns_resource_record_from_json()

This only parses a small subset of RR types for now, but we can add more
later.

Covered are the most important RR types: A, AAAA, PTR.

2 weeks agodns-rr: tighten rules on parsing RR keys from JSON
Lennart Poettering [Thu, 26 Feb 2026 14:51:09 +0000 (15:51 +0100)] 
dns-rr: tighten rules on parsing RR keys from JSON

let's ensure the name is actually a valid DNS name.

2 weeks agojson-util: add json_dispatch_in6_addr()
Lennart Poettering [Fri, 20 Mar 2026 14:16:19 +0000 (15:16 +0100)] 
json-util: add json_dispatch_in6_addr()

2 weeks agojson-util: optionally accept string-based serialization for IPv4 addresses
Lennart Poettering [Fri, 20 Mar 2026 13:59:27 +0000 (14:59 +0100)] 
json-util: optionally accept string-based serialization for IPv4 addresses

2 weeks agostat-util: introduce inode_unmodified_hash_ops
Lennart Poettering [Tue, 24 Mar 2026 16:06:09 +0000 (17:06 +0100)] 
stat-util: introduce inode_unmodified_hash_ops

This is almost the same as inode_hash_ops, but also hashes + compares
all attributes that could affect the contents of a file. It ignores
"superficial"/"external" attributes such as ownership or access mode
however.

2 weeks agostat-util: also include inode type in hash ops
Lennart Poettering [Tue, 24 Mar 2026 15:56:40 +0000 (16:56 +0100)] 
stat-util: also include inode type in hash ops

This doesn't really have any major benefit, but it does make this nicely
mirror stat_inode_same() which also checks this triplet for identifying
identical inodes.

3 weeks agoci: Drop codeql workflow
Daan De Meyer [Mon, 23 Mar 2026 10:31:56 +0000 (11:31 +0100)] 
ci: Drop codeql workflow

After analyzing all 218 CodeQL alerts across the project's history, the
workflow has not justified its CI cost:

- The most impactful query (PotentiallyDangerousFunction) was a custom
  systemd-specific query that has already been replaced by clang-tidy's
  bugprone-unsafe-functions check (6fb5ec3dd1).

- Of the remaining C++ queries, 6 never triggered at all
  (bad-strncpy-size, unsafe-strcat, unsafe-strncat,
  suspicious-pointer-scaling, suspicious-pointer-scaling-void,
  inconsistent-null-check).

- Several high-value-sounding queries had extreme false positive rates:
  toctou-race-condition (95% FP), use-after-free (88% FP),
  cleartext-transmission (100% FP).

- Many queries that did trigger are already covered by compiler warnings
  (-Wshadow, -Wformat, -Wunused-variable, -Wreturn-type,
  -Wtautological-compare) or existing clang-tidy checks
  (bugprone-sizeof-expression).

- Across all alerts, only 3 genuinely useful C++ fixes can be
  attributed to CodeQL: 1 tainted-format-string, 2
  incorrectly-checked-scanf. The rest were either false positives or
  incidental fixes during refactoring that weren't prompted by CodeQL.

- The Python queries are largely superseded by ruff (already in CI) and
  had an 89% false positive rate on the security-focused checks.

The workflow consumed significant CI resources (40+ minutes per run) and
the ongoing maintenance burden of triaging false positives outweighs the
marginal value of the 2-3 real findings it produced across its entire
lifetime.

3 weeks agovmspawn: add nvme disk type support 41301/head
Christian Brauner [Tue, 24 Mar 2026 13:44:34 +0000 (14:44 +0100)] 
vmspawn: add nvme disk type support

Extend --image-disk-type= and the --extra-drive= disk type prefix to
support nvme in addition to virtio-blk and virtio-scsi:

  systemd-vmspawn --image-disk-type=nvme --image=image.raw
  systemd-vmspawn --image=image.raw --extra-drive=nvme:data.raw

The NVMe serial number is limited to 20 characters by the NVMe spec.
If the image filename exceeds this, it is hashed with SHA-256 and
truncated to 20 hex characters via the disk_serial() helper introduced
in the previous commit.

Signed-off-by: Christian Brauner <brauner@kernel.org>
3 weeks agovmspawn: add virtio-scsi disk type support
Christian Brauner [Tue, 24 Mar 2026 13:25:50 +0000 (14:25 +0100)] 
vmspawn: add virtio-scsi disk type support

Add --image-disk-type= to select the disk type for the root disk, and
allow specifying the disk type as a colon-separated prefix on
--extra-drive=:

  systemd-vmspawn --image-disk-type=virtio-scsi --image=image.raw
  systemd-vmspawn --image=image.raw --extra-drive=virtio-scsi:data.raw

For --extra-drive=, the format and disk type prefixes can appear in any
order since the value sets don't overlap:

  --extra-drive=raw:virtio-scsi:/path
  --extra-drive=virtio-scsi:raw:/path

Extra drives inherit --image-disk-type= by default unless overridden
with an explicit prefix.

vmspawn originally used virtio-scsi for all drives but switched to
virtio-blk in 1f24a954e4 for simplicity and direct kernel boot
compatibility. This makes virtio-scsi available again as an explicit
option for cases where a SCSI storage topology is desired.

For virtio-scsi, a shared virtio-scsi-pci controller is created and
drives are attached as scsi-hd devices. The SCSI serial number is
limited to 30 characters, so filenames exceeding this are hashed with
SHA-256.

Signed-off-by: Christian Brauner <brauner@kernel.org>
3 weeks agovmspawn: EFI NVRAM state control (#41218)
Daan De Meyer [Tue, 24 Mar 2026 15:04:16 +0000 (16:04 +0100)] 
vmspawn: EFI NVRAM state control (#41218)

Split out of #41016

3 weeks agoshell-completion: add shell completions for systemd-hwdb
Zbigniew Jędrzejewski-Szmek [Fri, 13 Mar 2026 14:22:45 +0000 (15:22 +0100)] 
shell-completion: add shell completions for systemd-hwdb

Co-developed-by: Claude <claude@anthropic.com>
3 weeks agodiscover-image: remove tpm state + efi nvram state on image removal 41218/head
Lennart Poettering [Mon, 9 Mar 2026 07:46:36 +0000 (08:46 +0100)] 
discover-image: remove tpm state + efi nvram state on image removal

3 weeks agovmspawn: split out swtpm-setup logic, and beef it up a bit
Lennart Poettering [Thu, 19 Mar 2026 13:20:02 +0000 (14:20 +0100)] 
vmspawn: split out swtpm-setup logic, and beef it up a bit

3 weeks agovmspawn: manage EFI nvram (variables) state similar to TPM state
Lennart Poettering [Sun, 8 Mar 2026 20:52:08 +0000 (21:52 +0100)] 
vmspawn: manage EFI nvram (variables) state similar to TPM state

3 weeks agovmspawn: make efi variable nvram dependent on whether the EFI profile knows the conce...
Lennart Poettering [Sun, 8 Mar 2026 19:51:38 +0000 (20:51 +0100)] 
vmspawn: make efi variable nvram dependent on whether the EFI profile knows the concept, not on secureboot

3 weeks agoci: Only run claude-review automatically on PRs to main
Daan De Meyer [Tue, 24 Mar 2026 09:21:04 +0000 (10:21 +0100)] 
ci: Only run claude-review automatically on PRs to main

3 weeks agovmspawn: Drop --sandbox=chroot from virtiofsd command line
Daan De Meyer [Mon, 23 Mar 2026 20:58:28 +0000 (21:58 +0100)] 
vmspawn: Drop --sandbox=chroot from virtiofsd command line

It's unclear why I added this in fd05c6c7593c5e36864d8784df91b878bbf991ab,
but it breaks bind mounting regular directories via --bind,
so drop it again since it's not actually required to make virtiofsd
work with the foreign UID range.

3 weeks agoci: Generalize escaping instructions in claude-review prompt
Daan De Meyer [Tue, 24 Mar 2026 09:15:21 +0000 (10:15 +0100)] 
ci: Generalize escaping instructions in claude-review prompt

3 weeks agocreds: use CLEANUP_ERASE for symmetric key
Luca Boccassi [Mon, 23 Mar 2026 21:13:03 +0000 (21:13 +0000)] 
creds: use CLEANUP_ERASE for symmetric key

Just in case, ensure the sha256 that is used as a symmetric
key for encrypted creds is safely erased from memory.

Reported on yeswehack.com as YWH-PGM9780-166

Follow-up for 21bc0b6fa1de44b520353b935bf14160f9f70591

3 weeks agoDefine options and verbs through "magic macros" (#40880)
Lennart Poettering [Mon, 23 Mar 2026 21:17:05 +0000 (22:17 +0100)] 
Define options and verbs through "magic macros" (#40880)

This is an another alternative for #40656, based on @poettering's
suggestion to use an ELF section.

The output of --help is generated using format-table, but the details of
the formatting a bit off: different sections in the table (verbs, option
groups) are not aligned to the same column. Our current table formatting
doesn't make this easy. If somebody has an idea how to do this without
too much pain, please make suggestions.

Another thing that I didn't know how to do nicely, was to use the two
columns of separation. But maybe this doesn't matter. If we switch to
one column everywhere, I don't think people will care.

Example output:
```console
$ build/systemd-id128 -h | cat
systemd-id128 [OPTIONS...] COMMAND

Generate and print 128-bit identifiers.

Commands:
  new                Generate a new ID
  machine-id         Print the ID of current machine
  boot-id            Print the ID of current boot
  invocation-id      Print the ID of current invocation
  var-partition-uuid Print the UUID for the /var/ partition
  show [NAME|UUID]   Print one or more UUIDs
  help               Show this help

Options:
  -h --help            Show this help
     --version         Show package version
     --no-pager        Do not start a pager
     --no-legend       Do not show headers and footers
     --json=FORMAT     Output inspection data in JSON (takes one of pretty,
                       short, off)
  -j                   Equivalent to --json=pretty (on TTY) or --json=short
                       (otherwise)
  -p --pretty          Generate samples of program code
  -P --value           Only print the value
  -a --app-specific=ID Generate app-specific IDs
  -u --uuid            Output in UUID format

See the systemd-id128(1) man page for details.
```

The output wraps automatically with terminal width. If the terminal is
extremely narrow, ellipsization occurs. I think this doesn't matter
and/or is actually a feature. Such narrow terminals mostly occur in
testing, so it doesn't matter what exactly we do, as long as it is
something somewhat reasonable.

Anyway, I think this is enough as PoC. Please compare this with the
previous approach. /cc @behrmann, @YHNdnzj, @poettering

The three binaries that are converted have options, verbs, optional
arguments, and options terminate option parsing, so most of the
functionality is there. One thing that I didn't implement that was
present in previous PRs is "namespaces", i.e. multiple parsers in the
same source file. I expect that we can handle this similarly to option
groups.

3 weeks agoresolved: also validate unsupported dnssec digest algs 40778/head
Ronan Pigott [Sat, 21 Feb 2026 19:05:20 +0000 (12:05 -0700)] 
resolved: also validate unsupported dnssec digest algs

3 weeks agoresolved: resolve insecure answers with unsupported sig algorithms
Ronan Pigott [Sat, 21 Feb 2026 01:51:35 +0000 (18:51 -0700)] 
resolved: resolve insecure answers with unsupported sig algorithms

sd-resolved does not support all the permissible DNSSEC signature
algorithms, and some are intentionally unsupported as a matter of
policy. Answers that can only be validated via unsupported algorithms
should be treated as if they were unsigned, per RFC4035§5.2.

Previously, sd-resolved tried to properly record insecure answers for
unsupported algortihms, but did not record this status for each of the
auxilliary DNSSEC transactions, so the primary transaction had no way to
know if there was a plausible DNSKEY with an unsupported signature
algorithm in the chain of trust.

This commit adds the insecure DNSKEYs that use unsupported algorithms to
the list of validated keys for each transaction, so that dependent
transactions can learn that a plausible chain of trust exists, even if
no authenticated one does, and report the insecure answer.

3 weeks agocopy: add new flags that cause a seek to beginning of files before copying
Lennart Poettering [Tue, 10 Feb 2026 14:41:22 +0000 (15:41 +0100)] 
copy: add new flags that cause a seek to beginning of files before copying

This is quite useful in various cases where we so far did this manually.

3 weeks agonotify: add one more compiler suppression 40880/head
Zbigniew Jędrzejewski-Szmek [Mon, 2 Mar 2026 23:18:09 +0000 (00:18 +0100)] 
notify: add one more compiler suppression

Old gcc (<14) says:

2026-03-02T23:11:28.5676353Z In file included from ../src/notify/notify.c:30:
2026-03-02T23:11:28.5694607Z In function ‘strv_isempty’,
2026-03-02T23:11:28.5695481Z     inlined from ‘action_fork’ at ../src/notify/notify.c:440:9,
2026-03-02T23:11:28.5696266Z     inlined from ‘run’ at ../src/notify/notify.c:541:24,
2026-03-02T23:11:28.5696929Z     inlined from ‘main’ at ../src/notify/notify.c:682:1:
2026-03-02T23:11:28.5697877Z ../src/basic/strv.h:108:23: error: ‘args’ may be used uninitialized [-Werror=maybe-uninitialized]
2026-03-02T23:11:28.5698655Z   108 |         return !l || !*l;
2026-03-02T23:11:28.5699052Z       |                       ^~
2026-03-02T23:11:28.5700020Z ../src/notify/notify.c: In function ‘main’:
2026-03-02T23:11:28.5700681Z ../src/notify/notify.c:531:16: note: ‘args’ was declared here
2026-03-02T23:11:28.5701217Z   531 |         char **args;
2026-03-02T23:11:28.5701574Z       |                ^~~~
2026-03-02T23:11:28.5701960Z cc1: all warnings being treated as errors

3 weeks agoApply the same column width for different option groups
Zbigniew Jędrzejewski-Szmek [Mon, 2 Mar 2026 22:40:51 +0000 (23:40 +0100)] 
Apply the same column width for different option groups

This feel a bit like a hack, but it works OK. The width of the first
column of verbs or options in different sections is measured and
applied to the other tables. This makes the second column aligned.

3 weeks agoshared/format-table: add helpers to query and set column width
Zbigniew Jędrzejewski-Szmek [Mon, 2 Mar 2026 14:35:41 +0000 (15:35 +0100)] 
shared/format-table: add helpers to query and set column width

3 weeks agoci: Replace codeql PotentiallyDangerousFunction query with clang-tidy (#41246)
Daan De Meyer [Mon, 23 Mar 2026 10:30:47 +0000 (11:30 +0100)] 
ci: Replace codeql PotentiallyDangerousFunction query with clang-tidy (#41246)

3 weeks agomkosi-tool/opensuse: add libtss2-tcti-device0 package
vlefebvre [Fri, 20 Mar 2026 14:55:31 +0000 (15:55 +0100)] 
mkosi-tool/opensuse: add libtss2-tcti-device0 package

libtss2-tcti-device0 is not installed by default in the openSUSE
image, but is now required when building the test image. Without it,
the build fails with

```
Shared library 'libtss2-tcti-device.so.0' is not available:
libtss2-tcti-device.so.0: cannot open shared object file: No such file or directory
```

Follow-up for 5f85409f932dfdc123d0e8ded8e8a9a6f9443119

3 weeks agopo: Translated using Weblate (Indonesian)
Arif Budiman [Mon, 23 Mar 2026 06:58:47 +0000 (06:58 +0000)] 
po: Translated using Weblate (Indonesian)

Currently translated at 100.0% (266 of 266 strings)

Co-authored-by: Arif Budiman <arifpedia@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/id/
Translation: systemd/main

3 weeks agoTwo fixlets (#41273)
Daan De Meyer [Mon, 23 Mar 2026 08:05:27 +0000 (09:05 +0100)] 
Two fixlets (#41273)

From yeswehack.com reports

3 weeks agonetworkd: replace D-Bus with Varlink in networkctl (#40780)
Yu Watanabe [Mon, 23 Mar 2026 05:55:57 +0000 (14:55 +0900)] 
networkd: replace D-Bus with Varlink in networkctl (#40780)

networkctl previously called networkd over D-Bus for several operations.
This replaces all of those calls with Varlink, making it the sole IPC
mechanism between networkctl and networkd.

 New Varlink methods added to networkd:

- io.systemd.Network.Link (new sub-interface for link-specific
operations):

- Link.Describe — replaces Link.BitRates + DHCPServer.Leases D-Bus
properties
- Link.Up — replaces Link.SetUp D-Bus method (moved from
**io.systemd.Network.LinkUp**)
- Link.Down — replaces Link.SetDown D-Bus method (moved from
**io.systemd.Network.LinkDown**)
      - Link.Renew  — replaces Link.Renew D-Bus method
      - Link.ForceRenew   — replaces Link.ForceRenew D-Bus method
      - Link.Reconfigure  — replaces Link.Reconfigure D-Bus method

  - io.systemd.service
     - Reload            — replaces Manager.Reload D-Bus method

  Supporting changes:
- link_get_bit_rates() extracted from networkd-link.c into
networkd-speed-meter.c
- BitRates added to link_build_json() so Link.Describe returns them
inline
alongside the existing interface description, replacing a separate D-Bus
read
- link_reconfigure_full() and manager_reload() extended to accept
sd_varlink*
for deferred async replies (consistent with existing sd_bus_message*
path)
  - DHCP lease display (networkctl status) uses Link.Describe instead of
DHCPServer.Leases; falls back to ClientId when hostname is not present

3 weeks agomountfsd: fix readOnly flag inversion 41273/head
Luca Boccassi [Mon, 23 Mar 2026 00:51:29 +0000 (00:51 +0000)] 
mountfsd: fix readOnly flag inversion

mountfsd applies R/O when the varlink readOnly flag is set to false

Reported on yeswehack.com as YWH-PGM9780-164

Follow-up for 702a52f4b5d49cce11e2adbc740deb3b644e2de0

3 weeks agocore: also set iov_len when deserializing LogExtraFields=
Luca Boccassi [Mon, 23 Mar 2026 00:25:46 +0000 (00:25 +0000)] 
core: also set iov_len when deserializing LogExtraFields=

This is not actually used so it doesn't really matter in
practice and the fields are used anyway, but for cleanliness
fix it

Reported on yeswehack.com as YWH-PGM9780-165

Follow-up for 5699a1689b7e49702e4e60d08ab3fe386ba8d4df

3 weeks agossh: handle VMADDR_CID_ANY in a couple places (#41230)
Daan De Meyer [Sun, 22 Mar 2026 19:07:53 +0000 (20:07 +0100)] 
ssh: handle VMADDR_CID_ANY in a couple places (#41230)

Originally reported in Ubuntu as
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2145027.

3 weeks ago[RFC] core: add `io.systemd.Manager.{PowerOff,SoftReboot,Halt,Kexec}` (#41236)
Daan De Meyer [Sun, 22 Mar 2026 19:06:34 +0000 (20:06 +0100)] 
[RFC] core: add `io.systemd.Manager.{PowerOff,SoftReboot,Halt,Kexec}` (#41236)

3 weeks agomips: Fix conditional inclusion of <asm/sgidefs.h>
Andreas K. Hüttel [Fri, 20 Mar 2026 12:52:17 +0000 (13:52 +0100)] 
mips: Fix conditional inclusion of <asm/sgidefs.h>

systemd now has a system call wrapper that does a long series of #ifdef's to
differentiate between architectures and ABIs. This wrapper has two problems.

1. On mips, it needs to differentiate between O32, N32, N64 ABI. It does that
via a code block in src/include/override/sys/generate-syscall.py (and derived
files):

     76 #  elif defined(_MIPS_SIM)
     77 #    if _MIPS_SIM == _MIPS_SIM_ABI32
     78 #      define systemd_NR_{syscall} {nr_mipso32}
     79 #    elif _MIPS_SIM == _MIPS_SIM_NABI32
     80 #      define systemd_NR_{syscall} {nr_mips64n32}
     81 #    elif _MIPS_SIM == _MIPS_SIM_ABI64
     82 #      define systemd_NR_{syscall} {nr_mips64}
     83 #    else
     84 #      error "Unknown MIPS ABI"
     85 #    endif
     86 #  elif defined(__hppa__)

Now the _MIPS_SIM* constants stem from a vendor-specific header file sgidefs.h,
which is included with glibc, but not with musl. It is however always present
in the Linux kernel headers as asm/sgidefs.h ...

2. To work around this, the syscall wrapper already has a block

     47 #ifdef ARCH_MIPS
     48 #include <asm/sgidefs.h>
     49 #endif

Turns out, ARCH_MIPS is defined nowhere in Gentoo, neither on glibc nor on musl.
As a result the code (by accident, probably sgidefs.h is included transitively
somehow) works on glibc, but not on musl.

The simplest fix is to replace line 47 in the generator and the derived file
with

     47 #ifdef __mips__

Two other source code files require a similar fix since they rely on the
constants.

Bug: https://github.com/systemd/systemd/issues/41239
Bug: https://bugs.gentoo.org/971376
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
3 weeks agosd-dhcp-client: several trivial cleanups (#41256)
Daan De Meyer [Sun, 22 Mar 2026 19:00:33 +0000 (20:00 +0100)] 
sd-dhcp-client: several trivial cleanups (#41256)

3 weeks agodhcp: fix user class and vendor specific option assignment
Yu Watanabe [Sun, 22 Mar 2026 14:39:38 +0000 (23:39 +0900)] 
dhcp: fix user class and vendor specific option assignment

The commit 6d7cb9a6b8361d2b327222bc12872a3676358bc3 fixes the assignment
of the these options when specified through SendOption=. However, it
breaks when specified through UserClass= or SendVendorOption=.

When UserClass= or SendVendorOption= is specified, the option length is
calculated from the sd_dhcp_client.user_class or .vendor_options. Hence,
we can use 0 for the length in that case.

Follow-up for 6d7cb9a6b8361d2b327222bc12872a3676358bc3.

3 weeks agosd-varlink: gracefully reject arrays/maps with a null element
Frantisek Sumsal [Fri, 20 Mar 2026 19:27:07 +0000 (20:27 +0100)] 
sd-varlink: gracefully reject arrays/maps with a null element

Follow-up for 799392286ec0797c0a2a1260c444360b47ef36fc.

3 weeks agobus-error: fix typo
Zbigniew Jędrzejewski-Szmek [Sun, 1 Mar 2026 10:16:02 +0000 (11:16 +0100)] 
bus-error: fix typo

3 weeks agonotify: add one more assert
Zbigniew Jędrzejewski-Szmek [Fri, 27 Feb 2026 19:22:04 +0000 (20:22 +0100)] 
notify: add one more assert

We tend to get those preallocated array sizes wrong.
In this case, the count was correct, but add the usual
assert.

3 weeks agonotify: use the new option parser
Zbigniew Jędrzejewski-Szmek [Fri, 27 Feb 2026 19:20:53 +0000 (20:20 +0100)] 
notify: use the new option parser

Cosmetic adjustments to one help string.

3 weeks agodissect: restore compat with clang
Zbigniew Jędrzejewski-Szmek [Fri, 27 Feb 2026 20:16:37 +0000 (21:16 +0100)] 
dissect: restore compat with clang

clang says:
  src/dissect/dissect.c:292:17: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]

Another option would be to raise the C standard to C23. I think that'd
make sense, but it's better to do it separately.

3 weeks agodissect: use the new option parser
Zbigniew Jędrzejewski-Szmek [Fri, 27 Feb 2026 10:35:38 +0000 (11:35 +0100)] 
dissect: use the new option parser

Some cosmetic differences in descriptions are made.
--quiet was miscategorized as a command (172fadda65a788c6128e5c93e0c530244c6a42e2),
--usr-hash and --usr-hash-sig were not listed (10b8d65f3f37f169fdc3999ff86e5fdbdbd0e3a5).

3 weeks agoid128: use the new option parser
Zbigniew Jędrzejewski-Szmek [Wed, 18 Mar 2026 16:38:47 +0000 (17:38 +0100)] 
id128: use the new option parser

--version was not documented. Fixup for 0d1d512f7f42071595f0c950f911f3557fda09ea.

3 weeks agooptions: only consume "--" immediately after an option that stops parsing
Zbigniew Jędrzejewski-Szmek [Thu, 19 Mar 2026 17:13:41 +0000 (18:13 +0100)] 
options: only consume "--" immediately after an option that stops parsing

The behaviour that was implemented in systemd-dissect was that
both '--exec -- cmd' and '--exec cmd' result in 'cmd' as the command,
and '--' anywhere later is as a positional argument, so nesting is
possible, e.g.:
  --exec -- cmd --opt -- another-cmd --another-opt

This is not obvious, so add some tests for this and keep it as a separate
commit.

3 weeks agotest-options: add tests for option macros and flags
Zbigniew Jędrzejewski-Szmek [Thu, 19 Mar 2026 16:45:17 +0000 (17:45 +0100)] 
test-options: add tests for option macros and flags

Add tests for OPTION_STOPS_PARSING, OPTION_GROUP_MARKER, and
OPTION_OPTIONAL_ARG flags with manual Option arrays, and a separate
test exercising the OPTION, OPTION_LONG, OPTION_SHORT, OPTION_FULL,
and OPTION_GROUP macros via FOREACH_OPTION_FULL in a switch statement,
as they would be used in real code.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
3 weeks agocore: allow unset pidref in manager_log_caller 41236/head
Michael Vogt [Sat, 21 Mar 2026 21:36:20 +0000 (22:36 +0100)] 
core: allow unset pidref in manager_log_caller

This commit allows unset pidref when calling manager_log_caller().
With that we can log manager calls even if we cannot resolve the
caller. Currently when we cannot resolve the caller we are just
not logging anything. With this commit we at least log the call
(even though we don't know what caller it was).

Thanks to keszybz for the suggestion.

3 weeks agocore: extract varlink_log_caller() helper
Michael Vogt [Sat, 21 Mar 2026 21:12:02 +0000 (22:12 +0100)] 
core: extract varlink_log_caller() helper

Extract a common helper varlink_log_caller() and use in the varlink
code when logging the caller of a method. It also logs the method
now that was tried (but failed) to be logged with log_notice just
like manager_log_caller() would do.

I was looking into modifying `manager_log_caller` instead and
accept a NULL pidref but could not log more than the method without
pidref and would make the manager_log_caller slightly less nice.

Thanks to keszybz for suggesting this.

3 weeks agocore: add `io.systemd.Manager.{PowerOff,Reboot,SoftReboot,Halt,Kexec}`
Michael Vogt [Fri, 20 Mar 2026 15:25:42 +0000 (16:25 +0100)] 
core: add `io.systemd.Manager.{PowerOff,Reboot,SoftReboot,Halt,Kexec}`

This adds the low-level io.systemd.Manager shutdown support. This
is (much) simpler than the logind one. It mimics dbus but uses
a shared helper for the simple cases.

Note that this is more restrictive than the dbus version. The
dbus version uses SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT) but
the varlink version uses varlink_check_privileged_peer(link).
This is mostly because I'm not sure how to do the equivalent
in a race-free way.

Thanks to Daan for suggesting this.

3 weeks agodns-packet: move p->more unref into the free path
Oblivionsage [Sat, 21 Mar 2026 16:43:50 +0000 (17:43 +0100)] 
dns-packet: move p->more unref into the free path

dns_packet_unref() unconditionally unrefs p->more on every call,
even when n_ref > 1. But dns_packet_ref() doesn't ref p->more.
This means if a packet with a ->more chain gets ref'd and unref'd
multiple times, the chain gets freed too early while the parent
still holds a dangling pointer.

Move the p->more unref into the n_ref == 1 block so the chain
only gets cleaned up when the packet is actually being freed.

3 weeks agosd-dhcp-client: propagate errors in client_initialize_{io,time}_events() 41256/head
Yu Watanabe [Sat, 14 Mar 2026 12:59:42 +0000 (21:59 +0900)] 
sd-dhcp-client: propagate errors in client_initialize_{io,time}_events()

Call client_stop() on error and return 0 only on callback.
Normal non-callback functions should propagate errors.

This also makes client_initialize_time_events() use
event_reset_time_relative().

3 weeks agosd-dhcp-client: voidify client_initialize()
Yu Watanabe [Thu, 12 Mar 2026 20:16:16 +0000 (05:16 +0900)] 
sd-dhcp-client: voidify client_initialize()

It never fails.

3 weeks agosd-dhcp-client: drop disabled FORCERENEW message support
Yu Watanabe [Tue, 10 Mar 2026 23:50:24 +0000 (08:50 +0900)] 
sd-dhcp-client: drop disabled FORCERENEW message support

FORCERENEW message support has been disabled so long time for security
concern. Most other implementations of DHCP server/client neither
support FORCERENEW. Let's completely drop relevant code.

3 weeks agosd-dhcp-client: add missing error checks
Yu Watanabe [Thu, 12 Mar 2026 20:19:06 +0000 (05:19 +0900)] 
sd-dhcp-client: add missing error checks

3 weeks agosd-dhcp-client: add missing assertion
Yu Watanabe [Fri, 13 Mar 2026 16:31:41 +0000 (01:31 +0900)] 
sd-dhcp-client: add missing assertion

3 weeks agosd-dhcp-client: coding style fix
Yu Watanabe [Thu, 12 Mar 2026 20:31:45 +0000 (05:31 +0900)] 
sd-dhcp-client: coding style fix

3 weeks agofuzz-dhcp-client: modernize test code
Yu Watanabe [Thu, 12 Mar 2026 23:11:18 +0000 (08:11 +0900)] 
fuzz-dhcp-client: modernize test code

3 weeks agotest-dhcp-client: modernize test code
Yu Watanabe [Thu, 12 Mar 2026 22:11:06 +0000 (07:11 +0900)] 
test-dhcp-client: modernize test code

3 weeks agoci: Replace codeql PotentiallyDangerousFunction query with clang-tidy 41246/head
Daan De Meyer [Fri, 20 Mar 2026 21:14:42 +0000 (22:14 +0100)] 
ci: Replace codeql PotentiallyDangerousFunction query with clang-tidy

The strerror() calls in test-errno-util.c are intentional so silence
clang-tidy there.

3 weeks agotest-fd-util: Replace dup() with fcntl()
Daan De Meyer [Fri, 20 Mar 2026 21:11:15 +0000 (22:11 +0100)] 
test-fd-util: Replace dup() with fcntl()

Last remaining use of dup() in the codebase, let's get rid of it.

3 weeks agotest-resolved-stream: Use accept4() instead of accept()
Daan De Meyer [Fri, 20 Mar 2026 21:05:08 +0000 (22:05 +0100)] 
test-resolved-stream: Use accept4() instead of accept()

3 weeks agoreboot-util: Make clang-tidy happy if xenctrl is not installed
Daan De Meyer [Fri, 20 Mar 2026 20:52:00 +0000 (21:52 +0100)] 
reboot-util: Make clang-tidy happy if xenctrl is not installed

xenctrl is another library that's not widely available across distributions.
Let's make sure clang-tidy is happy with reboot-util.c if it is not
available.

3 weeks agocore: Add two more IWYU pragmas
Daan De Meyer [Fri, 20 Mar 2026 20:50:10 +0000 (21:50 +0100)] 
core: Add two more IWYU pragmas

If selinux isn't enabled, these are reported as unused, so let's
add pragmas to tell clang-tidy to keep these.

3 weeks agoselinux-util: Make clang-tidy happy if selinux is not available
Daan De Meyer [Fri, 20 Mar 2026 20:38:27 +0000 (21:38 +0100)] 
selinux-util: Make clang-tidy happy if selinux is not available

Most of our libraries are available on all distributions so we don't
bother with making clang-tidy happy if the library is not available.
The one exception is selinux which isn't available on Arch. Let's
conditionalize the includes in selinux-util.c so that clang-tidy is
still happy on Arch where we can't install libselinux.

3 weeks agocore: Only build selinux-setup if we have selinux
Daan De Meyer [Fri, 20 Mar 2026 20:38:08 +0000 (21:38 +0100)] 
core: Only build selinux-setup if we have selinux

3 weeks agotest-dhcp-client: fix packet length and checksum in IP header
Yu Watanabe [Fri, 20 Mar 2026 17:11:28 +0000 (02:11 +0900)] 
test-dhcp-client: fix packet length and checksum in IP header

3 weeks agokmod-setup: load vsock_loopback alongside vsock
vlefebvre [Fri, 20 Mar 2026 14:25:09 +0000 (15:25 +0100)] 
kmod-setup: load vsock_loopback alongside vsock

Loading vmw_vsock_virtio_transport early at boot causes vsock to be
resident before any application opens an AF_VSOCK socket. Because the
kernel skips autoloading when the vsock module is already present,
vsock_loopback never gets loaded automatically, and any subsequent
bind() to VMADDR_CID_LOCAL fails with EADDRNOTAVAIL.

Fix this by explicitly loading vsock_loopback on virtio or VMWare
machines via the new may_have_vsock_looopback() helper, wich covers both
vmw_vsock_virtio_transport and vmware_vsock_vmci_transport case.
vsock_loopback is the only module that registers a transport for
VMADDR_CID_LOCAL (CID 1) and has no hard dependency from any of the
vsock transport modules.

Fixes: #41100
Follow-up for 381c78db491a7c5fad8697543dd36ebe9b848718

3 weeks agomountfsd: Add CAP_SYS_PTRACE and CAP_SYS_CHROOT
Daan De Meyer [Fri, 20 Mar 2026 13:14:28 +0000 (14:14 +0100)] 
mountfsd: Add CAP_SYS_PTRACE and CAP_SYS_CHROOT

CAP_SYS_PTRACE for making sure we can open mount namespaces of
peers via /proc/<pid>/ns and CAP_SYS_CHROOT for making sure we can
join those mount namespaces.

3 weeks agoverbs: add a section to list verbs similarly to options
Zbigniew Jędrzejewski-Szmek [Fri, 27 Feb 2026 10:38:29 +0000 (11:38 +0100)] 
verbs: add a section to list verbs similarly to options

3 weeks agotest-option-parser: "translate" test-getopt for the new parser
Zbigniew Jędrzejewski-Szmek [Fri, 27 Feb 2026 18:10:56 +0000 (19:10 +0100)] 
test-option-parser: "translate" test-getopt for the new parser

The test cases are the same in both files. To make the test
more through, add case where "--" is used more than once and
also when options are present after "--".

3 weeks agooptions: add workaround for spurious warning with gcc 11–13
Zbigniew Jędrzejewski-Szmek [Sun, 1 Mar 2026 14:37:24 +0000 (15:37 +0100)] 
options: add workaround for spurious warning with gcc 11–13

gcc 14+ doesn't need this.

3 weeks agoAdd "option parser" infrastracture that helps with cmdline option parsing
Zbigniew Jędrzejewski-Szmek [Tue, 24 Feb 2026 15:13:06 +0000 (16:13 +0100)] 
Add "option parser" infrastracture that helps with cmdline option parsing

The basic idea is that we'll have "one source of truth" for the list of
options. Currently, this is split between:
  1. struct option options[] array for long options
  2. the short option parameter to getopt_long()
  3. --help
so it is easy to forget to add or update one of those places where
appropriate.

An option is defined through a macro that includes the option short
and long codes, and also the metavar and help. Those four items can
be used to generate the help string automatically.

The code is easier to read when various parts are written in the same
order.

We can define common options through a macro in the header file,
reducing boilerplate repeated in different files. Over time, if we
discover that the same pattern is used in multiple files, we can add
another "common option".

The macro is defined in a way that the editor can indent it like a
normal case statement.

The error message for ambiguous options is formatted a bit differently:
$ systemd-id128 --no-
systemd-id128: option '--no-' is ambiguous; possibilities: '--no-pager' '--no-legend'
$ build/systemd-id128 --no-
option '--no-' is ambiguous; possibilities: --no-pager, --no-legend

I think the formatting without commas is ugly, but OTOH, the quotes
around option names are superfluous, real option names are easy to
distinguish.