]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 days agossh-generator: tweak comments
Zbigniew Jędrzejewski-Szmek [Fri, 24 Oct 2025 08:30:40 +0000 (10:30 +0200)] 
ssh-generator: tweak comments

4 days agoThree new sd-event features + various fixes (#39608)
Daan De Meyer [Fri, 14 Nov 2025 11:05:12 +0000 (12:05 +0100)] 
Three new sd-event features + various fixes (#39608)

4 days agolog-context: Don't add log context if value is NULL 39608/head
Daan De Meyer [Wed, 5 Nov 2025 22:45:30 +0000 (23:45 +0100)] 
log-context: Don't add log context if value is NULL

This avoids if conditions at the callsite which mess up stack based
lifetimes.

4 days agobasic-forward: Add WaitFlags forward decl
Daan De Meyer [Thu, 6 Nov 2025 13:30:41 +0000 (14:30 +0100)] 
basic-forward: Add WaitFlags forward decl

4 days agosd-event: Make sure iterations of defer and exit sources are updated
Daan De Meyer [Thu, 13 Nov 2025 21:15:01 +0000 (22:15 +0100)] 
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.

4 days agosd-event: Add exit-on-idle support
Daan De Meyer [Wed, 12 Nov 2025 16:58:17 +0000 (17:58 +0100)] 
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.

4 days agorun0: Make --same-root-dir available for run0
Daan De Meyer [Fri, 14 Nov 2025 08:10:18 +0000 (09:10 +0100)] 
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.

4 days agosd-event: Allow passing WNOWAIT to sd_event_add_child()
Daan De Meyer [Thu, 6 Nov 2025 13:30:06 +0000 (14:30 +0100)] 
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.

4 days agosd-event: Drop faulty shortcut
Daan De Meyer [Thu, 13 Nov 2025 21:33:11 +0000 (22:33 +0100)] 
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.

4 days agosd-event: Only register memory presure if write buffer size is zero
Daan De Meyer [Fri, 14 Nov 2025 09:28:43 +0000 (10:28 +0100)] 
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.

4 days agosd-event: Mark post sources as pending after dispatching
Daan De Meyer [Thu, 6 Nov 2025 09:20:49 +0000 (10:20 +0100)] 
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.

4 days agotest-cgroup-util: Skip test on ESTALE
Daan De Meyer [Thu, 6 Nov 2025 19:56:53 +0000 (20:56 +0100)] 
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.

4 days agotest-rm-rf: Check capabilities
Daan De Meyer [Thu, 6 Nov 2025 19:21:55 +0000 (20:21 +0100)] 
test-rm-rf: Check capabilities

The assertion will succeed if we have the right capability, causing the
test to fail.

4 days agotest-id128: Check capability instead of uid
Daan De Meyer [Thu, 6 Nov 2025 19:10:39 +0000 (20:10 +0100)] 
test-id128: Check capability instead of uid

4 days agointegritysetup: Add support for hmac-sha512 and wrapped key HMAC algorithms phmac...
Luca Boccassi [Fri, 14 Nov 2025 00:12:34 +0000 (00:12 +0000)] 
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

https://gitlab.com/cryptsetup/cryptsetup/-/commit/296eb39c60bd85228930caaea4bb1d2a766b7544

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.

4 days agosd-dhcp-server: Add Hostname= option to static leases
Chris Down [Sun, 9 Nov 2025 16:59:59 +0000 (00:59 +0800)] 
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
4 days agomusl: add several missing symbols (#39701)
Yu Watanabe [Thu, 13 Nov 2025 22:49:16 +0000 (07:49 +0900)] 
musl: add several missing symbols (#39701)

4 days agoThree follow-ups for recent changes (#39724)
Yu Watanabe [Thu, 13 Nov 2025 22:48:47 +0000 (07:48 +0900)] 
Three follow-ups for recent changes (#39724)

4 days agostdio-bridge: remove unreachable return 39724/head
Mike Yuan [Thu, 13 Nov 2025 20:08:50 +0000 (21:08 +0100)] 
stdio-bridge: remove unreachable return

4 days agorun: refuse --root-directory= in --scope mode
Mike Yuan [Thu, 13 Nov 2025 20:09:52 +0000 (21:09 +0100)] 
run: refuse --root-directory= in --scope mode

As discussed in #39669, let's reject this for now.

4 days agoefivars: insert a newline below fstat() call
Mike Yuan [Thu, 13 Nov 2025 20:17:08 +0000 (21:17 +0100)] 
efivars: insert a newline below fstat() call

4 days agomusl: add several missing statx macros 39701/head
Yu Watanabe [Sat, 21 Jun 2025 15:38:58 +0000 (00:38 +0900)] 
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.

4 days agomusl: add missing FTW_CONTINUE macro
Chen Qi [Mon, 25 Feb 2019 07:00:06 +0000 (15:00 +0800)] 
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>
4 days agomusl: replace netinet/if_ether.h with our own implementation
Yu Watanabe [Mon, 23 Jun 2025 07:08:37 +0000 (16:08 +0900)] 
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.

4 days agomusl: provide several missing definitions for prctl()
Yu Watanabe [Mon, 23 Jun 2025 07:00:21 +0000 (16:00 +0900)] 
musl: provide several missing definitions for prctl()

4 days agomusl: introduce dummy function for gnu_get_libc_version()
Yu Watanabe [Sun, 8 Jun 2025 01:07:54 +0000 (10:07 +0900)] 
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.

4 days agomusl: introduce dummy functions for mallinfo(), malloc_info(), and malloc_trim()
Yu Watanabe [Mon, 9 Jun 2025 15:40:59 +0000 (00:40 +0900)] 
musl: introduce dummy functions for mallinfo(), malloc_info(), and malloc_trim()

These functions are not provided by musl.

4 days agomusl: introduce dummy gshadow header file for userdb
Yu Watanabe [Sun, 21 Sep 2025 06:24:06 +0000 (15:24 +0900)] 
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.

4 days agohwdb: add entry for Acer Switch One 10 (SW1-011) (#39716)
Bastian Almendras [Thu, 13 Nov 2025 19:33:47 +0000 (16:33 -0300)] 
hwdb: add entry for Acer Switch One 10 (SW1-011) (#39716)

Add the correct rotation for Acer Switch One 10 (SW1-011)

4 days agogpt-auto-generator: fix typo in crypttab option name
Antonio Alvarez Feijoo [Thu, 13 Nov 2025 15:25:19 +0000 (16:25 +0100)] 
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 e5a2e7866572614e66cbf6c1d3969128562d9552

4 days agomusl: test: several random fixlets for unit tests
Yu Watanabe [Tue, 9 Sep 2025 04:34:31 +0000 (13:34 +0900)] 
musl: test: several random fixlets for unit tests

5 days agocore: record transactions that have seen ordering cycles and expose them via IPC...
Yu Watanabe [Thu, 13 Nov 2025 15:41:46 +0000 (00:41 +0900)] 
core: record transactions that have seen ordering cycles and expose them via IPC (#39210)

Closes #3829.

5 days agoMake systemd stdio bridge quiet (#39718)
Yu Watanabe [Thu, 13 Nov 2025 15:39:15 +0000 (00:39 +0900)] 
Make systemd stdio bridge quiet (#39718)

5 days agoefivarfs readv() size fixes and more (#39715)
Yu Watanabe [Thu, 13 Nov 2025 15:38:29 +0000 (00:38 +0900)] 
efivarfs readv() size fixes and more (#39715)

Fixes: #39695
5 days agotree-wide: assorted fixes/workarounds for supporting musl (#39687)
Yu Watanabe [Thu, 13 Nov 2025 15:16:50 +0000 (00:16 +0900)] 
tree-wide: assorted fixes/workarounds for supporting musl (#39687)

5 days agointegritysetup: Add PHMAC algorithm to list of known algorithms 39719/head
Ingo Franzki [Mon, 4 Mar 2024 08:26:18 +0000 (09:26 +0100)] 
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.

5 days agosd-bus: Pass --user and --quiet to systemd-stdio-bridge if local 39718/head
Daan De Meyer [Sun, 2 Nov 2025 13:17:36 +0000 (14:17 +0100)] 
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.

5 days agostdio-bridge: Fix --user
Daan De Meyer [Sun, 2 Nov 2025 16:52:14 +0000 (17:52 +0100)] 
stdio-bridge: Fix --user

If --user was specified we would still try to use the system bus
address.

5 days agostdio-bridge: Add --quiet option
Daan De Meyer [Sun, 2 Nov 2025 12:52:15 +0000 (13:52 +0100)] 
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.

5 days agobus-wait-for-jobs: Make sure we always debug log
Daan De Meyer [Sat, 1 Nov 2025 21:15:36 +0000 (22:15 +0100)] 
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.

5 days agoshared: Forward declare InstallChange in shared-forward.h
Daan De Meyer [Sat, 1 Nov 2025 21:13:27 +0000 (22:13 +0100)] 
shared: Forward declare InstallChange in shared-forward.h

5 days agotree-wide: fix lseek() parameter order 39715/head
Lennart Poettering [Thu, 13 Nov 2025 13:15:33 +0000 (14:15 +0100)] 
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?

5 days agoefivars: seek back to beginning in each efi_get_variable() loop
Lennart Poettering [Thu, 13 Nov 2025 11:35:36 +0000 (12:35 +0100)] 
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.

5 days agoefivars: validate we are actually talking about a regular file
Lennart Poettering [Thu, 13 Nov 2025 11:33:12 +0000 (12:33 +0100)] 
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

5 days agoefivars: fix size checks in efi_get_variable()
Lennart Poettering [Thu, 13 Nov 2025 11:14:34 +0000 (12:14 +0100)] 
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: 9db9d6806e398465a6366dfc5bdde2e24338ac29

5 days agoefivars: don't bother with realloc() if we have no interest in the old data
Lennart Poettering [Thu, 13 Nov 2025 11:12:30 +0000 (12:12 +0100)] 
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)

5 days agointegritysetup: Add support for hmac-sha512
Ingo Franzki [Tue, 5 Mar 2024 07:28:40 +0000 (08:28 +0100)] 
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.

5 days agoMake journal persistent by default (#39624)
Zbigniew Jędrzejewski-Szmek [Thu, 13 Nov 2025 08:43:00 +0000 (09:43 +0100)] 
Make journal persistent by default (#39624)

See second commit for details.

5 days agotest: use new macros and move several test cases (#39708)
Daan De Meyer [Thu, 13 Nov 2025 08:42:12 +0000 (09:42 +0100)] 
test: use new macros and move several test cases (#39708)

5 days agotime-util: do not carry musl-specific fallback logic on glibc systems
Mike Yuan [Wed, 12 Nov 2025 20:53:41 +0000 (21:53 +0100)] 
time-util: do not carry musl-specific fallback logic on glibc systems

Follow-up for 3ac4d68498dd378e2b3acd2bb86f4700263532d0

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.

5 days agouser-util: fix typo
Yu Watanabe [Thu, 13 Nov 2025 04:34:06 +0000 (13:34 +0900)] 
user-util: fix typo

Follow-up for b10fd796f56e4f16f7430cd22f59f544766d3bef.

5 days agotest: move several test cases to test-tmpfile-util.c 39708/head
Yu Watanabe [Wed, 12 Nov 2025 22:46:13 +0000 (07:46 +0900)] 
test: move several test cases to test-tmpfile-util.c

5 days agotest: move several test cases to test-env-file.c
Yu Watanabe [Wed, 12 Nov 2025 22:45:08 +0000 (07:45 +0900)] 
test: move several test cases to test-env-file.c

5 days agotest-fileio: migrate to use new ASSER_OK() macro and friends
Yu Watanabe [Wed, 12 Nov 2025 22:29:27 +0000 (07:29 +0900)] 
test-fileio: migrate to use new ASSER_OK() macro and friends

This also replaces fgets() with read_full_file().

5 days agomkosi: update debian commit reference to efdd7a6377c7251011ca2c1a59115d482d25fe61
Luca Boccassi [Wed, 12 Nov 2025 22:19:27 +0000 (22:19 +0000)] 
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

5 days agojournald: do not allow persistent journal storage in the initrd 39624/head
Zbigniew Jędrzejewski-Szmek [Fri, 7 Nov 2025 16:04:03 +0000 (17:04 +0100)] 
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.

5 days agomeson: make persistent journal the default
Zbigniew Jędrzejewski-Szmek [Fri, 7 Nov 2025 15:51:21 +0000 (16:51 +0100)] 
meson: make persistent journal the default

5 days agojournald: allow default storage mode to be configured
Zbigniew Jędrzejewski-Szmek [Fri, 7 Nov 2025 14:43:34 +0000 (15:43 +0100)] 
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.

5 days agoman: stop inventing custom entity names for docbook
Zbigniew Jędrzejewski-Szmek [Fri, 7 Nov 2025 15:41:05 +0000 (16:41 +0100)] 
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.

5 days agomeson: make journald.conf templated
Zbigniew Jędrzejewski-Szmek [Fri, 7 Nov 2025 14:18:14 +0000 (15:18 +0100)] 
meson: make journald.conf templated

A noop, in preparation for subsequent changes.

5 days agomusl: format-util: use %llu for formatting rlim_t 39687/head
Yu Watanabe [Mon, 9 Jun 2025 03:00:01 +0000 (12:00 +0900)] 
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.

5 days agomusl: build-path: fix reading DT_RUNPATH or DT_RPATH
Yu Watanabe [Sat, 6 Sep 2025 03:06:06 +0000 (12:06 +0900)] 
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.

5 days agomusl: core: there is one less usable signal when built with musl
Yu Watanabe [Sat, 6 Sep 2025 23:53:07 +0000 (08:53 +0900)] 
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.

5 days agomusl: avoid multiple evaluations in CPU_ISSET_S() macro
Yu Watanabe [Tue, 1 Jul 2025 03:53:14 +0000 (12:53 +0900)] 
musl: avoid multiple evaluations in CPU_ISSET_S() macro

musl's CPU_ISSET_S() macro does not avoid multiple evaluations, and it
only accepts simple variable or constant.

Fixes the following error.
```
../src/shared/cpu-set-util.c: In function ‘cpu_set_to_mask_string’:
../src/shared/cpu-set-util.c:101:41: warning: operation on ‘i’ may be undefined [-Werror=sequence-point]
  101 |                         if (CPU_ISSET_S(--i, c->allocated, c->set))
      |                                         ^
```

5 days agomusl: hostname-util: introduce LINUX_HOST_NAME_MAX
Yu Watanabe [Sat, 6 Sep 2025 21:16:02 +0000 (06:16 +0900)] 
musl: hostname-util: introduce LINUX_HOST_NAME_MAX

glibc defines HOST_NAME_MAX as 64 and our code rely on that, but musl
defines the constant as 255. Let's provide our own definition for the
maximum length.

5 days agoman: fedora 43 is the latest stable
Zbigniew Jędrzejewski-Szmek [Wed, 12 Nov 2025 21:58:40 +0000 (22:58 +0100)] 
man: fedora 43 is the latest stable

5 days agodocs/BACKPORTS: update
Zbigniew Jędrzejewski-Szmek [Wed, 12 Nov 2025 22:14:11 +0000 (23:14 +0100)] 
docs/BACKPORTS: update

We now keep stable branches in the main repo. Update the description
to match current practice.

Closes https://github.com/systemd/systemd/issues/35846.

5 days agoTEST-03-JOBS: add test for TransactionsWithOrderingCycle 39210/head
Mike Yuan [Wed, 12 Nov 2025 21:46:40 +0000 (22:46 +0100)] 
TEST-03-JOBS: add test for TransactionsWithOrderingCycle

5 days agocore: expose transactions with ordering cycle
Mike Yuan [Sat, 4 Oct 2025 23:46:40 +0000 (01:46 +0200)] 
core: expose transactions with ordering cycle

Closes #3829
Alternative to #35417

I don't think the individual "WasOnDependencyCycle" attrs on units
are particularly helpful and comprehensible, as it's really about
the dep relationship between them. And as discussed, the dependency
cycle is not something persistent, rather local to the currently
loaded set of units and shall be reset with daemon-reload (see also
https://github.com/systemd/systemd/issues/35642#issuecomment-2591296586).

Hence, let's report system state as degraded and point users to
the involved transactions when ordering cycles are encountered instead.
Combined with log messages added in 6912eb315fabe0bbf25593ab897265fa79a7e24b
it should achieve the goal of making ordering cycles more observable,
while avoiding all sorts of subtle bookkeeping in the service manager.
The degraded state can be reset via the existing ResetFailed() manager-wide
method.

5 days agocore: record transactions that have seen ordering cycles
Mike Yuan [Sat, 4 Oct 2025 23:07:48 +0000 (01:07 +0200)] 
core: record transactions that have seen ordering cycles

5 days agocore/transaction: assign unique ids to transactions and encode them in log
Mike Yuan [Sat, 4 Oct 2025 22:39:50 +0000 (00:39 +0200)] 
core/transaction: assign unique ids to transactions and encode them in log

Preparation for later commits, but I think this one makes
a ton of sense on its own. When debug logging is enabled
it's otherwise difficult to dig up the portion of journal
for transaction construction.

5 days agocore/manager-serialize: minor coding style cleanups
Mike Yuan [Sun, 26 Oct 2025 20:39:52 +0000 (21:39 +0100)] 
core/manager-serialize: minor coding style cleanups

5 days agoboot: coding style cleanups
Luca Boccassi [Tue, 11 Nov 2025 22:21:05 +0000 (22:21 +0000)] 
boot: coding style cleanups

5 days agomusl: avoid conflict between fcntl.h and basic-forward.h
Yu Watanabe [Mon, 21 Jul 2025 18:37:37 +0000 (03:37 +0900)] 
musl: avoid conflict between fcntl.h and basic-forward.h

glibc defines AT_FDCWD as -100, but musl defines it as (-100).
In basic-forward.h, we also define AT_FDCWD as -100, hence musl's fcntl.h
conflicts with forward.h. This is for avoiding the conflict.

5 days agotime-util: several fixlets/workarounds for supporting musl (#39688)
Yu Watanabe [Wed, 12 Nov 2025 20:18:25 +0000 (05:18 +0900)] 
time-util: several fixlets/workarounds for supporting musl (#39688)

5 days agosd-journal: fix relative path handling (#38681)
Yu Watanabe [Wed, 12 Nov 2025 20:12:00 +0000 (05:12 +0900)] 
sd-journal: fix relative path handling (#38681)

Fixes #38667.

5 days agocore/dbus-service: validate type of received ExecContext fds (#39680)
Yu Watanabe [Wed, 12 Nov 2025 20:11:07 +0000 (05:11 +0900)] 
core/dbus-service: validate type of received ExecContext fds (#39680)

5 days agomeson: add musl support (#39686)
Yu Watanabe [Wed, 12 Nov 2025 20:10:22 +0000 (05:10 +0900)] 
meson: add musl support (#39686)

5 days agomusl: meson: gracefully disable gshadow, nss, and idn support 39686/head
Yu Watanabe [Sat, 21 Jun 2025 17:16:25 +0000 (02:16 +0900)] 
musl: meson: gracefully disable gshadow, nss, and idn support

- musl does not support gshadow, and does not provide gshadow.h,
- musl does not support nss, and does not provide nss.h which is necessary
  for each nss modules,
- musl does not provide NI_IDN.

5 days agomusl: meson: check existence of renameat2()
Yu Watanabe [Mon, 9 Jun 2025 04:00:37 +0000 (13:00 +0900)] 
musl: meson: check existence of renameat2()

musl-1.2.5 does not provide renameat2(). Note, it is added by
https://github.com/kraj/musl/commit/05ce67fea99ca09cd4b6625cff7aec9cc222dd5a,
hence hopefully it will be provided by musl-1.2.6 or newer.

5 days agomusl: meson: make musl not define wchar_t in their header
Yu Watanabe [Mon, 9 Jun 2025 04:37:38 +0000 (13:37 +0900)] 
musl: meson: make musl not define wchar_t in their header

Otherwise, musl defines wchar_t as int, which conflicts with the
assumption by sd-boot, i.e. wchar_t is 2 bytes.

Fixes the following build error:
```
In file included from ../src/boot/efi-log.h:4,
                 from ../src/boot/linux_x86.c:13:
../src/boot/efi.h:19:24: error: conflicting types for 'wchar_t'; have 'short unsigned int'
   19 | typedef __WCHAR_TYPE__ wchar_t;
      |                        ^~~~~~~
In file included from /usr/include/stddef.h:19,
                 from ../src/boot/efi.h:9:
/usr/include/bits/alltypes.h:10:13: note: previous declaration of 'wchar_t' with type 'wchar_t' {aka 'int'}
   10 | typedef int wchar_t;
      |             ^~~~~~~
```

5 days agomusl: meson: explicitly set _LARGEFILE64_SOURCE
Yu Watanabe [Mon, 9 Jun 2025 15:29:46 +0000 (00:29 +0900)] 
musl: meson: explicitly set _LARGEFILE64_SOURCE

glibc sets it when _GNU_SOURCE is defined, however, musl does not.
Let's explicitly define it to make getdents64() and struct dirent64
available even when building with musl.

5 days agomusl: meson: explicitly link with libintl when necessary
Yu Watanabe [Sat, 6 Sep 2025 07:25:41 +0000 (16:25 +0900)] 
musl: meson: explicitly link with libintl when necessary

On some musl based distributions dgettext() may be provided by libintl.so.
Hence, we need to add dependency in that case.

5 days agomusl: meson: allow to choose libc implementation
Yu Watanabe [Mon, 7 Jul 2025 05:11:19 +0000 (14:11 +0900)] 
musl: meson: allow to choose libc implementation

This also introduces skeleton directories for storing musl specific code.

5 days agotest-varlink: Migrate to new assertion macros
Daan De Meyer [Thu, 6 Nov 2025 21:31:11 +0000 (22:31 +0100)] 
test-varlink: Migrate to new assertion macros

5 days agorun0: Never ask --empower sessions for polkit auth
Daan De Meyer [Wed, 12 Nov 2025 13:05:54 +0000 (14:05 +0100)] 
run0: Never ask --empower sessions for polkit auth

A --empower session is effectively root without being UID 0, so it
doesn't make sense to enforce polkit authentication in those. Let's
add the empower group, add --empower sessions to that group and ship
a polkit rule to skip authentication for all users in the empower
group.

(As a side-effect this will also allow users to add themselves to this
group outside of 'run0 --empower' to mimick NOPASSWD from sudo)

5 days agomusl: test-time-util: skip parsing back when currently unused timezone is set 39688/head
Yu Watanabe [Wed, 12 Nov 2025 02:40:22 +0000 (11:40 +0900)] 
musl: test-time-util: skip parsing back when currently unused timezone is set

5 days agomusl: time-util: skip tm.tm_wday check
Yu Watanabe [Mon, 8 Sep 2025 06:08:49 +0000 (15:08 +0900)] 
musl: time-util: skip tm.tm_wday check

musl does not set tm_wday when it is explicitly requested.
The check is not necessary at all, it is just for safety.
Let's skip it when built with musl.

5 days agomusl: time-util: introduce get_tzname() helper function
Yu Watanabe [Tue, 11 Nov 2025 18:35:45 +0000 (03:35 +0900)] 
musl: time-util: introduce get_tzname() helper function

musl leaves the DST timezone name unset if there is no DST.
The helper function maps that back to no DST.

5 days agomusl: time-util: make parse_gmtoff() accept extended timezone offset format
Yu Watanabe [Mon, 8 Sep 2025 23:31:22 +0000 (08:31 +0900)] 
musl: time-util: make parse_gmtoff() accept extended timezone offset format

musl v1.2.5 does not support %z specifier in strptime(). Since
https://github.com/kraj/musl/commit/fced99e93daeefb0192fd16304f978d4401d1d77
%z is supported, but it only supports strict RFC-822/ISO 8601 format,
that is, 4 digits with sign (e.g. +0900 or -1400), but does not support
extended format: 2 digits or colon separated 4 digits (e.g. +09 or -14:00).
Let's add fallback logic to make it support the extended timezone spec.

6 days agoMigrate various tests to new assertion macros (#39691)
Daan De Meyer [Wed, 12 Nov 2025 15:17:38 +0000 (16:17 +0100)] 
Migrate various tests to new assertion macros (#39691)

Split out of #39608

6 days agocore/dbus-service: validate type of received ExecContext fds 39680/head
Mike Yuan [Tue, 11 Nov 2025 18:13:01 +0000 (19:13 +0100)] 
core/dbus-service: validate type of received ExecContext fds

6 days agologind-session-dbus: use fd_vet_accmode() where appropriate
Mike Yuan [Tue, 11 Nov 2025 18:41:11 +0000 (19:41 +0100)] 
logind-session-dbus: use fd_vet_accmode() where appropriate

6 days agotest-fd-util: add unit test for fd_vet_accmode()
Mike Yuan [Wed, 12 Nov 2025 00:47:01 +0000 (01:47 +0100)] 
test-fd-util: add unit test for fd_vet_accmode()

Co-authored-by: Chris Down <chris@chrisdown.name>
6 days agofd-util: introduce fd_vet_accmode()
Mike Yuan [Tue, 11 Nov 2025 18:04:38 +0000 (19:04 +0100)] 
fd-util: introduce fd_vet_accmode()

Inspired by #39674

6 days agosd-journal: resolve paths passed to sd_journal_open_files() and friends 38681/head
Yu Watanabe [Thu, 21 Aug 2025 20:26:44 +0000 (05:26 +0900)] 
sd-journal: resolve paths passed to sd_journal_open_files() and friends

Fixes #38667.

6 days agosd-journal: use -EBADF for invalidated file descriptor
Yu Watanabe [Thu, 21 Aug 2025 20:02:52 +0000 (05:02 +0900)] 
sd-journal: use -EBADF for invalidated file descriptor

6 days agotest-rm-rf: Migrate to new assertion macros 39691/head
Daan De Meyer [Thu, 6 Nov 2025 19:14:25 +0000 (20:14 +0100)] 
test-rm-rf: Migrate to new assertion macros

6 days agotest-bus-chat: Migrate to TEST() and new assertion macros
Daan De Meyer [Tue, 11 Nov 2025 18:39:25 +0000 (19:39 +0100)] 
test-bus-chat: Migrate to TEST() and new assertion macros

- Also contains various other small cleanups

6 days agotest-bus-watch-bind: Migrate to new assertion macros
Daan De Meyer [Fri, 7 Nov 2025 11:02:15 +0000 (12:02 +0100)] 
test-bus-watch-bind: Migrate to new assertion macros