]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 months agojournal-file: let's make journal_file_copy_entry() robust against concurrent writing... 37732/head
Lennart Poettering [Wed, 4 Jun 2025 15:00:29 +0000 (17:00 +0200)] 
journal-file: let's make journal_file_copy_entry() robust against concurrent writing of the source

As usual, we need to protect ourselves against concurrent modification
of journal files. We a pretty good at that these days when reading
journal files. But journal_file_copy_entry() so far wasn't too good with
that. journal_file_append_data() so far returned EINVAL when you pass
invalid data to it. Since we pass the source data as-is in there, it's
going to fail if the journal source file is slightly invalid due to a
concurrent update.

Hence, we need to validate data gracefully here that we think comes from
a safe place, because actually it doesn't, it's directly copied from an
unsafe journal file.

Hence, let's introduce a clear error code here, and look for it in
journal_file_copy_entry(), and handle it gracefully.

Pretty sure this fixes #33372, but it's a race, so I don't know for
sure. If this remains reproducible we need to look at this again.

Fixes: #33372
5 months agocompress: get rid of a bunch of 'else'
Lennart Poettering [Wed, 4 Jun 2025 15:00:21 +0000 (17:00 +0200)] 
compress: get rid of a bunch of 'else'

5 months agotest-network: extend comments how to run the test
Yu Watanabe [Wed, 4 Jun 2025 15:22:14 +0000 (00:22 +0900)] 
test-network: extend comments how to run the test

5 months agoSeveral follow-ups for userdb lookup from udevd and networkd (#37719)
Yu Watanabe [Wed, 4 Jun 2025 14:32:24 +0000 (23:32 +0900)] 
Several follow-ups for userdb lookup from udevd and networkd (#37719)

5 months agoupdate TODO
Lennart Poettering [Wed, 4 Jun 2025 14:05:09 +0000 (16:05 +0200)] 
update TODO

5 months agodoc: tweaks to root storage daemon docs (#37727)
Yu Watanabe [Wed, 4 Jun 2025 13:34:28 +0000 (22:34 +0900)] 
doc: tweaks to root storage daemon docs (#37727)

5 months agoBugprone argument comment 9 (#37712)
Yu Watanabe [Wed, 4 Jun 2025 13:33:51 +0000 (22:33 +0900)] 
Bugprone argument comment 9 (#37712)

Follow up from https://github.com/systemd/systemd/pull/37678

5 months agocopy: return immediately on fs-verity failures
Allison Karlitskaya [Thu, 20 Mar 2025 12:13:13 +0000 (13:13 +0100)] 
copy: return immediately on fs-verity failures

Since 8065d02e263a ("copy: Fix error handling in fd_copy_directory()")
we immediately abort recursive copy operations on ENOSPC.  Let's also
abort on the common case of filesystems not supporting fs-verity: if
it's unsupported for one file, it's unlikely to work for the 1000s that
follow it.

We do this by mapping the two fs-verity "not supported" errors (ENOTTY,
EOPNOTSUPP) to ESOCKTNOSUPPORT as a special "fs-verity not supported
here" error.  When we see that error at the top level we exit
immediately.

This prevents us from having to see the same error message literally
thousands of time when using fsverity=copy with systemd-repart on a
filesystem which lacks the proper support.

Adjust the test-copy test case to expect the new errno.  Previously this
test case would output multiple failure lines per `copy_tree_at()`
invocation (for the failing cases) but now it only outputs one.

5 months agodoc: clarify that root storage daemons need unit files 37727/head
Lennart Poettering [Wed, 4 Jun 2025 12:50:11 +0000 (14:50 +0200)] 
doc: clarify that root storage daemons need unit files

Fixes: #37700
5 months agodoc: mention 'exitrd' term
Lennart Poettering [Wed, 4 Jun 2025 12:50:07 +0000 (14:50 +0200)] 
doc: mention 'exitrd' term

5 months agoRevert "github/mkosi: tentatively disable mkosi(opensuse) job" 37719/head
Yu Watanabe [Wed, 14 May 2025 16:46:16 +0000 (01:46 +0900)] 
Revert "github/mkosi: tentatively disable mkosi(opensuse) job"

This reverts commit 48a092afbb27b03daaeb2db938917eb98c82e366.

5 months agomkosi: install util-linux-systemd in SUSE
Luca Boccassi [Tue, 3 Jun 2025 17:54:52 +0000 (18:54 +0100)] 
mkosi: install util-linux-systemd in SUSE

Some tools (findmnt, logger, lsblk, lslogins) got moved to a
new util-linux-systemd package in Tumbleweed so install it explicitly

5 months agoTEST-17-UDEV: acquire SYS_UID_MAX/SYS_GID_MAX from userdbctl
Yu Watanabe [Tue, 3 Jun 2025 20:38:35 +0000 (05:38 +0900)] 
TEST-17-UDEV: acquire SYS_UID_MAX/SYS_GID_MAX from userdbctl

Suse build systemd with -Dsystem-uid-max=499 -Dsystem-gid-max=499,
and seems to not provide /etc/login.defs file. See
https://github.com/bmwiedemann/openSUSE/blob/2dc224ae5d446e928519315f4d46f76d1e34b8a8/packages/s/systemd/systemd.spec

5 months agonetwork: skip loading /etc/shadow
Yu Watanabe [Tue, 3 Jun 2025 20:29:16 +0000 (05:29 +0900)] 
network: skip loading /etc/shadow

We only require UID/GID, hence not necessary to load information from shadow.

5 months agoudev-rules: skip loading /etc/shadow
Yu Watanabe [Tue, 3 Jun 2025 20:27:34 +0000 (05:27 +0900)] 
udev-rules: skip loading /etc/shadow

We only require UID/GID, hence not necessary to load information from shadow.

5 months agouserdb: make ENOEXEC wins over ESRCH
Yu Watanabe [Wed, 4 Jun 2025 09:14:52 +0000 (18:14 +0900)] 
userdb: make ENOEXEC wins over ESRCH

Both ENOEXEC and ESRCH is a kind of error that indicate successful
lookup. ENOEXEC means the server found an entry but it does not
pass filter. ESRCH means the server could not find an entry.
Hence, ENOEXEC should have more information, and should be propagated to
the caller.

5 months agouserdb: use RET_GATHER() at one more place and update comment
Yu Watanabe [Wed, 4 Jun 2025 09:14:02 +0000 (18:14 +0900)] 
userdb: use RET_GATHER() at one more place and update comment

5 months agouserdb: fix definition of USERDB_SYNTHESIZE_NUMERIC
Yu Watanabe [Tue, 3 Jun 2025 20:20:21 +0000 (05:20 +0900)] 
userdb: fix definition of USERDB_SYNTHESIZE_NUMERIC

Otherwise, we always synthesize numeric IDs.

Follow-up for e4d07d1a2d66fd200abdd977b70fc6ac69a369ce.

5 months agoresolved: honour SD_RESOLVED_NO_CNAME flag when processing cache
Lennart Poettering [Wed, 4 Jun 2025 08:53:50 +0000 (10:53 +0200)] 
resolved: honour SD_RESOLVED_NO_CNAME flag when processing cache

Fixes: #33300
Replaces: #35102

5 months agotreewide: correct argument comments for sd_event_add_time 37712/head
Jelle van der Waa [Wed, 4 Jun 2025 09:24:21 +0000 (11:24 +0200)] 
treewide: correct argument comments for sd_event_add_time

5 months agotreewide: correct argument comments for sd_netlink_call
Jelle van der Waa [Wed, 4 Jun 2025 09:15:52 +0000 (11:15 +0200)] 
treewide: correct argument comments for sd_netlink_call

5 months agotreewide: correct argument comment to 'ret' where applicable
Jelle van der Waa [Tue, 3 Jun 2025 13:58:24 +0000 (15:58 +0200)] 
treewide: correct argument comment to 'ret' where applicable

For functions with one return argument prefer 'ret' as argument comment.

5 months agoask-password-api: correct argument comment
Jelle van der Waa [Tue, 3 Jun 2025 13:37:30 +0000 (15:37 +0200)] 
ask-password-api: correct argument comment

5 months agoRevert "coredump: lock down EnterNamespace= mount even more"
Michal Sekletar [Fri, 14 Mar 2025 08:16:17 +0000 (09:16 +0100)] 
Revert "coredump: lock down EnterNamespace= mount even more"

This reverts commit 4c9c8b8d09eff18df71ba4aa910df4201f9890a0.

Reverted change broke EnterNamespace= completely. For example, libdw
tries to access libc in /lib64 which points to usr/lib64 and that fails.
Similarly for binaries, we need to be able to resolve /bin to usr/bin
and /sbin to usr/sbin at the very least.

5 months agorepart: correct argument comment
Jelle van der Waa [Tue, 3 Jun 2025 13:32:49 +0000 (15:32 +0200)] 
repart: correct argument comment

5 months agonsresourced: correct argument comments
Jelle van der Waa [Tue, 3 Jun 2025 12:07:21 +0000 (14:07 +0200)] 
nsresourced: correct argument comments

5 months agosd-varlink: correct argument comment
Jelle van der Waa [Tue, 3 Jun 2025 12:01:13 +0000 (14:01 +0200)] 
sd-varlink: correct argument comment

5 months agohomectl: rename 'emphasize_current' -> 'emphasize_current_password'
Jelle van der Waa [Tue, 3 Jun 2025 11:40:39 +0000 (13:40 +0200)] 
homectl: rename 'emphasize_current' -> 'emphasize_current_password'

Other functions in this file use the same parameter naming.

5 months agogenerator: rename 'password' -> 'key_file'
Jelle van der Waa [Tue, 3 Jun 2025 09:14:22 +0000 (11:14 +0200)] 
generator: rename 'password' -> 'key_file'

Makes the header declaration and implementation consistent.

5 months agocgroup-util: rename 'fsfd' -> 'cgroups_fd'
Jelle van der Waa [Tue, 3 Jun 2025 08:49:17 +0000 (10:49 +0200)] 
cgroup-util: rename 'fsfd' -> 'cgroups_fd'

Makes the header and implementation consistent.

5 months agoman/pcrlock: fix typo
Yu Watanabe [Wed, 4 Jun 2025 04:12:42 +0000 (13:12 +0900)] 
man/pcrlock: fix typo

Follow-up for ccd2bf48b2d736e335f217d5621a817aa1b6beeb.

5 months agouserdbctl: Label dynamic greeter users
Adrian Vovk [Fri, 30 May 2025 18:27:29 +0000 (14:27 -0400)] 
userdbctl: Label dynamic greeter users

5 months agodoc: fix integration tests guide reference
Emmanuel Ferdman [Mon, 2 Jun 2025 19:19:26 +0000 (12:19 -0700)] 
doc: fix integration tests guide reference

5 months agocore/varlink: use forward.h at two more places (#37716)
Mike Yuan [Tue, 3 Jun 2025 21:11:17 +0000 (23:11 +0200)] 
core/varlink: use forward.h at two more places (#37716)

5 months agocore/varlink: use forward.h at two more places 37716/head
Yu Watanabe [Tue, 3 Jun 2025 19:57:29 +0000 (04:57 +0900)] 
core/varlink: use forward.h at two more places

5 months agocompress: avoid a bunch of div-by-zeroes
Lennart Poettering [Tue, 3 Jun 2025 14:26:17 +0000 (16:26 +0200)] 
compress: avoid a bunch of div-by-zeroes

Follow-up for #37706. Implements the same logic for all compression
algorithms we have.

5 months agotpm2: various smaller fixes, mostly about better error messages and support checking...
Lennart Poettering [Tue, 3 Jun 2025 16:26:36 +0000 (18:26 +0200)] 
tpm2: various smaller fixes, mostly about better error messages and support checking (#37690)

Fixes: #35187
Fixes: #36743
Fixes: #37607
5 months agotpm2-util: guarantee that verb_has_tpm2_generic() returns usable exit status 37690/head
Lennart Poettering [Tue, 3 Jun 2025 14:11:57 +0000 (16:11 +0200)] 
tpm2-util: guarantee that verb_has_tpm2_generic() returns usable exit status

5 months agotpm2-util: use BIT_FOREACH() more
Lennart Poettering [Tue, 3 Jun 2025 14:11:35 +0000 (16:11 +0200)] 
tpm2-util: use BIT_FOREACH() more

5 months agotpm2: add a clear error message for all errors that suggest a PCR violation
Lennart Poettering [Mon, 2 Jun 2025 11:13:17 +0000 (13:13 +0200)] 
tpm2: add a clear error message for all errors that suggest a PCR violation

Fixes: #35187
5 months agotpm2-util: add a brief summary of tpm2_unseal() return values in a comment
Lennart Poettering [Mon, 2 Jun 2025 11:13:59 +0000 (13:13 +0200)] 
tpm2-util: add a brief summary of tpm2_unseal() return values in a comment

5 months agotpm2-util: also generate recognizable error if PolicyAuthorizeNV fails
Lennart Poettering [Mon, 2 Jun 2025 11:12:28 +0000 (13:12 +0200)] 
tpm2-util: also generate recognizable error if PolicyAuthorizeNV fails

5 months agopcrlock: also refuse lacking SHA-256 support early when creating policy
Lennart Poettering [Mon, 2 Jun 2025 10:32:33 +0000 (12:32 +0200)] 
pcrlock: also refuse lacking SHA-256 support early when creating policy

This will fail eventually, but let's be explicit early here.

5 months agopcrlock: make error messages more useful if PCR state doesn't match policy during...
Lennart Poettering [Mon, 2 Jun 2025 10:23:51 +0000 (12:23 +0200)] 
pcrlock: make error messages more useful if PCR state doesn't match policy during PolicyOR

Fixes: #35187
5 months agomeasure: generate a more useful error in case SHA1 support is disabled by distro
Lennart Poettering [Mon, 2 Jun 2025 09:49:33 +0000 (11:49 +0200)] 
measure: generate a more useful error in case SHA1 support is disabled by distro

Fixes: #36743
5 months agopcrlock: add "is-supported" verb that checks if the local TPM supports the commands...
Lennart Poettering [Mon, 2 Jun 2025 09:20:52 +0000 (11:20 +0200)] 
pcrlock: add "is-supported" verb that checks if the local TPM supports the commands we need for pcrlock

systemd-pcrlock requires support for the PolicyAuthorizeNV command,
which is not implemented in the first TPM2 releases. We also strictly
require SHA-256 support. Hence add a tool for checking for both of
these.

This is a tighter version of "systemd-analyze has-tpm2", that checks for
the precise feature that systemd-pcrlock needs, on top of basic TPM2
functionality.

Fixes: #37607
5 months agotpm2-util: correct copy/pasted error message
Lennart Poettering [Mon, 2 Jun 2025 11:13:34 +0000 (13:13 +0200)] 
tpm2-util: correct copy/pasted error message

5 months agobus-unit-util: warn and ignore assignment of deprecated properties
Yu Watanabe [Fri, 30 May 2025 19:30:43 +0000 (04:30 +0900)] 
bus-unit-util: warn and ignore assignment of deprecated properties

With 5da476ac7728b91ad3a49c1b126b3559b4fbeed8, we refused to set the
properties, but this relaxes the behavior, and now commands warn and
ignore the assignment.

Also, assignment of CPUAccounting property is now warned and ignored,
which is deprecated by 29da53dde32a0097134f6c3ba5fb5220dd6e5423.

Prompted by https://github.com/systemd/systemd/pull/37665#discussion_r2115676993

5 months agorepart: if partition already exists, required size may not be multiple of grain size
Yu Watanabe [Fri, 18 Apr 2025 18:41:45 +0000 (03:41 +0900)] 
repart: if partition already exists, required size may not be multiple of grain size

See partition_min_size_with_padding().
Fixes #37178.

5 months agovmspawn: do not preserve access permissions and xattrs of template OVMF vars
Arian van Putten [Sun, 1 Jun 2025 10:02:55 +0000 (12:02 +0200)] 
vmspawn: do not preserve access permissions and xattrs of template OVMF vars

This makes vmspawn work when /usr/share/qemu/edk2-i386-vars.fd is on
disk with 0444 permissions as is the case on NixOS.

The nix package manager does not store any access permissions, ownership,
timestamps, or extended attributes in its package format to increase
reproducibility. The only meta-data that is stored is the executable bit.

Thus when unpacking a nix package, the executable bit is preserved, but no other
access permissions are preserved and all files in /nix/store end up as
read-only.

This causes the template OVMF vars file to have 0444 permissions. If we preserve
those permissions when copying the template file to /tmp that means QEMU can not
write to the file and fails.

So lets not preserve permissions and keep the 0600 permissions that are set by
default.

5 months agorepart: Add ratelimitting for progress updates
Daan De Meyer [Mon, 2 Jun 2025 14:34:59 +0000 (16:34 +0200)] 
repart: Add ratelimitting for progress updates

Same logic as in systemd-import, this is especially important when
systemd-repart is not run from a tty as currently we'll get something
like this:

```
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  98%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G  99%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G 100%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G 100%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G 100%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G 100%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G 100%
/var/tmp/.#repartc256fb6b9dc517af → /work/var/tmp/mkosi-workspace-2ek2c3n1/repart-definitions/10-root.conf 1.7G/1.7G 100%
```

5 months agorepart: Improve logging in resolve_copy_blocks_auto()
Daan De Meyer [Mon, 2 Jun 2025 14:02:58 +0000 (16:02 +0200)] 
repart: Improve logging in resolve_copy_blocks_auto()

5 months agoBugprone argument comment 8 (#37678)
Yu Watanabe [Tue, 3 Jun 2025 01:58:52 +0000 (10:58 +0900)] 
Bugprone argument comment 8 (#37678)

Follow up from https://github.com/systemd/systemd/pull/37556

5 months agotest: send monotonic timestamp rather than unix seconds for MONOTONIC_USEC= argument
Luca Boccassi [Mon, 2 Jun 2025 18:45:02 +0000 (19:45 +0100)] 
test: send monotonic timestamp rather than unix seconds for MONOTONIC_USEC= argument

Follow-up for 3998b30a040d1494918e11c78ef3eae72532bbca

5 months agocompress: prevent divide-by-zero when no data is read (#37706)
Alex [Tue, 3 Jun 2025 01:51:00 +0000 (21:51 -0400)] 
compress: prevent divide-by-zero when no data is read (#37706)

If the first call to `loop_read()` returns 0 (no input), `total_in`
remains 0, causing `total_out/total_in` to potential divide by zero.

We add a check before logging the compression ratio to skip the
percentage calculation when total_in is zero.

Co-authored-by: jinyaoguo <guo846@purdue.edu>
5 months agonetwork: fix a potential divide-by-zero (#37705)
Alex [Mon, 2 Jun 2025 22:47:49 +0000 (18:47 -0400)] 
network: fix a potential divide-by-zero (#37705)

In function `tc_init`, hz is parsed from the content of file
`"/proc/net/psched"` and can be 0.
In function `hierarchy_token_bucket_class_verify`, hz is directly used
as a divisor in
`htb->buffer = htb->rate / hz + htb->mtu;` without any check. This adds a check on hz before using it as a divisor.

Co-authored-by: jinyaoguo <guo846@purdue.edu>
5 months agoman/systemd-creds: fix documentation typo in systemd.exec.xml
Anton Ryzhov [Mon, 2 Jun 2025 22:20:30 +0000 (00:20 +0200)] 
man/systemd-creds: fix documentation typo in systemd.exec.xml

5 months agohwdb: fix touchpad for ASUS X1504ZA (#37696)
Michał Moczulski [Mon, 2 Jun 2025 20:12:07 +0000 (22:12 +0200)] 
hwdb: fix touchpad for ASUS X1504ZA (#37696)

Added udev rule generated by `libinput measure fuzz --fuzz=8`, which
fixes my touchpad.

5 months agoshared/install.h: rename 'flags' -> 'file_flags' 37678/head
Jelle van der Waa [Mon, 2 Jun 2025 15:55:53 +0000 (17:55 +0200)] 
shared/install.h: rename 'flags' -> 'file_flags'

Make it consistent with the implementation.

5 months agoio-util: rename 'nfds' -> 'n_fds'
Jelle van der Waa [Mon, 2 Jun 2025 15:42:08 +0000 (17:42 +0200)] 
io-util: rename 'nfds' -> 'n_fds'

5 months agouid-range: correct argument comment
Jelle van der Waa [Sun, 1 Jun 2025 08:18:38 +0000 (10:18 +0200)] 
uid-range: correct argument comment

5 months agosd-varlink: fix argument naming
Jelle van der Waa [Wed, 28 May 2025 18:57:33 +0000 (20:57 +0200)] 
sd-varlink: fix argument naming

5 months agosd-journal: rename sd_journal_get_monotonic_usec ret argument
Jelle van der Waa [Sun, 25 May 2025 17:53:24 +0000 (19:53 +0200)] 
sd-journal: rename sd_journal_get_monotonic_usec ret argument

Rename ret to ret_monotonic to distinguish from ret_boot_id and
according to existing argument comments.

5 months agomount-util: correct argument comment
Jelle van der Waa [Sun, 25 May 2025 17:46:47 +0000 (19:46 +0200)] 
mount-util: correct argument comment

5 months agonspawn: correct argument comments
Jelle van der Waa [Sun, 25 May 2025 17:45:37 +0000 (19:45 +0200)] 
nspawn: correct argument comments

5 months agoenv-util: rename 'n' -> 'length'
Jelle van der Waa [Sun, 25 May 2025 17:43:45 +0000 (19:43 +0200)] 
env-util: rename 'n' -> 'length'

5 months agonss-systemd/userdb drop-ins: various doc updates (#37693)
Lennart Poettering [Mon, 2 Jun 2025 15:02:20 +0000 (17:02 +0200)] 
nss-systemd/userdb drop-ins: various doc updates (#37693)

This mostly adds crosslinks from various bits and pieces of userdb docs
to each other, and adds some clarifications.

Fixes: #27208
5 months agoDeduplicate error string patterns (#37676)
Zbigniew Jędrzejewski-Szmek [Mon, 2 Jun 2025 13:34:17 +0000 (15:34 +0200)] 
Deduplicate error string patterns (#37676)

I wanted to see if moving moving out constant string arguments our of
error messages results in smaller binary sizes. Turns out it does, but
the savings are not consistent. Sometimes we get a few kB in a single
binary, sometimes there is no size change.

5 months agoman: emphasize that systemd-userdb-load-credentials.service doesn't do UID/GID allocation 37693/head
Lennart Poettering [Mon, 2 Jun 2025 13:15:33 +0000 (15:15 +0200)] 
man: emphasize that systemd-userdb-load-credentials.service doesn't do UID/GID allocation

5 months agoman: add reference from userdbctl man page to nss-systemd regarding user record drop-ins
Lennart Poettering [Mon, 2 Jun 2025 13:15:11 +0000 (15:15 +0200)] 
man: add reference from userdbctl man page to nss-systemd regarding user record drop-ins

5 months agoman: mention systemd-userdb-load-credentials.service when discussing /run/userdb...
Lennart Poettering [Mon, 2 Jun 2025 13:14:43 +0000 (15:14 +0200)] 
man: mention systemd-userdb-load-credentials.service when discussing /run/userdb/ drop-ins

5 months agorepart: fix generation of UUID= line for vfat in fstab entries (#37689)
Lennart Poettering [Mon, 2 Jun 2025 10:25:14 +0000 (12:25 +0200)] 
repart: fix generation of UUID= line for vfat in fstab entries (#37689)

Fixes: #36735
5 months agoDefine uid range for greeter
Adrian Vovk [Wed, 21 May 2025 21:32:03 +0000 (17:32 -0400)] 
Define uid range for greeter

In multi-seat scenarios, a display manager might need to start multiple
greeter sessions. But systemd allows at most one graphical session per
user. So, display managers now have a range of UIDs to dynamically
allocate users for their greeter sessions.

5 months agovarious: do not include file names directly in error messages 37676/head
Zbigniew Jędrzejewski-Szmek [Mon, 2 Jun 2025 08:30:34 +0000 (10:30 +0200)] 
various: do not include file names directly in error messages

git grep -l 'Failed to open /'|xargs sed -r -i 's|"Failed to open (/[^ ]+): %m"|"Failed to open %s: %m", "\1"|g'
git grep -l $'Failed to open \'/'|xargs sed -r -i $'s|"Failed to open \'(/[^ ]+)\': %m"|"Failed to open %s: %m", "\\1"|g'
git grep -l "Failed to open /"|xargs sed -r -i $'s|"Failed to open (/[^ ]+), ignoring: %m"|"Failed to open %s, ignoring: %m", "\\1"|g'
+ some manual fixups.

5 months agobuild(deps): bump github/codeql-action from 3.28.10 to 3.28.18
dependabot[bot] [Sun, 1 Jun 2025 09:12:40 +0000 (09:12 +0000)] 
build(deps): bump github/codeql-action from 3.28.10 to 3.28.18

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.10 to 3.28.18.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d...ff0a06e83cb2de871e5a09832bc6a81e7276941f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agoudevadm: allow to specify device by device ID (#37636)
Yu Watanabe [Mon, 2 Jun 2025 09:02:36 +0000 (18:02 +0900)] 
udevadm: allow to specify device by device ID (#37636)

5 months agorepart: set a useful access mode file for generated fstab files 37689/head
Lennart Poettering [Mon, 2 Jun 2025 08:12:33 +0000 (10:12 +0200)] 
repart: set a useful access mode file for generated fstab files

We create these as temporary files with 0600 access mode. Let's adjust
this before we install the files.

5 months agorepart: fix generation of UUID= line for vfat in fstab entries
Lennart Poettering [Mon, 2 Jun 2025 08:12:10 +0000 (10:12 +0200)] 
repart: fix generation of UUID= line for vfat in fstab entries

Fixes: #36735
5 months agobuild(deps): bump meson from 1.6.1 to 1.8.1 in /.github/workflows
dependabot[bot] [Sun, 1 Jun 2025 09:30:36 +0000 (09:30 +0000)] 
build(deps): bump meson from 1.6.1 to 1.8.1 in /.github/workflows

Bumps [meson](https://github.com/mesonbuild/meson) from 1.6.1 to 1.8.1.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.6.1...1.8.1)

---
updated-dependencies:
- dependency-name: meson
  dependency-version: 1.8.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agobuild(deps): bump super-linter/super-linter from 7.3.0 to 7.4.0
dependabot[bot] [Sun, 1 Jun 2025 09:12:31 +0000 (09:12 +0000)] 
build(deps): bump super-linter/super-linter from 7.3.0 to 7.4.0

Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter) from 7.3.0 to 7.4.0.
- [Release notes](https://github.com/super-linter/super-linter/releases)
- [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/super-linter/super-linter/compare/4e8a7c2bf106c4c766c816b35ec612638dc9b6b2...12150456a73e248bdc94d0794898f94e23127c88)

---
updated-dependencies:
- dependency-name: super-linter/super-linter
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agoUpdate TODO
Lennart Poettering [Mon, 2 Jun 2025 07:34:59 +0000 (09:34 +0200)] 
Update TODO

5 months agorepart: CopyBlocks=auto fix for verity-sig partitions (#37688)
Daan De Meyer [Mon, 2 Jun 2025 07:15:46 +0000 (09:15 +0200)] 
repart: CopyBlocks=auto fix for verity-sig partitions (#37688)

Alternative to: #37687

5 months agorepart: make CopyBlock=auto work for verity sig partitions 37688/head
Lennart Poettering [Mon, 2 Jun 2025 04:43:09 +0000 (06:43 +0200)] 
repart: make CopyBlock=auto work for verity sig partitions

Note that this doesn't care which partition set (A or B in an A/B
scenario) is actually newer, it just picks the first suitable, but
that's something we should look into later. For now, let's just make
verity sig partitions work the same way as verity partitions.

Fixes #34835

5 months agorepart: make use of blkid_partition_get_type_id128() more
Lennart Poettering [Mon, 2 Jun 2025 04:42:52 +0000 (06:42 +0200)] 
repart: make use of blkid_partition_get_type_id128() more

5 months agorepart: Apply verity-sig max size based on partition type
Daan De Meyer [Sun, 1 Jun 2025 18:24:47 +0000 (20:24 +0200)] 
repart: Apply verity-sig max size based on partition type

We already do this for partition_min_size(), let's do it for
partition_max_size() as well. This makes sure repart doesn't accidentally
try to grow verity sig partitions to larger sizes than the hardcoded
max size in systemd.

5 months agobootctl: fix unclosed quote in debug log
Joaquim Monteiro [Sat, 31 May 2025 18:56:28 +0000 (19:56 +0100)] 
bootctl: fix unclosed quote in debug log

5 months agomount-util: avoid unnecessary mount_setattr() call in make_fsmount()
Lennart Poettering [Sat, 31 May 2025 05:58:30 +0000 (07:58 +0200)] 
mount-util: avoid unnecessary mount_setattr() call in make_fsmount()

If .attr_set is zero (and .att_clr, .propagation too), then there's no
point in calling mount_setattr().

Fixes: #37062
Note that this optimization is not precisely load-bearing anymore, since
3cc23a2c2345eb188551565349c89ec1fa8f650f got merged which removes the
only caller of make_fsmount() that might trigger it. But it's worth
fixing generic code anyway, in case it gets used like this later again.

5 months agocore/smack-setup: use RET_NERRNO and RET_GATHER
Zbigniew Jędrzejewski-Szmek [Sat, 31 May 2025 14:36:43 +0000 (16:36 +0200)] 
core/smack-setup: use RET_NERRNO and RET_GATHER

5 months agocore/smack-setup: rework message to include full paths to files
Zbigniew Jędrzejewski-Szmek [Sat, 31 May 2025 14:03:55 +0000 (16:03 +0200)] 
core/smack-setup: rework message to include full paths to files

We'd print the filename, but not the full path. Error messages without
the full path are annoying to users since they might not know where the file
is located, esp. if the name is fairly generic, and it is harder to search
for the error message too.

Use a trailing slash to indicate when we're trying to open a directory.
Drop quotes from around paths which are static and known to contain no
whitespace.

5 months agocore: do not include names directly in error messages
Zbigniew Jędrzejewski-Szmek [Sat, 31 May 2025 13:28:35 +0000 (15:28 +0200)] 
core: do not include names directly in error messages

This allows some strings constants to be deduplicated.
libsystemd-core.so + systemd are about 2k smaller.

Also tweak some messages for consistency. We used 'exec' in one place and
'execute' in all other messages.

5 months agosd-device: do not include file name directly in error messages
Zbigniew Jędrzejewski-Szmek [Sat, 31 May 2025 13:18:37 +0000 (15:18 +0200)] 
sd-device: do not include file name directly in error messages

$ diff -u <(strings -n 10 build/libsystemd.so.0.40.0.0 | sort) <(strings -n 10 build/libsystemd.so.0.40.0 | sort)
--- /proc/self/fd/11    2025-05-31 15:17:16.968761963 +0200
+++ /proc/self/fd/12    2025-05-31 15:17:16.970159823 +0200
@@ -3860,11 +3860,6 @@
 Failed to fstat() journal file '%s', ignoring: %m
 Failed to fstat %s: %m
 Failed to get basic: %m
-Failed to get device "ACTION" property, ignoring: %m
-Failed to get device "DEVNUM" property, ignoring: %m
-Failed to get device "DISKSEQ" property, ignoring: %m
-Failed to get device "IFINDEX" property, ignoring: %m
-Failed to get device "SEQNUM" property, ignoring: %m
 Failed to get device "%s" property, ignoring: %m
 Failed to get inode number of pidfd for pid %i: %m
 Failed to get peer's socket address, ignoring: %m

$ ls -l build/libsystemd.so.0.40.0{,.0}
-rwxr-xr-x 1 zbyszek zbyszek 7631640 May 31 15:16 build/libsystemd.so.0.40.0
-rwxr-xr-x 1 zbyszek zbyszek 7635736 May 31 15:16 build/libsystemd.so.0.40.0.0

$ size build/libsystemd.so.0.40.0{,.0}
   text    data     bss     dec     hex filename
1241382   56185    3554 1301121  13da81 build/libsystemd.so.0.40.0
1241606   56185    3554 1301345  13db61 build/libsystemd.so.0.40.0.0

So the savings are ~4kB, which is more than I expected.

5 months agosleep: do not include file name directly in error messages
Zbigniew Jędrzejewski-Szmek [Sat, 31 May 2025 13:14:36 +0000 (15:14 +0200)] 
sleep: do not include file name directly in error messages

Here the .text section becomes smaller, but the file size doesn't change
(I guess some alignment issue). But is seems to be reasonable change to
anyway, we might get some savings in different compilations anyway.

Also improve two messages.

5 months agorandom-seed: do not include file name directly in error messages
Zbigniew Jędrzejewski-Szmek [Sat, 31 May 2025 11:43:32 +0000 (13:43 +0200)] 
random-seed: do not include file name directly in error messages

The path is fairly long and by embedding it in the message, we get a longer
data section in our binary. By using %s, we can make the template strings
shorter, deduplicating bytes in our binary. Those are error messages, i.e. by
definition they are only used very rarely, so it's completely fine if printf
does a bit more work when generating the message.

$ strings build/systemd-random-seed.0 | rg '/var/lib/systemd/random-seed'
/var/lib/systemd/random-seed
Failed to open /var/lib/systemd/random-seed for writing: %m
Failed to open /var/lib/systemd/random-seed for reading: %m
Failed to open /var/lib/systemd/random-seed: %m
Failed to stat() seed file /var/lib/systemd/random-seed: %m
Failed to read seed from /var/lib/systemd/random-seed: %m
Seed file /var/lib/systemd/random-seed not yet initialized, proceeding.

$ strings build/systemd-random-seed | rg '/var/lib/systemd/random-seed'
/var/lib/systemd/random-seed

$ ls -l build/systemd-random-seed{,.0}
-rwxr-xr-x 1 zbyszek zbyszek 68872 May 31 13:39 build/systemd-random-seed.0
-rwxr-xr-x 1 zbyszek zbyszek 64912 May 31 13:45 build/systemd-random-seed
That's a ~6% smaller binary!

5 months agotree-wide: only use .si_pid field in siginfo_t, if .si_code indicates that's safe
Lennart Poettering [Thu, 29 May 2025 06:22:07 +0000 (08:22 +0200)] 
tree-wide: only use .si_pid field in siginfo_t, if .si_code indicates that's safe

Fixes: #37498
5 months agobootctl: do not print slash more than once
Yu Watanabe [Sat, 31 May 2025 01:24:17 +0000 (10:24 +0900)] 
bootctl: do not print slash more than once

When bootctl is called by an unprivileged user, then previously we got
```
Failed to read "/boot/EFI/systemd": Permission denied
Failed to open '/boot//loader/loader.conf': Permission denied
```
Now, with this patch, we get
```
Failed to read "/boot/EFI/systemd": Permission denied
Failed to open '/boot/loader/loader.conf': Permission denied
```

5 months agoportable,sysext: match extension OS ID also against host ID_LIKE
Christian Glombek [Thu, 29 May 2025 14:53:19 +0000 (16:53 +0200)] 
portable,sysext: match extension OS ID also against host ID_LIKE

5 months agotest: wait for coredump to appear before parsing
Luca Boccassi [Fri, 30 May 2025 21:08:39 +0000 (22:08 +0100)] 
test: wait for coredump to appear before parsing

A new core was added to the test, but the loop counter was not increased
to wait for it, so the test races against systemd-coredump's processing.

This failed at least once in debci:

8015s [   32.227813] TEST-87-AUX-UTILS-VM.sh[1038]: + coredumpctl info COREDUMP_TIMESTAMP=1679509902000000
8015s [   32.228684] TEST-87-AUX-UTILS-VM.sh[1723]: No coredumps found.

Follow-up for 0c49e0049b7665bb7769a13ef346fef92e1ad4d6

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

5 months agoterminal-util: fix typo
Yu Watanabe [Fri, 30 May 2025 19:42:59 +0000 (04:42 +0900)] 
terminal-util: fix typo

Follow-up for 5321b957b4027be66873eac730d4ce141021e368.

5 months agodocs: add man page for sd_device_enumerator_get_device_first() and friends
Shubhendra Kushwaha [Sun, 25 May 2025 15:17:31 +0000 (20:47 +0530)] 
docs: add man page for sd_device_enumerator_get_device_first() and friends

For #20929.

5 months agocore/cgroup: update comment
Yu Watanabe [Fri, 30 May 2025 19:14:58 +0000 (04:14 +0900)] 
core/cgroup: update comment

We do not have SetProperty() method, but SetProperties().