]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 months agoci: add test case for building without OpenSSL UI support 38041/head
Yu Watanabe [Thu, 3 Jul 2025 05:39:40 +0000 (14:39 +0900)] 
ci: add test case for building without OpenSSL UI support

4 months agoopenssl-util: allow to build with openssl without UI support
Yu Watanabe [Thu, 3 Jul 2025 01:26:41 +0000 (10:26 +0900)] 
openssl-util: allow to build with openssl without UI support

When OpenSSL is built without UI support, OPENSSL_NO_UI_CONSOLE is
defined. Or, even openssl is built with UI support, people may want to
build systemd without using OpenSSL's UI feature by specifying
-Dc_args='-DOPENSSL_NO_UI_CONSOLE=1'. This adds support for such cases.

Not tested, but hopefully, now systemd can be built with other ssl library,
like BoringSSL, which deos not support UIs.

Closes #38024.

4 months agoMove missing_xyz.h for glibc headers to src/basic/include/ (#37960)
Daan De Meyer [Thu, 3 Jul 2025 11:47:46 +0000 (13:47 +0200)] 
Move missing_xyz.h for glibc headers to src/basic/include/ (#37960)

4 months agoresolve: add converters for sshfp key types and algs
Zbigniew Jędrzejewski-Szmek [Thu, 3 Jul 2025 08:11:03 +0000 (10:11 +0200)] 
resolve: add converters for sshfp key types and algs

With the data center move in the Fedora project, the ssh keys have changed.
The list with numerical values is hard to read…

$ resolvectl -t sshfp query pkgs.fedoraproject.org
Old:
pkgs.fedoraproject.org IN SSHFP 1 1 18270c9131ef9664861f5aa675a981146573cce0 -- link: wlp0s20f3
pkgs.fedoraproject.org IN SSHFP 1 2 b067e6eb4c3e2d0e8bb37d6799493b762131816fe979940bbe660470abe6efbb -- link: wlp0s20f3
pkgs.fedoraproject.org IN SSHFP 3 1 a1ad871a5eabe3027728d498a89895fb5bf5b290 -- link: wlp0s20f3
pkgs.fedoraproject.org IN SSHFP 3 2 c3dc523f99bb5155ec87f40fd1aa198c68f349d75beeccf60e87b44c9b461907 -- link: wlp0s20f3
pkgs.fedoraproject.org IN SSHFP 4 1 e1265f46012ee40967127e06cf5533b270568428 -- link: wlp0s20f3
pkgs.fedoraproject.org IN SSHFP 4 2 acaa1ee6292d01f1ae7881fdf03aaf7d7b0814e34e94c3558a25e4d1aaab8f94 -- link: wlp0s20f3
New:
pkgs.fedoraproject.org IN SSHFP RSA     SHA-1   18270c9131ef9664861f5aa675a981146573cce0 -- link: wlp0s20f3
pkgs.fedoraproject.org IN SSHFP RSA     SHA-256 b067e6eb4c3e2d0e8bb37d6799493b762131816fe979940bbe660470abe6efbb -- link: wlp0s20f3
pkgs.fedoraproject.org IN SSHFP ECDSA   SHA-1   a1ad871a5eabe3027728d498a89895fb5bf5b290 -- link: wlp0s20f3
pkgs.fedoraproject.org IN SSHFP ECDSA   SHA-256 c3dc523f99bb5155ec87f40fd1aa198c68f349d75beeccf60e87b44c9b461907 -- link: wlp0s20f3
pkgs.fedoraproject.org IN SSHFP Ed25519 SHA-1   e1265f46012ee40967127e06cf5533b270568428 -- link: wlp0s20f3
pkgs.fedoraproject.org IN SSHFP Ed25519 SHA-256 acaa1ee6292d01f1ae7881fdf03aaf7d7b0814e34e94c3558a25e4d1aaab8f94 -- link: wlp0s20f3

4 months agofix: UnsetProperty example in systemd.link.xml
Frede Braendstrup [Thu, 3 Jul 2025 07:05:05 +0000 (09:05 +0200)] 
fix: UnsetProperty example in systemd.link.xml

4 months agotest: allow to run test-local-addresses with IPv6 disabled by default, and assume...
Luca Boccassi [Thu, 3 Jul 2025 08:58:02 +0000 (09:58 +0100)] 
test: allow to run test-local-addresses with IPv6 disabled by default, and assume RTA_VIA is always supported (#38039)

4 months agofuzz: avoid assertion for ExecContext.private_var_tmp triggered
Yu Watanabe [Thu, 3 Jul 2025 05:29:55 +0000 (14:29 +0900)] 
fuzz: avoid assertion for ExecContext.private_var_tmp triggered

Follow-up for 6156bec7a464815084fa5218fe782ea6cb20ad52.

Fixes #38037 and oss-fuzz#429112745.

4 months agologind: Don't match non-leader processes for utmp TTY determination (#38027)
Lennart Poettering [Thu, 3 Jul 2025 07:20:19 +0000 (09:20 +0200)] 
logind: Don't match non-leader processes for utmp TTY determination (#38027)

This ensures we don't erroneously assign pseudoterminals created by
terminal emulators that use utempter to register themselves in utmp when
run under a GUI session that doesn't have a TTY assigned.

4 months agotest: assume RTA_VIA is supported 38039/head
Yu Watanabe [Thu, 3 Jul 2025 03:35:37 +0000 (12:35 +0900)] 
test: assume RTA_VIA is supported

RTA_VIA support was added in kernel v5.2:
https://github.com/torvalds/linux/commit/d15662682db232da77136cd348f4c9df312ca6f9

Our baseline on the kernel is v5.4. Hence, we can assume that the
attribute is supported.

4 months agotest-local-addresses: enable IPv6 on the test interface
Yu Watanabe [Thu, 3 Jul 2025 03:31:55 +0000 (12:31 +0900)] 
test-local-addresses: enable IPv6 on the test interface

If IPv6 is disabled by default, we need to explicitly enable IPv6 on the
interface. Otherwise, adding an IPv6 address or route will fail.

4 months agotest-local-addresses: use ASSERT_OK() and friends
Yu Watanabe [Wed, 2 Jul 2025 23:34:55 +0000 (08:34 +0900)] 
test-local-addresses: use ASSERT_OK() and friends

4 months agoFixes for vscode/intellisense parsing (#38040)
Yu Watanabe [Thu, 3 Jul 2025 03:46:57 +0000 (12:46 +0900)] 
Fixes for vscode/intellisense parsing (#38040)

With these two changes the vscode parser works nicely again. Once the
EDG frontend adds support for this feature I'll fix it to check for the
fixed version like for GCC.

4 months agoudev-builtin-uaccess: open device node with O_PATH
Yu Watanabe [Wed, 2 Jul 2025 23:15:51 +0000 (08:15 +0900)] 
udev-builtin-uaccess: open device node with O_PATH

Some device node refuses to be opened with read-write mode.
Let's not open with O_RDWR, but open with O_PATH, and use
FORMAT_PROC_FD_PATH().

Follow-up for 1abb592f2f886913492e4967cc96816c167177a9.

Fixes #38033.

4 months agocore/transaction: minor tweaks for cyclic dependency logging (#38014)
Yu Watanabe [Thu, 3 Jul 2025 03:45:47 +0000 (12:45 +0900)] 
core/transaction: minor tweaks for cyclic dependency logging (#38014)

4 months agomeson: make -Wsequence-point warning critical
Yu Watanabe [Tue, 1 Jul 2025 04:00:08 +0000 (13:00 +0900)] 
meson: make -Wsequence-point warning critical

It detects e.g. multiple evaluations in macro.

4 months agologind: use manager_get_session_by_leader in manager_get_session_by_pidref 38027/head
Myrrh Periwinkle [Wed, 2 Jul 2025 15:18:33 +0000 (22:18 +0700)] 
logind: use manager_get_session_by_leader in manager_get_session_by_pidref

4 months agobuild(deps): bump meson from 1.8.1 to 1.8.2 in /.github/workflows
dependabot[bot] [Tue, 1 Jul 2025 10:54:38 +0000 (10:54 +0000)] 
build(deps): bump meson from 1.8.1 to 1.8.2 in /.github/workflows

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

---
updated-dependencies:
- dependency-name: meson
  dependency-version: 1.8.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months agobuild(deps): bump redhat-plumbers-in-action/advanced-issue-labeler
dependabot[bot] [Tue, 1 Jul 2025 10:35:53 +0000 (10:35 +0000)] 
build(deps): bump redhat-plumbers-in-action/advanced-issue-labeler

Bumps [redhat-plumbers-in-action/advanced-issue-labeler](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler) from 3.2.0 to 3.2.2.
- [Release notes](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/releases)
- [Commits](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/compare/d498805e5c7c0658e336948b3363480bcfd68da6...0db433d412193574252480b4fc22f2e4319a4ea3)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/advanced-issue-labeler
  dependency-version: 3.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months agomacro: EDG compiler frontends doesn't support enum types 38040/head
Luca Boccassi [Thu, 3 Jul 2025 00:23:31 +0000 (01:23 +0100)] 
macro: EDG compiler frontends doesn't support enum types

It declares STDC_VERSION 202311L but still doesn't support this feature:

https://en.cppreference.com/w/c/compiler_support/23

The EDG frontend is used by intellisense, which is the default
engine in VSCode, so parsing is currently broken and tons of
spurious errors are shown. Skip this feature when this
compiler frontend is used.

Follow-up for 92100f14c3b054903053559ed831a1b25033046c

4 months agosd-common: do not fail preprocessor when intellisense is parsing the header
Luca Boccassi [Thu, 3 Jul 2025 00:21:19 +0000 (01:21 +0100)] 
sd-common: do not fail preprocessor when intellisense is parsing the header

Just like coverity or clang analyzer, intellisense will parse _sd-common.h and
fail because of the #error so skip it like the others

4 months agotest-xattr-util.c: migrate to new assertion macros (#38025)
Yaping Li [Thu, 3 Jul 2025 00:06:04 +0000 (17:06 -0700)] 
test-xattr-util.c: migrate to new assertion macros (#38025)

We recently added a new set of assertion macros such as ASSERT_GE,
ASSERT_OK, ASSERT_EQ, ... which show not only the expression that failed
but also the values of the arguments of the expression. Let's use them.

4 months agotest: improve printing of assertion errors, allow more failures (#38004)
Yu Watanabe [Thu, 3 Jul 2025 00:01:22 +0000 (09:01 +0900)] 
test: improve printing of assertion errors, allow more failures (#38004)

4 months agotest-dns-search-domain: several cleanups
Yu Watanabe [Mon, 30 Jun 2025 08:17:22 +0000 (17:17 +0900)] 
test-dns-search-domain: several cleanups

- use STRV_MAKE() macro,
- add several missing assertions,
- use more suitable ASSERT_XYZ() macros,
- drop TEST(dns_search_domain_unlink_all), as it is already tested in
  TEST(dns_search_domain_new_system_limit).

4 months agouserdbctl: Fix error handling
DaanDeMeyer [Wed, 2 Jul 2025 13:15:32 +0000 (15:15 +0200)] 
userdbctl: Fix error handling

4 months agoNEWS: fix typo
Yu Watanabe [Wed, 2 Jul 2025 21:57:23 +0000 (06:57 +0900)] 
NEWS: fix typo

4 months agocore/socket: introduce DeferTrigger= (#37505)
Yu Watanabe [Wed, 2 Jul 2025 21:33:23 +0000 (06:33 +0900)] 
core/socket: introduce DeferTrigger= (#37505)

Follow-up for #37222 and #37421

4 months agopcrlock: include pcrlock features in exit status
Lennart Poettering [Wed, 2 Jul 2025 13:46:34 +0000 (15:46 +0200)] 
pcrlock: include pcrlock features in exit status

Fixes: #38019
4 months agologind: pick up tty info from utmp only for tty sessions (#38034)
Lennart Poettering [Wed, 2 Jul 2025 20:42:56 +0000 (22:42 +0200)] 
logind: pick up tty info from utmp only for tty sessions (#38034)

Alternative for: #38027

4 months agoupdate NEWS with even more features for v258
Lennart Poettering [Wed, 2 Jul 2025 16:21:19 +0000 (18:21 +0200)] 
update NEWS with even more features for v258

4 months agologind: pick up tty info from utmp only for tty sessions 38034/head
Lennart Poettering [Wed, 2 Jul 2025 14:25:42 +0000 (16:25 +0200)] 
logind: pick up tty info from utmp only for tty sessions

Let's tighten the rules for picking up TTY information from utmp: let's
do so only for TTY session, nothing else. Apparently people have issues
with graphical sessions with certain terminal emulators that install
entries in utmp for each emulator window.

Alternative for: #38027

4 months agologind: use memdup_suffix0() where appropiate
Lennart Poettering [Wed, 2 Jul 2025 14:25:00 +0000 (16:25 +0200)] 
logind: use memdup_suffix0() where appropiate

memdup_suffix0() is the call of choice when we are dealing with an input
that might not be NUL terminated. strndup() assumes NUL termination.

4 months agozsh: remove _files prefixes
peelz [Wed, 2 Jul 2025 00:39:42 +0000 (20:39 -0400)] 
zsh: remove _files prefixes

Prefixes would be nice, but they appear to be very buggy.

A few examples:
- `udevadm test-builtin net_setup_link /sys<TAB><TAB>`: `/sysblock/`
- `udevadm test-builtin net_setup_link /sys/<TAB><TAB>`: `/sys/bin/`
- `journalctl /dev<TAB>`: `/dev//dev/`

4 months agologind: Don't match non-leader processes for utmp TTY determination
Myrrh Periwinkle [Wed, 2 Jul 2025 05:53:15 +0000 (12:53 +0700)] 
logind: Don't match non-leader processes for utmp TTY determination

This ensures we don't erroneously assign pseudoterminals created by
terminal emulators that use utempter to register themselves in utmp when
run under a GUI session that doesn't have a TTY assigned.

4 months agotests: print errno name rather than the message 38004/head
Zbigniew Jędrzejewski-Szmek [Tue, 1 Jul 2025 15:43:45 +0000 (17:43 +0200)] 
tests: print errno name rather than the message

The tests are written and consumed by developers. Errno descriptions are good
for users, but for developers the errno "name" is actually more useful, and
we need to always map the description back to the name to compare with the
code. Let's make things simpler for ourselves by printing the errno names
directly.

Example output:

src/test/test-tests.c:15: Assertion failed: Expected "-1" to succeed, but got error: -1/EPERM
src/test/test-tests.c:16: Assertion failed: Expected "-ENOANO" to succeed, but got error: -55/ENOANO
src/test/test-tests.c:20: Assertion failed: Expected "0" to be positive, but it is zero.
src/test/test-tests.c:62: Assertion failed: Expected "RET_NERRNO(mkdir("/i/will/fail/with/enoent", 666))" to fail with error -55/ENOANO, but got -2/ENOENT
src/test/test-tests.c:68: Assertion failed: Expected "0" to fail with errno 2/ENOENT, but it succeeded
src/test/test-tests.c:70: Assertion failed: Expected "mkdir("/i/will/fail/with/enoent", 666)" to fail with errno 55/ENOANO, but got 2/ENOENT

4 months agobasic/errno-list: add helper to print errno names
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 19:34:10 +0000 (21:34 +0200)] 
basic/errno-list: add helper to print errno names

4 months agotest-cgroup-util: print info about process before asserting
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 19:08:19 +0000 (21:08 +0200)] 
test-cgroup-util: print info about process before asserting

If this tests ever fails again, we should have at least a chance
to figure out what went wrong.

4 months agotest-cgroup-util: ignore -ENXIO in more places
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 19:00:16 +0000 (21:00 +0200)] 
test-cgroup-util: ignore -ENXIO in more places

In https://github.com/systemd/systemd/pull/38003, one test failed:
Unit tests / build (CLANG_ASAN_UBSAN):
src/test/test-cgroup-util.c:237: Assertion failed: Expected "r" to succeed, but got error: No such device or address

Checks for specific errors were added in ca82f0cbe2db096bc7ff81280b5683ea1beae534,
partially relaxed in e92d699dde746355bba893b2375b7937a52d9e05.
cg_pidref_get_unit() and cg_pid_get_slice() enter a deep chain of calls,
so it's hard to guess where the failure occurred. But those two calls
expect the cgroup path to be "well formed". When we're running in CI,
we don't have full control over what is happening on the machine,
so let's suppress that error too.

4 months agotest-cgroup-util: minor simplification
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 18:14:06 +0000 (20:14 +0200)] 
test-cgroup-util: minor simplification

4 months agotests: use new ASSERT_OK_OR macro
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 18:12:32 +0000 (20:12 +0200)] 
tests: use new ASSERT_OK_OR macro

4 months agotests: add new ASSERT_OK_OR macro
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 17:11:13 +0000 (19:11 +0200)] 
tests: add new ASSERT_OK_OR macro

IN_SET() fails if __VA_ARGS__ is just one item. I inserted a bogus 0 item into
the check to work around this.

4 months agotests: print numeric error value too on failure
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 17:02:50 +0000 (19:02 +0200)] 
tests: print numeric error value too on failure

The error message is not always meaningful. Also, sometimes we care about the
sign of the value, and we ignore the sign of the error in the printing machinery.

The messages for errno are changed to say "errno" instead of "error". The problem with
the previous formalation is that our errors are always negative and errnos are
positive, so when we print the numerical value, we cannot use the word for both.

Example output:
src/test/test-tests.c:15: Assertion failed: Expected "-1" to succeed, but got error: -1/Operation not permitted
src/test/test-tests.c:16: Assertion failed: Expected "-ENOANO" to succeed, but got error: -55/No anode
src/test/test-tests.c:61: Assertion failed: Expected "0" to fail with error -2/"No such file or directory", but it succeeded
src/test/test-tests.c:62: Assertion failed: Expected "RET_NERRNO(mkdir("/i/will/fail/with/enoent", 666))" to fail with error -55/"No anode", but got the following error: -2/No such file or directory
src/test/test-tests.c:68: Assertion failed: Expected "0" to fail with errno 2/"No such file or directory", but it succeeded
src/test/test-tests.c:70: Assertion failed: Expected "mkdir("/i/will/fail/with/enoent", 666)" to fail with errno 55/"No anode", but got the following errno: 2/No such file or directory

4 months agotests: cast to intmax_t instead of printing to a temp buffer
Zbigniew Jędrzejewski-Szmek [Sun, 29 Jun 2025 20:57:08 +0000 (22:57 +0200)] 
tests: cast to intmax_t instead of printing to a temp buffer

We can do this for int types, i.e. the variants where we expect a
success/error code. The macros which do generating comparison operations
also support floats so we shouldn't use intmax_t there.

The code is shorter and calling printf once is certainly more efficient.

4 months agotest-tests: move assert tests to new file
Zbigniew Jędrzejewski-Szmek [Sun, 29 Jun 2025 20:15:29 +0000 (22:15 +0200)] 
test-tests: move assert tests to new file

Those macros are defined in tests.[ch], so the tests should be in test-tests.c.

4 months agoshared/tests: indent defines
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 16:36:37 +0000 (18:36 +0200)] 
shared/tests: indent defines

4 months agobasic: move missing_sched.h -> include/sched.h 37960/head
Yu Watanabe [Tue, 17 Jun 2025 21:16:14 +0000 (06:16 +0900)] 
basic: move missing_sched.h -> include/sched.h

4 months agobasic: move missing_fcntl.h -> include/fcntl.h
Yu Watanabe [Wed, 18 Jun 2025 00:42:47 +0000 (09:42 +0900)] 
basic: move missing_fcntl.h -> include/fcntl.h

4 months agobasic: move missing_socket.h -> include/sys/socket.h
Yu Watanabe [Wed, 18 Jun 2025 00:36:52 +0000 (09:36 +0900)] 
basic: move missing_socket.h -> include/sys/socket.h

4 months agobasic: move missing_pidfd.h -> include/sys/pidfd.h
Yu Watanabe [Wed, 18 Jun 2025 00:32:01 +0000 (09:32 +0900)] 
basic: move missing_pidfd.h -> include/sys/pidfd.h

4 months agobasic: move missing_mman.h -> include/sys/mman.h
Yu Watanabe [Wed, 18 Jun 2025 00:10:09 +0000 (09:10 +0900)] 
basic: move missing_mman.h -> include/sys/mman.h

This also makes memfd-util.h include sys/mman.h, as it is necessary for
specifying flags to memfd_create_wrapper() or memfd_new_full().

4 months agobasic: move missing_wait.h -> include/sys/wait.h
Yu Watanabe [Wed, 18 Jun 2025 00:02:43 +0000 (09:02 +0900)] 
basic: move missing_wait.h -> include/sys/wait.h

4 months agobasic: move missing_random.h -> include/sys/random.h
Yu Watanabe [Tue, 17 Jun 2025 23:58:34 +0000 (08:58 +0900)] 
basic: move missing_random.h -> include/sys/random.h

4 months agoman/systemd-sysext: list ephemeral/ephemeral-import in the list of options
Vitaly Kuznetsov [Mon, 30 Jun 2025 14:56:14 +0000 (16:56 +0200)] 
man/systemd-sysext: list ephemeral/ephemeral-import in the list of options

ephemeral/ephemeral-import are described as possible '--mutable' options but
not present in the list. Note, "systemd-sysext --help" lists them correctly.

4 months agocore/transaction: be explicit about cyclic ordering relationship 38014/head
Mike Yuan [Mon, 30 Jun 2025 15:37:58 +0000 (17:37 +0200)] 
core/transaction: be explicit about cyclic ordering relationship

Inspired by https://github.com/systemd/systemd/pull/35417#discussion_r1867868221

4 months agocore/transaction: use strextendf_with_separator() where appropriate
Mike Yuan [Mon, 30 Jun 2025 15:29:38 +0000 (17:29 +0200)] 
core/transaction: use strextendf_with_separator() where appropriate

4 months agocore/transaction: inline one iterator var
Mike Yuan [Mon, 30 Jun 2025 15:14:05 +0000 (17:14 +0200)] 
core/transaction: inline one iterator var

4 months agocore/transaction: do not attempt to log "n/a" as a journal field
Mike Yuan [Mon, 30 Jun 2025 15:57:08 +0000 (17:57 +0200)] 
core/transaction: do not attempt to log "n/a" as a journal field

Follow-up for 3cf6a3a3d4acf8347ccd0250274f517e6b2e9fe6

4 months agotest-xml: Use ASSERT_OK() instead of ASSERT_GE()
Daan De Meyer [Mon, 30 Jun 2025 11:52:08 +0000 (13:52 +0200)] 
test-xml: Use ASSERT_OK() instead of ASSERT_GE()

Follow up for 7a58b45017c678a2907ece2676372fe6d71e365e

4 months agoTEST-07-PID1: add test cases for DeferTrigger= 37505/head
Mike Yuan [Sun, 18 May 2025 01:40:14 +0000 (03:40 +0200)] 
TEST-07-PID1: add test cases for DeferTrigger=

4 months agounits/systemd-{udevd,journald}*.socket: enable DeferTrigger=
Mike Yuan [Sun, 18 May 2025 00:24:38 +0000 (02:24 +0200)] 
units/systemd-{udevd,journald}*.socket: enable DeferTrigger=

Refer to d766c75acdd825abe1bcfd45406ae2e609a008b6 for the rationale
behind the udevd change.

systemd-journald.service conflicts with soft-reboot.target,
so make sure anything surviving soft-reboot and trying
to log to journal doesn't fail the socket units.

4 months agocore/socket: introduce DeferTrigger= and DeferTriggerMaxSec=
Mike Yuan [Fri, 16 May 2025 16:10:46 +0000 (18:10 +0200)] 
core/socket: introduce DeferTrigger= and DeferTriggerMaxSec=

Alternative to b50f6dbe574b0421db7dbf200ad951186382277d

The commit naively returned early from socket_enter_running(), which however
is quite problematic, as the socket will be woken up over and over again
without doing a thing, until we eventually hit Poll/TriggerLimit*=.
On top of that it requires hacks to hold the start job for initrd-switch-root.service
up. Overall I doubt that is the right approach.

Let's instead hook this into our job engine, and try to activate
the service again when some other units are stopped. If all installed
jobs have been run yet we're still seeing the conflict or the manually
selected timeout is reached, fail the socket as before.

4 months agocore/transaction: add job mode "lenient" as an even weaker version of _FAIL
Mike Yuan [Sun, 18 May 2025 17:54:51 +0000 (19:54 +0200)] 
core/transaction: add job mode "lenient" as an even weaker version of _FAIL

4 months agounits/initrd-cleanup.service: drop --job-mode=replace-irreversibly hack
Mike Yuan [Mon, 30 Jun 2025 10:47:21 +0000 (12:47 +0200)] 
units/initrd-cleanup.service: drop --job-mode=replace-irreversibly hack

This partially reverts d766c75acdd825abe1bcfd45406ae2e609a008b6.

The offending commit tries to block systemd-udevd.service
from being activated during switch-root, but it is a dirty hack
and causes problems with e.g. Ctrl-Alt-Delete handling which
actually need to start a conflicting target. Let's revert
this here, and the original issue will be resolved in a cleaner
fashion in later commits.

4 months agopo: Translated using Weblate (Greek)
Jim Spentzos [Mon, 30 Jun 2025 10:36:33 +0000 (10:36 +0000)] 
po: Translated using Weblate (Greek)

Currently translated at 35.7% (92 of 257 strings)

Co-authored-by: Jim Spentzos <jimspentzos2000@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/el/
Translation: systemd/main

4 months agocore/socket: use ERROR_IS_NEG_* at one more place
Mike Yuan [Fri, 16 May 2025 16:17:18 +0000 (18:17 +0200)] 
core/socket: use ERROR_IS_NEG_* at one more place

4 months agocore/unit: correct indentation
Mike Yuan [Thu, 22 May 2025 18:24:08 +0000 (20:24 +0200)] 
core/unit: correct indentation

Follow-up for 54e1f676a2d3fa8c39beac84fe5027d9276d491d

4 months agonspawn: Add --bind-user-shell= to control shells for --bind-user
Nick Labich [Fri, 27 Jun 2025 15:39:46 +0000 (11:39 -0400)] 
nspawn: Add --bind-user-shell= to control shells for --bind-user

Prior to this change, no user shell can be specified in the user
records passed into a container via --bind-user=. This new option
allows users to:

1. When false (the default), continue to specify no user shell for
   each bound user record, resulting in the use of the container's
   default shell for bound users.

2. When true, include each host user's shell in the corresponding
   user record passed into a container (via --bind-user=).

3. When an absolute path, set that path as the user shell for each
   user record passed into a container (via --bind-user=).

This does not change the existing behavior, but allows users to
opt-in to either copy the shells specified by the host user records
or override the shell explicitly by path.

4 months agorepart: add support for `Format=empty`
Michael Ferrari [Fri, 27 Jun 2025 16:26:10 +0000 (18:26 +0200)] 
repart: add support for `Format=empty`

This is a new meta value for the `Format=` option, which is equivalent
as specifying `Label=_empty` and `NoAuto=1` for compatibility with
sd-sysupdate.

Closes: https://github.com/systemd/systemd/issues/34596
4 months agovmspawn: Use host_device driver for --extra-drive block devices
Nick Labich [Fri, 27 Jun 2025 15:52:09 +0000 (11:52 -0400)] 
vmspawn: Use host_device driver for --extra-drive block devices

Extra drives attached to VMs use the file driver for regular files and the
host_device driver for block devices.

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

4 months agotree-wide: include unistd.h where necessary
Yu Watanabe [Tue, 24 Jun 2025 19:51:20 +0000 (04:51 +0900)] 
tree-wide: include unistd.h where necessary

We use symbols provided by unistd.h without including it. E.g.
open(), close(), read(), write(), access(), symlink(), unlink(), rmdir(),
fsync(), syncfs(), lseek(), ftruncate(), fchown(), dup2(), pipe2(),
getuid(), getgid(), gettid(), getppid(), pipe2(), execv(), _exit(),
environ, STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO, F_OK, and their
friends and variants, so on.

Currently, unistd.h is indirectly included mainly in the following two paths:
- through missing_syscall.h, which is planned to covert to .c file.
- through signal.h -> bits/sigstksz.h, which is new since glibc-2.34.
  Note, signal.h is included by sd-eevent.h. So, many source files
  indirectly include unistd.h if newer glibc is used.

Currently, our baseline on glibc is 2.31. We need to support glibc older
than 2.34, but unfortunately, we do not have any CI environments with
such old glibc. CIFuzz uses glibc-2.31, but it builds only fuzzers, and
many files are even not compiled.

4 months agoconf-files: several follow-ups for #37972 (#37997)
Yu Watanabe [Mon, 30 Jun 2025 03:47:49 +0000 (12:47 +0900)] 
conf-files: several follow-ups for #37972 (#37997)

The PR #37972 was merged without final review by mistake, and has
several issues.
This reverts some of the commits in the PR, and fix several issues.

4 months agoTEST-17-UDEV: check the exit code at last 37997/head
Yu Watanabe [Sat, 28 Jun 2025 01:39:32 +0000 (10:39 +0900)] 
TEST-17-UDEV: check the exit code at last

Otherwise, it is hard to debug when the test failed.

4 months agoconf-files: fix an empty root handling in conf_files_list_strv()
Yu Watanabe [Sat, 28 Jun 2025 01:25:05 +0000 (10:25 +0900)] 
conf-files: fix an empty root handling in conf_files_list_strv()

Before 50c81130b69d04288f50217bede709bac6ca2b1a, the function used
chase(), hence if root is an empty string, each config directory made
prefixed with the current working directory if it is relative. See
implementation of chase().

With 50c81130b69d04288f50217bede709bac6ca2b1a, conf_files_list_strv()
internally uses chaseat(), hence each config directory is not prefixed
anymore even if it is relative.

To restore the previous behavior, this makes
- if root is an empty string, prefix each config directories with the
  current working directory if relative.
- if root is relative, make it absolute to make the prefixed results also
  absolute, and debugging logs show absolute paths.
- use chaseat_prefix_root() to prefix the results, for safety.

Follow-ups for 50c81130b69d04288f50217bede709bac6ca2b1a.

4 months agopath-util: move empty_or_root_to_null() from chase.c
Yu Watanabe [Sat, 28 Jun 2025 11:55:11 +0000 (20:55 +0900)] 
path-util: move empty_or_root_to_null() from chase.c

And rename it to empty_or_root_harder_to_null(), as it also checks if
the input path effectively points to the root by calling path_is_root().
This also adds simple test cases for the function.

4 months agoconf-files: fstatat() sets errno on failure
Yu Watanabe [Sat, 28 Jun 2025 02:00:56 +0000 (11:00 +0900)] 
conf-files: fstatat() sets errno on failure

Follow-up for 50c81130b69d04288f50217bede709bac6ca2b1a.

4 months agoRevert "conf-files: introduce CONF_FILES_CHASE_BASENAME flag"
Yu Watanabe [Sat, 28 Jun 2025 14:03:44 +0000 (23:03 +0900)] 
Revert "conf-files: introduce CONF_FILES_CHASE_BASENAME flag"

This reverts commit 49653adef3ff47c7bcd1098c763eb2a55297df15.

The commit was merged without review, and has several issues.
Let's revert the change now, and address the issue pointed out by
the commit later in another way.

4 months agoconf-files: drop use of CONF_FILES_CHASE_BASENAME in conf_files_list_with_replacement()
Yu Watanabe [Sat, 28 Jun 2025 13:58:05 +0000 (22:58 +0900)] 
conf-files: drop use of CONF_FILES_CHASE_BASENAME in conf_files_list_with_replacement()

The flag has several potential issues, and will be dropped in the next
commit.

Follow-up for 41fb58595a22d50ca79278a64de4bff28f6dfd24.

4 months agoRevert "pretty-print: also chase symlinks in the last component"
Yu Watanabe [Sat, 28 Jun 2025 13:54:04 +0000 (22:54 +0900)] 
Revert "pretty-print: also chase symlinks in the last component"

This reverts commit 2f2977cab8ee94e5479d86c93c7a4346789a920a.

The commit was mistakenly merged without review. Also as pointed at
https://github.com/systemd/systemd/pull/37972#discussion_r2173234198
now the output is confusing. Let's revert at least now.

4 months agoRevert "tree-wide: use CONF_FILES_CHASE_BASENAME where root directory is specified"
Yu Watanabe [Sat, 28 Jun 2025 13:52:22 +0000 (22:52 +0900)] 
Revert "tree-wide: use CONF_FILES_CHASE_BASENAME where root directory is specified"

This reverts commit 6b606f3586db64a1010a64921d302028134e1902.

The commit was mistakenly merged without review, and has several issues.
Let's revert at least now.

4 months agomeson: drop custom_target names (#38003)
Yu Watanabe [Sat, 28 Jun 2025 20:58:26 +0000 (05:58 +0900)] 
meson: drop custom_target names (#38003)

4 months agomeson: adjust indentation 38003/head
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 15:18:35 +0000 (17:18 +0200)] 
meson: adjust indentation

4 months agomeson: drop explicit custom_target names
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 15:14:50 +0000 (17:14 +0200)] 
meson: drop explicit custom_target names

[1] says:
> Since 0.60.0 the name argument is optional and defaults to the basename of
> the first output
We specify >= 0.62 as the supported version, so drop the duplicate name in all cases
where it is the same as outputs[0], i.e. almost all cases.

[1] https://mesonbuild.com/Reference-manual_functions.html#custom_target

4 months agoman: drop inadvertently added -x, make shellcheck clean
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 13:31:46 +0000 (15:31 +0200)] 
man: drop inadvertently added -x, make shellcheck clean

aecb6eaed7d39d73f296c86a882c644b18b7e634 added -x most likely for debugging,
drop it. Also, adjust quoting to make the generated scripts liked by shellcheck.

4 months agomeson: quote paths in generated systemd-runtest.env
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 13:10:00 +0000 (15:10 +0200)] 
meson: quote paths in generated systemd-runtest.env

Looking at aecb6eaed7d39d73f296c86a882c644b18b7e634, it seems that we
want build paths with spaces to be supported. Let's use 'printf %q' here
to make that work. Also, use capture:true to make the command less complicated.

4 months agorepart: fix typo
Yu Watanabe [Fri, 27 Jun 2025 19:32:27 +0000 (04:32 +0900)] 
repart: fix typo

Follow-up for e7b4b2968e0e3752cdde290c57fe208eab9f6265.

4 months agotest-conf-files: use ASSERT_OK() and friends 37972/head
Yu Watanabe [Fri, 27 Jun 2025 19:12:27 +0000 (04:12 +0900)] 
test-conf-files: use ASSERT_OK() and friends

4 months agotree-wide: use CONF_FILES_CHASE_BASENAME where root directory is specified
Yu Watanabe [Fri, 27 Jun 2025 01:42:24 +0000 (10:42 +0900)] 
tree-wide: use CONF_FILES_CHASE_BASENAME where root directory is specified

Otherwise, the result may point to outside of the root directory.

This also sets CONF_FILES_REGULAR and CONF_FILES_FILTER_MASKED, as the
callers will call fopen() or friends for the result, thus the enumerated
results must be non-empty regular files.

4 months agopretty-print: also chase symlinks in the last component
Yu Watanabe [Fri, 27 Jun 2025 01:07:21 +0000 (10:07 +0900)] 
pretty-print: also chase symlinks in the last component

Otherwise, this may shows files outside of the specified root directory.

4 months agoconf-files: rework conf_files_list_with_replacement()
Yu Watanabe [Thu, 26 Jun 2025 18:45:56 +0000 (03:45 +0900)] 
conf-files: rework conf_files_list_with_replacement()

Previously, symlinks in the replacement was not chased, hence we may
inserted a path to outside of the root directory, or we may have wrong
judgement whether we should insert the replacement or not.

This makes the symlinks in the replacement also resolved.
Also, as the function is only used by tmpfiles and sysusers, this
enables CONF_FILES_REGULAR, CONF_FILES_CHASE_BASENAME, and
CONF_FILES_FILTER_MASKED_BY_SYMLINK flags.

4 months agoconf-files: introduce CONF_FILES_CHASE_BASENAME flag
Yu Watanabe [Fri, 27 Jun 2025 00:20:08 +0000 (09:20 +0900)] 
conf-files: introduce CONF_FILES_CHASE_BASENAME flag

Previously, when a root directory is specified to conf_files_list() and
friends, the last component of each result was not resolved, even though
they internally chases the last component. So the caller needs to chase
the path again when the file is used.

This introduce a new flag that makes the whole path of each result is
resolved, hence caller can use it as is.

4 months agoconf-files: chase symlink files in conf directories
Yu Watanabe [Thu, 26 Jun 2025 16:18:35 +0000 (01:18 +0900)] 
conf-files: chase symlink files in conf directories

Previously, symlinks in paths to conf directories are chased, but
symlink files in conf directories were not.

This also makes symlink files in conf directories chased. And, any
unresolvable symlinks are dropped, even if no verification is requested.

4 months agouserdb: fix enumeration of .membership files
Yu Watanabe [Thu, 26 Jun 2025 00:42:16 +0000 (09:42 +0900)] 
userdb: fix enumeration of .membership files

The man page nss-systemd(8) says

> The contents of these files are currently not read, and the files
> should be created empty.

But previously we filtered out such files, as the CONF_FILES_FILTER_MASKED
flag checks if a file is empty (or symlink to null), thus any empty files
were ignored.

To accept empty .membership files, let's use CONF_FILES_FILTER_MASKED_BY_SYMLINK.

Fixes #37945.

4 months agoconf-files: split CONF_FILES_FILTER_MASKED flag into two
Yu Watanabe [Thu, 26 Jun 2025 13:52:17 +0000 (22:52 +0900)] 
conf-files: split CONF_FILES_FILTER_MASKED flag into two

4 months agostat-util: split null_or_empty() into two
Yu Watanabe [Thu, 26 Jun 2025 13:49:31 +0000 (22:49 +0900)] 
stat-util: split null_or_empty() into two

4 months agotest-xml: migrate to new assertion macros (#37990)
Yaping Li [Fri, 27 Jun 2025 18:53:12 +0000 (11:53 -0700)] 
test-xml: migrate to new assertion macros (#37990)

We recently added a new set of assertion macros such as ASSERT_GE,
ASSERT_OK, ASSERT_EQ, ... which show not only the expression that failed
but also the values of the arguments of the expression. Let's use them.

4 months agobasic/include: trivial cleanups for libc header wrapper (#37937)
Mike Yuan [Fri, 27 Jun 2025 14:03:10 +0000 (16:03 +0200)] 
basic/include: trivial cleanups for libc header wrapper (#37937)

4 months agoresolved: don't wait for TLS close_notify replies unnecessarily
Lennart Poettering [Thu, 26 Jun 2025 10:22:41 +0000 (12:22 +0200)] 
resolved: don't wait for TLS close_notify replies unnecessarily

This is based on #35764 by Guruswamy Basavaiah, but covers further code
paths.

This ensures that when we initiate a TLS shutdown we'll write out our
own close_notify message, but not wait for the close_notify reply from
the server side anymore.

Replaces: #35764

4 months agoresolved: when determining error to return, prefer "conclusive" over "inconclusive...
Lennart Poettering [Thu, 26 Jun 2025 21:04:07 +0000 (23:04 +0200)] 
resolved: when determining error to return, prefer "conclusive" over "inconclusive" errors

When asked to look something up, and all scopes we contact fail we need
to pick a suitable error code for the failure, and given that we look up
things on multiple scopes we might have multiple errors to choose from.
So far we simply picked the error from the last scope in the list, which
hence would be pretty arbitrary.

Let's tweak this a bit, and if we have multiple errors to choose from,
let's prefer "conclusive" failures over "inconclusive" ones. The
"inconclusive" ones in this sense are the ones where we didn't even issue
a request, but couldn't even do that because we had no server, no
network or things like that. The "conclusive" ones are the errors we got
from a server, that hence a "real" in a way.

This addresses the confusion described in #37969. For LLMNR lookups we
generally refuse looking up A addresses via IPv6 and AAAA via IPv4. This
generates a DNS_TRANSACTION_NO_SERVERS error, which we would then return
for one type of lookup but not for the other, because the IPv6 scope is
generally created after the IPv4 one, and hence so far won.

Fixes: #37969
4 months agocpu-set-util: fix null pointer dereference and several cleanups (#37900)
Lennart Poettering [Fri, 27 Jun 2025 12:59:25 +0000 (14:59 +0200)] 
cpu-set-util: fix null pointer dereference and several cleanups (#37900)

Fixes CID#1611618.

4 months agotimer: Do not recalculate monotonic elapse time on clock change
Fleuria [Thu, 3 Apr 2025 13:18:38 +0000 (20:18 +0700)] 
timer: Do not recalculate monotonic elapse time on clock change

The only clock change that affects monotonic timers is suspend causing
CLOCK_MONOTONIC to fall behind CLOCK_BOOTTIME. However, monotonic timers
that use CLOCK_BOOTTIME are not intended to have their elapse time
changed after a suspend. Hence condition the calculation of monotonic
timers’ elapse times on the cause not being a clock change.

Fixes #29245

4 months agotest-network: wait for all addresses and routes configured before start monitoring
Yu Watanabe [Thu, 26 Jun 2025 21:23:09 +0000 (06:23 +0900)] 
test-network: wait for all addresses and routes configured before start monitoring

Otherwise, kernel may announce configuration of an address or route
after 'ip monitor' is started.

This also makes the test check if the whole output of 'ip monitor' is
empty. Otherwise, if the test fails, it is hard to find what is wrong.

Follow-ups for 912a48572de1411cff2964452e0d7a021b43921f and
bcb9e72b6bf57d6d2aec581fedc4a33d6d826e2f.

Fixes #37982.