Commit Graph
82462 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek af33eb4bb7 shared/bus-unit-util: define helper function for IPAddressAllow=/IPAddressDeny= 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek 235c580d80 shared/bus-unit-util: define helper for IODeviceLatencyTargetSec= 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek 335f7c7f01 shared/bus-unit-util: define helper for IODeviceWeight= 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek 5852a3e673 shared/bus-unit-util: add helper for group io limits 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek 619d378f55 shared/bus-unit-util: define helper for DeviceAllow= 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek ff0bbeff3a basic/cgroup-util: align tables 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek b4cf928f24 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.
2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek 40fcb3185d shared/bus-unit-util: define helper function for resource limits 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek 3704d0ad1b shared/bus-unit-util: define helper for Delegate= 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek ca197282fb shared/bus-unit-util: define helper for StartupAllowedMemoryNodes= and friends 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek 965489c935 shared/bus-unit-util: define helper for ManagedOOMMemoryPressureLimit= 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek 411b998da8 shared/bus-unit-util: fix appending of IODeviceLatencyTargetSec= 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek 010d2e42c2 shared/bus-unit-util: use common helper in one more place 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek e47fb4abd2 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.
2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek d2a9a2aabf shared/bus-unit-util: drop spurious parentheses 2025-07-03 10:37:33 +02: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 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
Zbigniew Jędrzejewski-Szmek 83e0e32944 test-cgroup-util: minor simplification 2025-07-01 17:51:49 +02:00
Zbigniew Jędrzejewski-Szmek ea64d55080 tests: use new ASSERT_OK_OR macro 2025-07-01 17:51:49 +02:00
Zbigniew Jędrzejewski-Szmek 367b325554 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.
2025-07-01 17:51:49 +02:00
Zbigniew Jędrzejewski-Szmek 0adbb11b4e 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
2025-07-01 17:51:49 +02:00
Zbigniew Jędrzejewski-Szmek 236f7ab07c 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.
2025-07-01 17:51:49 +02:00
Zbigniew Jędrzejewski-Szmek a1296fa5e5 test-tests: move assert tests to new file
Those macros are defined in tests.[ch], so the tests should be in test-tests.c.
2025-07-01 17:51:46 +02:00
Zbigniew Jędrzejewski-Szmek 89181651e6 shared/tests: indent defines 2025-07-01 17:47:34 +02:00
Vitaly Kuznetsov 821b453170 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.
2025-06-30 18:03:07 +01:00