Commit Graph

84789 Commits

Author SHA1 Message Date
Daan De Meyer
475729b805 run0: Make --same-root-dir available for run0
This enables running something like
"mkosi box -- run0 --empower --same-root-dir -E PATH" to get an
empowered session as the current user within the "mkosi box" environment.
2025-11-14 10:36:53 +01:00
Luca Boccassi
98ae19d9fe integritysetup: Add support for hmac-sha512 and wrapped key HMAC algorithms phmac-sha256 and phmac-sha512 (#39719)
Currently the only supported integrity algorithm using HMAC is
`hmac-sha256`. Add `hmac-sha512` to the list of supported algorithms as
well.

Also add the `PHMAC` integrity algorithm to the list of supported
algorithms. The `PHMAC` algorithm is like the regular HMAC algorithm,
but it takes a wrapped key as input. A key for the `PHMAC` algorithm is
an opaque key blob, who's physical size has nothing to do with the
cryptographic size. Such a wrapped key can for example be a HSM
protected key. Currently PHMAC is only available for the s390x
architecture (Linux on IBM Z).

Support for PHMAC has just been added to the cryptsetup project via MR
https://gitlab.com/cryptsetup/cryptsetup/-/merge_requests/693 by commit

296eb39c60

To allow automatic opening of integrity protected volumes that use PHMAC
via `/etc/integritytab`, this change in systemd's integritysetup tool is
needed as well.
2025-11-14 00:12:34 +00:00
Chris Down
7f9c0c31d2 sd-dhcp-server: Add Hostname= option to static leases
This adds a new `Hostname=` option to the [DHCPServerStaticLease]
section in .network files, allowing an administrator to assign a
specific hostname to a client receiving a static lease.

We automatically select the correct DHCP option to use based on the
format of the provided string:

- Single DNS labels are sent as Option 12.
- Names with multiple DNS labels are sent as Option 81 in wire format.

Fixes: #39634
2025-11-14 07:50:13 +09:00
Yu Watanabe
c83f3f0837 musl: add several missing symbols (#39701) 2025-11-14 07:49:16 +09:00
Yu Watanabe
aeb5fb83ca Three follow-ups for recent changes (#39724) 2025-11-14 07:48:47 +09:00
Mike Yuan
fa0ac03a56 stdio-bridge: remove unreachable return 2025-11-13 21:28:17 +01:00
Mike Yuan
045b8d761e run: refuse --root-directory= in --scope mode
As discussed in #39669, let's reject this for now.
2025-11-13 21:17:32 +01:00
Mike Yuan
b0e7c6141f efivars: insert a newline below fstat() call 2025-11-13 21:17:32 +01:00
Yu Watanabe
69dd6d9420 musl: add several missing statx macros
glibc's sys/stat.h includes linux/stat.h, and we have copy of it from
the latest kernel, hence all new flags are always defined.
However, musl's sys/stat.h does not include linux/stat.h, and moreover,
they conflict with each other, hence we cannot include both header
simultaneously. Let's define missing macros to support musl.
2025-11-14 04:59:03 +09:00
Chen Qi
dd102894e7 musl: add missing FTW_CONTINUE macro
This is to avoid build failures like below for musl.

  test-recurse-dir.c:23:24: error: ‘FTW_CONTINUE’ undeclared

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2025-11-14 04:59:03 +09:00
Yu Watanabe
8324ef4213 musl: replace netinet/if_ether.h with our own implementation
musl's netinet/if_ether.h conflicts with linux/if_ether.h.
The reimplementation is mostly equivalent with what glibc does.
2025-11-14 04:59:03 +09:00
Yu Watanabe
6400e8dbd9 musl: provide several missing definitions for prctl() 2025-11-14 04:59:03 +09:00
Yu Watanabe
03d0fa4e4f musl: introduce dummy function for gnu_get_libc_version()
As the header gnu/libc-version.h and gnu_get_libc_version() function
are glibc specific, and musl does not provide them.
2025-11-14 04:59:03 +09:00
Yu Watanabe
bc610c70af musl: introduce dummy functions for mallinfo(), malloc_info(), and malloc_trim()
These functions are not provided by musl.
2025-11-14 04:59:03 +09:00
Yu Watanabe
a2b7bcce27 musl: introduce dummy gshadow header file for userdb
Even 'gshadow' meson option is disabled, src/shared/userdb.c and
src/shared/user-record-nss.c include gshadow.h unconditionally.
Let's introduce dummy header to make them compiled gracefully.
2025-11-14 04:59:03 +09:00
Bastian Almendras
a0d1dc662a hwdb: add entry for Acer Switch One 10 (SW1-011) (#39716)
Add the correct rotation for Acer Switch One 10 (SW1-011)
2025-11-14 04:33:47 +09:00
Antonio Alvarez Feijoo
3eabddbe9f gpt-auto-generator: fix typo in crypttab option name
Spotted while debugging a ParticleOS build:

```
Nov 13 14:44:32 localhost systemd-cryptsetup[591]: Encountered unknown /etc/crypttab option 'tpm2-measure-slot-nvpcr=cryptsetup', ignoring.
```

Follow-up for e5a2e78665
2025-11-14 03:50:15 +09:00
Yu Watanabe
aec0e63a4f musl: test: several random fixlets for unit tests 2025-11-14 03:29:21 +09:00
Yu Watanabe
be33b202e6 core: record transactions that have seen ordering cycles and expose them via IPC (#39210)
Closes #3829.
2025-11-14 00:41:46 +09:00
Yu Watanabe
3db66ed388 Make systemd stdio bridge quiet (#39718) 2025-11-14 00:39:15 +09:00
Yu Watanabe
1abe8dd9eb efivarfs readv() size fixes and more (#39715)
Fixes: #39695
2025-11-14 00:38:29 +09:00
Yu Watanabe
32d1bed50b tree-wide: assorted fixes/workarounds for supporting musl (#39687) 2025-11-14 00:16:50 +09:00
Ingo Franzki
eb7b0d413e integritysetup: Add PHMAC algorithm to list of known algorithms
Add the PHMAC integrity algorithm to the list of supported algorithms.

The PHMAC algorithm is like the regular HMAC algorithm, but it takes a wrapped key
as input. A key for the PHMAC algorithm is an opaque key blob, who's physical size
has nothing to do with the cryptographic size. Currently PHMAC is only available
for the s390x architecture.
2025-11-13 16:14:25 +01:00
Daan De Meyer
59a81bbb80 sd-bus: Pass --user and --quiet to systemd-stdio-bridge if local
If we're switching users but not entering a container, then we can
assume that new switches for systemd-stdio-bridge are available, so
make use of them in that case.
2025-11-13 14:45:51 +01:00
Daan De Meyer
dcf8bdf01d stdio-bridge: Fix --user
If --user was specified we would still try to use the system bus
address.
2025-11-13 14:45:51 +01:00
Daan De Meyer
8bb6f4f164 stdio-bridge: Add --quiet option
When we use stdio-bridge via sd-bus to connect to a bus of a different
user, container or host, stdio-bridge should not log at error level but
at debug level as it's invoked by the sd-bus library and sd-bus should
generally not log above debug level.

We can't actually use the --quiet option yet as that would break connecting
to hosts running older versions of systemd but let's already add the option
now in preparation for a brighter future.
2025-11-13 14:45:51 +01:00
Daan De Meyer
0d91a204cb bus-wait-for-jobs: Make sure we always debug log
If we're not logging at a higher priority level, let's still log
at debug log level to help with debugging.
2025-11-13 14:45:51 +01:00
Daan De Meyer
164fc38888 shared: Forward declare InstallChange in shared-forward.h 2025-11-13 14:41:25 +01:00
Lennart Poettering
f5452477d4 tree-wide: fix lseek() parameter order
The offset must be specified first, 'whence' second. Fix that.

Except for one case this fix doesn't actually fix any real bug, since
SEEK_SET is defined as 0 anyway, hence the swapped arguments have no
effect.

The one exception is the MTD smartmedia code, which I guess indicates
that noone has been using that hw anymore in a long time?
2025-11-13 14:19:29 +01:00
Lennart Poettering
dbc25d84ae efivars: seek back to beginning in each efi_get_variable() loop
We try to read again from the beginning, hence let's seek back.
Apparently efivarfs doesn't strictly require this, but it's really weird
that it doesn't.
2025-11-13 14:19:29 +01:00
Lennart Poettering
40cb2aa4f8 efivars: validate we are actually talking about a regular file
We already have the stat data, let's actually check if things are
alright before relying on .st_size
2025-11-13 14:19:29 +01:00
Lennart Poettering
ab69a04600 efivars: fix size checks in efi_get_variable()
writev() returns the full size, not just the payload size, hence always
add sizeof(attr) where necessary.

Let's also change a couple of "4" into sizeof(attr) all over the place,
to make clear what they are about.

Fixes: #39695
Follow-up for: 9db9d6806e
2025-11-13 14:19:29 +01:00
Lennart Poettering
88e26303ce efivars: don't bother with realloc() if we have no interest in the old data
We shouldn't ask glibc to keep the old data around (which realloc() is
about), given we overwrite it entirely anyway. Let's hence speed things
up here, and allow glibc to just allocate a new block for us (and
shorten the code a bit)
2025-11-13 12:37:08 +01:00
Ingo Franzki
7bf1cfe3b2 integritysetup: Add support for hmac-sha512
Currently the only supported integrity algorithm using HMAC is 'hmac-sha256'.
Add 'hmac-sha512' to the list of supported algorithms as well.
2025-11-13 10:25:08 +01:00
Zbigniew Jędrzejewski-Szmek
00725c3c4f Make journal persistent by default (#39624)
See second commit for details.
2025-11-13 09:43:00 +01:00
Daan De Meyer
c50a8fc22f test: use new macros and move several test cases (#39708) 2025-11-13 09:42:12 +01:00
Mike Yuan
6dd412bc50 time-util: do not carry musl-specific fallback logic on glibc systems
Follow-up for 3ac4d68498

We have no sensible way to detect why strptime() fails, hence
the fallback path as it is now would fire on glibc systems too,
pointlessly. Let's guard it behind ifdeffery.
2025-11-13 09:40:20 +01:00
Yu Watanabe
4a028994df user-util: fix typo
Follow-up for b10fd796f5.
2025-11-13 15:36:47 +09:00
Yu Watanabe
e9c5af74ea test: move several test cases to test-tmpfile-util.c 2025-11-13 09:19:56 +09:00
Yu Watanabe
6300e2a9ee test: move several test cases to test-env-file.c 2025-11-13 09:19:56 +09:00
Yu Watanabe
cd62f9ad71 test-fileio: migrate to use new ASSER_OK() macro and friends
This also replaces fgets() with read_full_file().
2025-11-13 09:19:28 +09:00
Luca Boccassi
5b3874929a mkosi: update debian commit reference to efdd7a6377c7251011ca2c1a59115d482d25fe61
* efdd7a6377 Install new file for upstream build
* 9ebdc6099e d/rules: enable 10-systemd-logind-root-ignore-inhibitors.rules.example on Ubuntu
* 1255cc7663 initramfs-tools: only skip chzdev rules if zdev_early=0
* 4675b281ee d/t/boot-and-services: skip apparmor test on armhf
* 214d6e37b2 d/t/boot-and-services: run transient unit to check syslog messages
* f4e196aa26 d/t/boot-and-services: tweak test_rsyslog regex
* dbd366a43e Install new files for upstream build
* bb7f8ef532 Install new files for upstream build
* efa7cee8a7 Install new file for upstream build
* 95aa1d1685 Install new file for upstream build
* b770f0f01b kernel-install: skip 55-initrd.install when an initrd generator is configured
* af8d1e3134 Update changelog for 258.1-2 release
* 2d0e73cd14 d/libnss-systemd.postinst: Ensure module is enabled for all four databases
2025-11-12 23:39:45 +00:00
Zbigniew Jędrzejewski-Szmek
2eaceed0b1 journald: do not allow persistent journal storage in the initrd
If the user managed to configure persistent storage in the journal
in the initrd, e.g. by creating /var/log/journal with default of 'auto',
we could end up writing entries there. Let's make sure this doesn't
happen.
2025-11-13 00:08:31 +01:00
Zbigniew Jędrzejewski-Szmek
238bb65c0f meson: make persistent journal the default 2025-11-13 00:08:31 +01:00
Zbigniew Jędrzejewski-Szmek
7af88c1e1e journald: allow default storage mode to be configured
So far the idea was that the default is 'auto', and if appropriate, the
distribution will create /var/log/journal/ to tell journald to use persistent
mode. This doesn't work well with factory resets, because after a factory reset
obviously /var/log is gone. That old default was useful when journald was new
and people were reluctant to enable persistent mode and instead relied on
rsyslog and such for the persistent storage. But nowadays that is rarer, and
anyway various features like user journals only work with persistent storage,
so we want people to enable this by default. Add an option to flip the default
and distributions can opt in. The default default value remains unchanged.

(I also tested using tmpfiles to instead change this, since we already set
access mode for /var/log/journal through tmpfiles. Unfortunately, tmpfiles runs
too late, after journald has already started, so if tmpfiles creates the
directory, it'll only be used after a reboot. This probably could be made to
work by adding a new service to flush the journal, but that becomes complicated
and we lose the main advantage of simplicity.)

Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1387796.
2025-11-13 00:08:31 +01:00
Zbigniew Jędrzejewski-Szmek
7e9a787a86 man: stop inventing custom entity names for docbook
For some reason, the entity names configured in custom-entities.ent
used abbreviated names. This just creates unnecessary confusion, so update
to use the same name as the config dict.

Reword some surrounding sentences while at it.
2025-11-13 00:08:27 +01:00
Zbigniew Jędrzejewski-Szmek
e601bed945 meson: make journald.conf templated
A noop, in preparation for subsequent changes.
2025-11-13 00:07:12 +01:00
Yu Watanabe
a580dd4e53 musl: format-util: use %llu for formatting rlim_t
glibc uses uint32_t or uint64_t for rlim_t, while musl uses unsigned long long.
2025-11-13 08:02:05 +09:00
Yu Watanabe
4b774c740b musl: build-path: fix reading DT_RUNPATH or DT_RPATH
musl records DT_STRTAB as offset, rather than address. So, need to add
obtained bias to read runpath or rpath.
2025-11-13 08:02:05 +09:00
Yu Watanabe
3866923a68 musl: core: there is one less usable signal when built with musl
musl internally reserves one more signal, hence we can only use 29
signals.
2025-11-13 08:02:05 +09:00