Commit Graph

84819 Commits

Author SHA1 Message Date
Lennart Poettering
89bfa9239e tpm2-util: add missing entry in string table
Follow-up for: e5a2e78665
2025-11-14 22:04:58 +01:00
Yu Watanabe
384e88a238 musl: stdio: check if stream is writable earlier in fputs() and friends 2025-11-15 05:10:33 +09:00
Yu Watanabe
08d207ba73 musl: introduce two wrappers (#39700) 2025-11-15 04:18:48 +09:00
Yu Watanabe
fd7d749494 core: add varlink Reload/Reexecute methods (#39561)
Same as the D-Bus ones
2025-11-15 04:17:01 +09:00
Nick Rosbrook
3d6eb1ed42 test: wait for interface to come online before checking DNS scopes
The current test is flaky because it creates a new interface definition,
calls networkctl reload, and then calls resolvectl show-cache. If
resolved has not received the changes and setup the DNS scopes for the
interface, show-cache will be empty for that interface.

Part 2 of #39602
2025-11-15 04:04:51 +09:00
Yu Watanabe
1569b1e25f tree-wide: use SD_JSON_BUILD_PAIR_* macros if possible (#39732) 2025-11-15 04:02:51 +09:00
Yu Watanabe
46ea7c3e32 musl: make strtoll() accept strings start with dot
glibc accepts strings start with '.' and returns 0, but musl refuses
them. Let's accept them, as our code assumes the function accept such
strings.
2025-11-15 03:41:40 +09:00
Yu Watanabe
bb7d5e52a2 musl: test-bus-error: drop ._need_free flag checks
Its value depends on how strerror_r() implemented, and the
implementations of the function in glibc and musl are actually
different. Let's drop the checks.
2025-11-15 03:39:35 +09:00
Yu Watanabe
ebb422dd2b musl: introduce GNU specific version of strerror_r()
musl provides XSI compliant strerror_r(), and it is slightly different
from the one by glibc.
Let's introduce a tiny wrapper to convert XSI strerror_r() to GNU one.

The wrapper also patches musl's spurious catchall error message.
2025-11-15 03:37:30 +09:00
Ivan Kruglov
b8ef90d6fd docs: initial version of varlink guideline 2025-11-14 17:54:20 +01:00
Jelle van der Waa
887db52362 elf-util: prefer using SD_JSON_BUILD_PAIR_* macros
No functional change, just refactoring.
2025-11-14 15:47:15 +01:00
Jelle van der Waa
1b636f1d3f ssh-generator: prefer using SD_JSON_BUILD_PAIR_STRING
No functional change, just refactoring.
2025-11-14 15:43:30 +01:00
Jelle van der Waa
7e5d718046 userdb: prefer using SD_JSON_BUILD_PAIR_* over SD_JSON_BUILD_PAIR(
No functional change, just refactoring.
2025-11-14 15:19:57 +01:00
Jelle van der Waa
8ef5e56f97 sd-json: prefer using SD_JSON_BUILD_PAIR_UNSIGNED
No functional change, just refactoring.
2025-11-14 15:19:54 +01:00
Daan De Meyer
6aff6d3ffc sd-event: Move SOURCE_POST check into mark_post_sources_pending()
Rename to maybe_mark_post_sources_pending() as well to match the new
behavior.

Follow up for 4c8b6d636c
2025-11-14 15:18:33 +01:00
Daan De Meyer
c71a8e68ce sd-event: Add comment in event_source_offline() for memory pressure
Follow up for d0ddb0aafb
2025-11-14 15:18:33 +01:00
Daan De Meyer
10c79431a0 Three new sd-event features + various fixes (#39608) 2025-11-14 12:05:12 +01:00
Daan De Meyer
bc8aebdce9 log-context: Don't add log context if value is NULL
This avoids if conditions at the callsite which mess up stack based
lifetimes.
2025-11-14 11:38:59 +01:00
Daan De Meyer
5cf894ad58 basic-forward: Add WaitFlags forward decl 2025-11-14 11:38:59 +01:00
Daan De Meyer
a3dd54c097 sd-event: Make sure iterations of defer and exit sources are updated
Defer and exit event sources are marked pending once when they are added
and never again afterwards. This means their pending_iteration is never
incremented after they are initially added, which breaks fairness among
event sources with equal priority which depend on the pending_iteration
variable getting updated in source_set_pending(). To fix this, let's assign
iterations for defer and exit sources in source_dispatch() instead so that
those get their pending_iteration updated as well.
2025-11-14 11:38:59 +01:00
Daan De Meyer
5a5cb6ba50 sd-event: Add exit-on-idle support
Sometimes it's hard to assign responsibility to a specific event source
for exiting when there's no more work to be done. So let's add exit-on-idle
support where we exit when there are no more event sources.
2025-11-14 11:38:56 +01:00
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
Daan De Meyer
c11e1001db sd-event: Allow passing WNOWAIT to sd_event_add_child()
This allows doing the reaping outside of the callback, we'll use this
when adding fibers in a later commit.
2025-11-14 10:34:32 +01:00
Daan De Meyer
0a79791d0a sd-event: Drop faulty shortcut
We can't take this shortcut, as we might have to drop the
EPOLLONESHOT flag for some event sources, so drop the shortcut.
2025-11-14 10:34:32 +01:00
Daan De Meyer
d0ddb0aafb sd-event: Only register memory presure if write buffer size is zero
As documented in sd_event_add_memory_pressure(), we can only add
the memory pressure fd to epoll once we've written the watch string,
so make sure we don't register the memory pressure in
event_source_online() until we've written the watch string.
2025-11-14 10:34:32 +01:00
Daan De Meyer
4c8b6d636c sd-event: Mark post sources as pending after dispatching
More post event sources might get added during dispatching, we want
to make sure those become pending as well if we're dispatching a non-post
event source.
2025-11-14 10:34:30 +01:00
Daan De Meyer
6403a81b28 test-cgroup-util: Skip test on ESTALE
The kernel converts a bunch of errors to ESTALE in the open_by_handle_at()
codepath so we treat it as missing privs but it could be absolutely
anything really.
2025-11-14 09:19:01 +01:00
Daan De Meyer
1312353fdd test-rm-rf: Check capabilities
The assertion will succeed if we have the right capability, causing the
test to fail.
2025-11-14 09:19:01 +01:00
Daan De Meyer
a0fb74153d test-id128: Check capability instead of uid 2025-11-14 09:19:01 +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