]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 months agoshared/bus-unit-util: define helper for RestrictNamespaces=/DelegateNamespaces=
Zbigniew Jędrzejewski-Szmek [Fri, 27 Jun 2025 12:15:46 +0000 (14:15 +0200)] 
shared/bus-unit-util: define helper for RestrictNamespaces=/DelegateNamespaces=

4 months agoshared/bus-unit-util: add helper for filter lists
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 15:54:06 +0000 (17:54 +0200)] 
shared/bus-unit-util: add helper for filter lists

4 months agoshared/bus-unit-util: add helper for NUMAMask=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 15:32:20 +0000 (17:32 +0200)] 
shared/bus-unit-util: add helper for NUMAMask=

4 months agoshared/bus-unit-util: use common helper for NUMAPolicy=
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jun 2025 15:26:54 +0000 (17:26 +0200)] 
shared/bus-unit-util: use common helper for NUMAPolicy=

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

4 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

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

4 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

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

4 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

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

4 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

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

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

4 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

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

4 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

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

5 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

5 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

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

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

5 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

5 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

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

5 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

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

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

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

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

5 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

5 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

5 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

5 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

5 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

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

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

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

5 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

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

5 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

5 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

5 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

5 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

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