]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
9 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)

9 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

9 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

9 months agotest: Add tests for various varlink socket units 37991/head
Daan De Meyer [Mon, 30 Jun 2025 11:41:04 +0000 (13:41 +0200)] 
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.

9 months agoudev: Fix initializing varlink server from listen fd
Daan De Meyer [Mon, 30 Jun 2025 11:06:46 +0000 (13:06 +0200)] 
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().

9 months agologin: Add varlink socket unit
Daan De Meyer [Fri, 27 Jun 2025 14:18:23 +0000 (16:18 +0200)] 
login: Add varlink socket unit

9 months agologin: Add missing newline between headers
Daan De Meyer [Fri, 27 Jun 2025 14:14:33 +0000 (16:14 +0200)] 
login: Add missing newline between headers

9 months agonetwork: Add varlink socket unit
Daan De Meyer [Fri, 27 Jun 2025 13:08:44 +0000 (15:08 +0200)] 
network: Add varlink socket unit

9 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)

9 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.

9 months agoshared/bus-unit-util: define helper for CapabilityBoundingSet=/AmbientCapabilities=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 15:24:53 +0000 (17:24 +0200)] 
shared/bus-unit-util: define helper for CapabilityBoundingSet=/AmbientCapabilities=

9 months agoshared/bus-unit-util: define helper function for rlimits
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 15:06:12 +0000 (17:06 +0200)] 
shared/bus-unit-util: define helper function for rlimits

Strictly speaking, we call startswith twice now. This duplication
shall be eliminated later.

9 months agoshared/bus-unit-util: define helper for StandardInputData=
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 12:06:32 +0000 (14:06 +0200)] 
shared/bus-unit-util: define helper for StandardInputData=

9 months agoshared/bus-unit-util: define helper for StandardInputText=
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 12:06:23 +0000 (14:06 +0200)] 
shared/bus-unit-util: define helper for StandardInputText=

9 months agoshared/bus-unit-util: define helper functions for StandardInput/Output/Error=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 14:55:34 +0000 (16:55 +0200)] 
shared/bus-unit-util: define helper functions for StandardInput/Output/Error=

9 months agoshared/bus-unit-util: define helper for LogFilterPatterns=
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 12:05:04 +0000 (14:05 +0200)] 
shared/bus-unit-util: define helper for LogFilterPatterns=

9 months agoshared/bus-unit-util: define helper for LogExtraFields=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 14:49:41 +0000 (16:49 +0200)] 
shared/bus-unit-util: define helper for LogExtraFields=

9 months agoTEST-54-CREDS: s/ImportCredentialEx/ImportCredential/ except for one place
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 13:48:55 +0000 (15:48 +0200)] 
TEST-54-CREDS: s/ImportCredentialEx/ImportCredential/ except for one place

This is a separate commit because the tests are supposed to pass with both
the old spelling and the new.

9 months agoshared/bus-unit-util: add helper for ImportCredentialEx= and fix naming confusion
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 12:03:32 +0000 (14:03 +0200)] 
shared/bus-unit-util: add helper for ImportCredentialEx= and fix naming confusion

We add D-Bus properties like "*Ex" because we cannot change the D-Bus property
type without breaking backward comapatibility. But those names are only for
D-Bus, not for config file stanzas or the command-line parser. There, we can
change the type, or in other words, there is no type, just a free-form string
whose interpretation we can extend or change. Commit
831f208783aeac443e6f2fc2efc3119535a032ef that added ProtectHostnameEx was
confused, because it added ImportCredentialEx in places where parsing of
ImportCredential should be have been extended.

On D-Bus, we send ImportCrednential in preference, and ImportCredentialEx only
when required. This way we send less bytes on the wire and support older
systems that don't understand the new property.

Partially resolves https://github.com/systemd/systemd/issues/37174.

9 months agoshared/bus-unit-util: define helper for LoadCredential=/LoadCredentialEncrypted=
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 12:02:56 +0000 (14:02 +0200)] 
shared/bus-unit-util: define helper for LoadCredential=/LoadCredentialEncrypted=

9 months agoshared/bus-unit-util: define helper for SetCredential=/SetCredentialEncrypted=
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 12:02:27 +0000 (14:02 +0200)] 
shared/bus-unit-util: define helper for SetCredential=/SetCredentialEncrypted=

9 months agoshared/bus-unit-util: define helper function for EnvironmentFile=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 14:45:49 +0000 (16:45 +0200)] 
shared/bus-unit-util: define helper function for EnvironmentFile=

9 months agoshared/bus-unit-util: add helper for SocketBindAllow=/SocketBindDeny=
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 11:58:11 +0000 (13:58 +0200)] 
shared/bus-unit-util: add helper for SocketBindAllow=/SocketBindDeny=

9 months agoshared/bus-unit-util: define helper for BPFProgram=
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 11:57:29 +0000 (13:57 +0200)] 
shared/bus-unit-util: define helper for BPFProgram=

9 months agoshared/bus-unit-util: add helper for IPIngressFilterPath=/IPEgressFilterPath=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 14:36:03 +0000 (16:36 +0200)] 
shared/bus-unit-util: add helper for IPIngressFilterPath=/IPEgressFilterPath=

9 months agoshared/bus-unit-util: define helper function for IPAddressAllow=/IPAddressDeny=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 14:18:50 +0000 (16:18 +0200)] 
shared/bus-unit-util: define helper function for IPAddressAllow=/IPAddressDeny=

9 months agoshared/bus-unit-util: define helper for IODeviceLatencyTargetSec=
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 11:54:12 +0000 (13:54 +0200)] 
shared/bus-unit-util: define helper for IODeviceLatencyTargetSec=

9 months agoshared/bus-unit-util: define helper for IODeviceWeight=
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 11:53:25 +0000 (13:53 +0200)] 
shared/bus-unit-util: define helper for IODeviceWeight=

9 months agoshared/bus-unit-util: add helper for group io limits
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 11:51:47 +0000 (13:51 +0200)] 
shared/bus-unit-util: add helper for group io limits

9 months agoshared/bus-unit-util: define helper for DeviceAllow=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 14:17:50 +0000 (16:17 +0200)] 
shared/bus-unit-util: define helper for DeviceAllow=

9 months agobasic/cgroup-util: align tables
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 13:58:22 +0000 (15:58 +0200)] 
basic/cgroup-util: align tables

9 months agoshared/bus-unit-util: define helper function for CPUQuota=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 13:43:55 +0000 (15:43 +0200)] 
shared/bus-unit-util: define helper function for CPUQuota=

Unfortunately we can't nicely fold it in with the other helpers, because
of the unusual naming mismatch: CPUQuota vs. CPUQuotaPerSecUSec.

9 months agoshared/bus-unit-util: define helper function for resource limits
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 13:28:59 +0000 (15:28 +0200)] 
shared/bus-unit-util: define helper function for resource limits

9 months agoshared/bus-unit-util: define helper for Delegate=
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 11:44:09 +0000 (13:44 +0200)] 
shared/bus-unit-util: define helper for Delegate=

9 months agoshared/bus-unit-util: define helper for StartupAllowedMemoryNodes= and friends
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 11:43:09 +0000 (13:43 +0200)] 
shared/bus-unit-util: define helper for StartupAllowedMemoryNodes= and friends

9 months agoshared/bus-unit-util: define helper for ManagedOOMMemoryPressureLimit=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 13:24:34 +0000 (15:24 +0200)] 
shared/bus-unit-util: define helper for ManagedOOMMemoryPressureLimit=

9 months agoshared/bus-unit-util: fix appending of IODeviceLatencyTargetSec=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 12:42:02 +0000 (14:42 +0200)] 
shared/bus-unit-util: fix appending of IODeviceLatencyTargetSec=

9 months agoshared/bus-unit-util: use common helper in one more place
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 12:31:18 +0000 (14:31 +0200)] 
shared/bus-unit-util: use common helper in one more place

9 months agoRename STRV_MAKE_EMPTY to just STRV_EMPTY
Zbigniew Jędrzejewski-Szmek [Wed, 4 Jun 2025 07:10:12 +0000 (09:10 +0200)] 
Rename STRV_MAKE_EMPTY to just STRV_EMPTY

Even though this creates a stack allocation, it is not a function macro, so
drop the "make" from the name.

9 months agoshared/bus-unit-util: drop spurious parentheses
Zbigniew Jędrzejewski-Szmek [Thu, 29 May 2025 09:39:48 +0000 (11:39 +0200)] 
shared/bus-unit-util: drop spurious parentheses

9 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.

9 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.

9 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.

9 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

9 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.

9 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.

9 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)

9 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.

9 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

9 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>
9 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>
9 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

9 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

9 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.

9 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)

9 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).

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

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

9 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

9 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
9 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

9 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

9 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

9 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.

9 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/`

9 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.

9 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

9 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

9 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.

9 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.

9 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

9 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

9 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.

9 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

9 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.

9 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.

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

9 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

9 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

9 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

9 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

9 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().

9 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

9 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

9 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.

9 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

9 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

9 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

9 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

9 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

9 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=

9 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.

9 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.

9 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

9 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.

9 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

9 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

9 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

9 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.

9 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