Commit Graph
82477 Commits
Author SHA1 Message Date
Lennart Poettering c5de7b14ae chase: when chasing paths, trigger automounts
As it turns out open() with O_PATH does *not* trigger autofs, you get a
reference to the autofs inode, if not triggered.

But there's a way out: open_tree() (when specified without
OPEN_TREE_CLONE) is actually fully equivalent to open() with O_PATH –
with the exception of one thing: it *does* trigger automounts.

Thanks for Christian Brauner for pointing me to this and saving my day.

Fixes: #33155
2025-07-03 22:18:56 +01:00
Luca Boccassi 0754db571b openssl-util: allow to build with openssl without UI support (#38041)
This makes it possible to build systemd with
-Dc_args='-DOPENSSL_NO_UI_CONSOLE=1'. Hopefully, now systemd can be
built with other openssl implementations, like BoringSSL, which deos not
support UIs.

Closes #38024.
2025-07-03 22:11:02 +01:00
Mike Yuan b68179c072 fd-util: Move RAW_O_LARGEFILE and O_ACCMODE_STRICT definitions to fd-util.h (#38051) 2025-07-03 22:27:39 +02:00
Lennart Poettering 03b7de45d8 tree-wide: Add more socket units (#37991) 2025-07-03 17:43:20 +02:00
DaanDeMeyer 4a8c395167 tree-wide: Add initrd presets
Currently, when running "systemctl preset-all --root=xxx" in mkosi
to enable/disable units for initrds, the system presets are used.
The problem with this approach is that the system presets are written
for the system, and that is not necessarily ideal for an initrd, but we
still want to use the same packages in the initrd that we install in the
system, so let's introduce a separate directory for initrd presets which
is used to pick up preset files from when we detect that we're configuring
an initrd (by looking for /etc/initrd-release).

We also introduce a systemd preset file for the initrd, which is based on
the system one, except with all the stuff unnecessary for the initrd removed.
2025-07-03 17:43:01 +02:00
Lennart Poettering 77bf8f8905 conf-files: if CONF_FILES_REGULAR|CONF_FILES_DIRECTORY is used together allow either file or dir
This fixes a a bug introduced by
50c81130b6.
2025-07-03 17:41:07 +02:00
Yu Watanabe ea2c74744b ci: add test case for building without OpenSSL UI support 2025-07-03 22:10:57 +09:00
Yu Watanabe d1d16c624d 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.
2025-07-03 22:10:57 +09:00
DaanDeMeyer 1543c2385c fd-util: Move O_ACCMODE_STRICT to fd-util.h
We're still discussing whether we want to remove this or not, but
regardless of whether we end up removing it or not, it's something
we add ourselves and as such should not live in our headers that
override glibc headers, so let's move it to fd-util.h.
2025-07-03 14:28:14 +02:00
DaanDeMeyer cefec8f6ce fd-util: Move RAW_O_LARGEFILE definition to fd-util.h
This is not something that comes from glibc, but which we invent
ourselves. As such, it should not be part of our overrides of glibc
headers, but instead should be part of one of our own headers, so
let's move it to fd-util.h.

Follow up for 194a690181
2025-07-03 14:18:50 +02:00
Daan De Meyer 76e3cc469d Move missing_xyz.h for glibc headers to src/basic/include/ (#37960) 2025-07-03 13:47:46 +02:00
Zbigniew Jędrzejewski-Szmek 867cba15bc 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
2025-07-03 13:46:40 +02:00
Frede Braendstrup f1a00fcb97 fix: UnsetProperty example in systemd.link.xml 2025-07-03 18:37:03 +09:00
Daan De Meyer 67b2cb7769 test: Add tests for various varlink socket units
Let's make sure these socket units work as expected by stopping the
related services and making sure the services are started as expected
when a client connects to the corresponding socket.
2025-07-03 11:24:03 +02:00
Daan De Meyer ce06fad9c5 udev: Fix initializing varlink server from listen fd
manager_listen_fds() instructs sd_listen_fds_with_names() to unset
the environment which means that when sd_varlink_server_listen_auto()
is called from manager_start_varlink_server(), when it eventually calls
sd_listen_fds_with_names() it will return zero because the environment
has already been unset in manager_listen_fds().

Fix the issue by not using sd_varlink_server_listen_auto() but instead
keeping track of the varlink socket in manager_listen_fds() and returning
it and passing it to manager_start_varlink_server().
2025-07-03 11:22:34 +02:00
Daan De Meyer 0470754f9d login: Add varlink socket unit 2025-07-03 11:22:34 +02:00
Daan De Meyer 0eb59bd5ae login: Add missing newline between headers 2025-07-03 11:22:34 +02:00
Daan De Meyer b0ea79c5b5 network: Add varlink socket unit 2025-07-03 11:22:34 +02:00
Luca Boccassi a63f0ea73d test: allow to run test-local-addresses with IPv6 disabled by default, and assume RTA_VIA is always supported (#38039) 2025-07-03 09:58:02 +01:00
Yu Watanabe 34af1513d0 fuzz: avoid assertion for ExecContext.private_var_tmp triggered
Follow-up for 6156bec7a4.

Fixes #38037 and oss-fuzz#429112745.
2025-07-03 09:55:58 +01:00
Lennart Poettering 7ba5950307 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.
2025-07-03 09:20:19 +02:00
Yu Watanabe 3d38732179 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.
2025-07-03 12:51:22 +09:00
Yu Watanabe 16eaed02bc 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.
2025-07-03 12:51:22 +09:00
Yu Watanabe 11ad2b7169 test-local-addresses: use ASSERT_OK() and friends 2025-07-03 12:51:22 +09:00
Yu Watanabe 381eefffc5 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.
2025-07-03 12:46:57 +09:00
Yu Watanabe aada48970e 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 1abb592f2f.

Fixes #38033.
2025-07-03 12:46:35 +09:00
Yu Watanabe 9c9bf7e3fa core/transaction: minor tweaks for cyclic dependency logging (#38014) 2025-07-03 12:45:47 +09:00
Yu Watanabe 559d2c0349 meson: make -Wsequence-point warning critical
It detects e.g. multiple evaluations in macro.
2025-07-03 12:45:26 +09:00
Myrrh Periwinkle e523d9e9c4 logind: use manager_get_session_by_leader in manager_get_session_by_pidref 2025-07-03 09:16:22 +07:00
dependabot[bot] 1422c7f017 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>
2025-07-03 10:40:38 +09:00
dependabot[bot] ce8000d341 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>
2025-07-03 10:39:46 +09:00
Luca Boccassi e01ca3afdb 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 92100f14c3
2025-07-03 01:24:17 +01:00
Luca Boccassi 942cb8a7c0 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
2025-07-03 01:21:19 +01:00
Yaping Li 130ecc3bdd 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.
2025-07-03 09:06:04 +09:00
Yu Watanabe 5056d8332e test: improve printing of assertion errors, allow more failures (#38004) 2025-07-03 09:01:22 +09:00
Yu Watanabe 33527a9b0c 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).
2025-07-03 08:46:26 +09:00
DaanDeMeyer 84d878ca27 userdbctl: Fix error handling 2025-07-03 08:44:47 +09:00
Yu Watanabe 878c373370 NEWS: fix typo 2025-07-03 06:57:23 +09:00
Yu Watanabe 283bf66081 core/socket: introduce DeferTrigger= (#37505)
Follow-up for #37222 and #37421
2025-07-03 06:33:23 +09:00
Lennart Poettering 89e83aada8 pcrlock: include pcrlock features in exit status
Fixes: #38019
2025-07-02 22:43:35 +02:00
Lennart Poettering 0f2c5848b2 logind: pick up tty info from utmp only for tty sessions (#38034)
Alternative for: #38027
2025-07-02 22:42:56 +02:00
Lennart Poettering 2c8f502fc8 update NEWS with even more features for v258 2025-07-02 18:21:19 +02:00
Lennart Poettering bd578c2d66 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
2025-07-02 16:25:42 +02:00
Lennart Poettering d3f04a6fa5 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.
2025-07-02 16:25:06 +02:00
peelz 7c8070c781 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/`
2025-07-02 12:48:42 +01:00
Myrrh Periwinkle 1a088b564a 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.
2025-07-02 12:53:15 +07:00
Zbigniew Jędrzejewski-Szmek 6b60354656 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
2025-07-01 17:53:22 +02:00
Zbigniew Jędrzejewski-Szmek 6020ca2c23 basic/errno-list: add helper to print errno names 2025-07-01 17:51:49 +02:00
Zbigniew Jędrzejewski-Szmek 2d39c99fd8 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.
2025-07-01 17:51:49 +02:00
Zbigniew Jędrzejewski-Szmek 145100836e 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 ca82f0cbe2,
partially relaxed in e92d699dde.
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.
2025-07-01 17:51:49 +02:00