Commit Graph
81925 Commits
Author SHA1 Message Date
Jelle van der Waa 2377cbcd19 mount-util: correct argument comment 2025-06-02 17:39:44 +02:00
Jelle van der Waa 09958bbb98 nspawn: correct argument comments 2025-06-02 17:39:44 +02:00
Jelle van der Waa d4f938aec1 env-util: rename 'n' -> 'length' 2025-06-02 17:39:43 +02:00
Lennart Poettering 30f6240bd2 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
2025-06-02 17:02:20 +02:00
Zbigniew Jędrzejewski-Szmek b83f69952b 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.
2025-06-02 15:34:17 +02:00
Lennart Poettering a9de5d7d84 man: emphasize that systemd-userdb-load-credentials.service doesn't do UID/GID allocation 2025-06-02 15:16:31 +02:00
Lennart Poettering c5fcf4ab59 man: add reference from userdbctl man page to nss-systemd regarding user record drop-ins 2025-06-02 15:16:31 +02:00
Lennart Poettering c4c0307f53 man: mention systemd-userdb-load-credentials.service when discussing /run/userdb/ drop-ins 2025-06-02 15:16:31 +02:00
Lennart Poettering 344309d6d9 repart: fix generation of UUID= line for vfat in fstab entries (#37689)
Fixes: #36735
2025-06-02 12:25:14 +02:00
Adrian Vovk 554130faf3 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.
2025-06-02 11:19:12 +02:00
Zbigniew Jędrzejewski-Szmek 42ba99748d 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.
2025-06-02 11:10:38 +02:00
dependabot[bot] 2dcf0ee0ef 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>
2025-06-02 18:03:15 +09:00
Yu Watanabe 0436240dd2 udevadm: allow to specify device by device ID (#37636) 2025-06-02 18:02:36 +09:00
Lennart Poettering a27e58892e 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.
2025-06-02 10:12:33 +02:00
Lennart Poettering 8504721e0e repart: fix generation of UUID= line for vfat in fstab entries
Fixes: #36735
2025-06-02 10:12:10 +02:00
dependabot[bot] 6b805724cc 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>
2025-06-02 16:57:24 +09:00
dependabot[bot] 4eeb8bb388 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>
2025-06-02 16:55:21 +09:00
Lennart Poettering 83f8c15dea Update TODO 2025-06-02 09:34:59 +02:00
Daan De Meyer 08a3afc5a1 repart: CopyBlocks=auto fix for verity-sig partitions (#37688)
Alternative to: #37687
2025-06-02 09:15:46 +02:00
Lennart Poettering 253acf116c 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
2025-06-02 06:45:09 +02:00
Lennart Poettering a15c5517e0 repart: make use of blkid_partition_get_type_id128() more 2025-06-02 06:44:58 +02:00
Daan De Meyer 92d888235e 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.
2025-06-01 21:19:53 +02:00
Joaquim Monteiro c9e614eb25 bootctl: fix unclosed quote in debug log 2025-06-01 11:34:17 +09:00
Lennart Poettering 249752d1ec 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
3cc23a2c23 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.
2025-06-01 03:14:02 +09:00
Zbigniew Jędrzejewski-Szmek 3f1812180b core/smack-setup: use RET_NERRNO and RET_GATHER 2025-05-31 16:36:43 +02:00
Zbigniew Jędrzejewski-Szmek 5890a77540 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.
2025-05-31 16:03:55 +02:00
Zbigniew Jędrzejewski-Szmek 2b2ca7ff2a 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.
2025-05-31 15:35:02 +02:00
Zbigniew Jędrzejewski-Szmek 9e2befbf4b 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.
2025-05-31 15:35:02 +02:00
Zbigniew Jędrzejewski-Szmek 4df8fc99ce 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.
2025-05-31 15:34:53 +02:00
Zbigniew Jędrzejewski-Szmek 53059edcb4 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!
2025-05-31 14:49:16 +02:00
Lennart Poettering 1105f8d20f tree-wide: only use .si_pid field in siginfo_t, if .si_code indicates that's safe
Fixes: #37498
2025-05-31 14:48:37 +02:00
Yu Watanabe 91c60ff528 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
```
2025-05-31 13:53:04 +02:00
Christian Glombek 0af9937691 portable,sysext: match extension OS ID also against host ID_LIKE 2025-05-31 10:02:11 +09:00
Luca Boccassi 703fbb0bba 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 0c49e0049b

Fixes https://github.com/systemd/systemd/issues/37666
2025-05-31 10:01:30 +09:00
Yu Watanabe 3ec92f2f74 terminal-util: fix typo
Follow-up for 5321b957b4.
2025-05-31 04:44:34 +09:00
Shubhendra Kushwaha 2948f981dd docs: add man page for sd_device_enumerator_get_device_first() and friends
For #20929.
2025-05-31 04:40:33 +09:00
Yu Watanabe 8e9c003e29 core/cgroup: update comment
We do not have SetProperty() method, but SetProperties().
2025-05-31 04:15:04 +09:00
Yu Watanabe ab5587d674 core/transaction: restart dependency loop when a new dependency is added (#37465)
Fixes #36031.
2025-05-31 04:01:06 +09:00
Yu Watanabe e018cf0c67 TODO: drop entry about removal of unnecessary INTERFACE_OLD check in udevadm trigger
Done by fde9f2bc48.
2025-05-31 03:46:53 +09:00
Luca Boccassi fe8cdd18d6 docs: small improvements for html man pages menu selector (#37663)
Result is already live at
https://www.freedesktop.org/software/systemd/man
2025-05-30 12:33:48 +01:00
Luca Boccassi 90b0222091 sync-docs: add '(latest stable)' next to the latest version in the menu
Add visual indicator of what is the latest version in the
version menu
2025-05-30 11:54:01 +01:00
Luca Boccassi 1cd995185b sync-docs: fix selection menu when opening 'latest' man
'devel' will always sort first, so the highest version is the second
entry, not the first one
2025-05-30 11:54:01 +01:00
Luca Boccassi 34d63ac879 sync-docs: fix syntax warning
sync-docs.py:94: SyntaxWarning: invalid escape sequence '\d'
  m = re.match("v?(\d+).*", tag)
2025-05-30 11:54:01 +01:00
Zbigniew Jędrzejewski-Szmek 2e8d47f21c core/exec-invoke: rework $TERM fallback logic (#37647)
Inspired by https://github.com/systemd/systemd/pull/37538, see a
detailed rationale in
https://github.com/systemd/systemd/pull/37538#discussion_r2110229075.
2025-05-30 12:39:51 +02:00
Eisuke Kawashima 9521222222 chore: fix editorconfig pattern and add setting for zsh 2025-05-30 14:53:45 +09:00
Jörg Behrmann 5b5155dbf8 NEWS: fix typos 2025-05-30 06:26:57 +09:00
Mike Yuan 6131dc0aad core/exec-invoke: skip query of /dev/console $TERM if we're child of pid1 2025-05-29 21:25:28 +02:00
Mike Yuan 8ffebaaf4d core/exec-invoke: propagate $COLORTERM and $NO_COLOR from pid1 as well
Follow-up for 19aff5f775
2025-05-29 21:16:28 +02:00
Mike Yuan 3235fae685 core/exec-invoke: rework where to apply $TERM fallback logic
Follow-up for 728dbaeffb
and ad6ca4a612

This is inspired by #37538, see the discussion in
https://github.com/systemd/systemd/pull/37538#discussion_r2110229075.

If the user already specifies $TERM (which is actually
quite common if you look at run0), we'd needlessly invoke
the "fallback" logic and
a) possibly issue a DCS query whose result we end up simply
   discarding in strv_env_merge()
b) set $COLORTERM to "truecolor" unconditionally, whereas
   the explicit $TERM value might intend to disable the color output

To address this, the logic of setting fallback $TERM and friends
has been split out of build_environment(), and we'd call into it
only after all envvars have been collected.
2025-05-29 21:16:25 +02:00
Mike Yuan 94f533e305 core: strv_env_clean() modifies in-place, no need to set buf to itself 2025-05-29 21:01:43 +02:00