Commit Graph
81045 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 7dcbb48e46 various: do not use assert_se as a workaround in non-test code
This partially reverts 5332be60d3. I expect that
there is no practical difference, but it seems philosophically wrong to use
assert_se(), i.e. for the generation of the code in non-debug builds, just to
suppress a warning. We have _unused_ for that, use it.

I verified that we don't get warnings with clang and -DNDEBUG=1 with this patch.
2025-04-29 21:59:32 +09:00
Yu Watanabe bd4ab24f49 basic/include/linux: update kernel headers from v6.15-rc4 2025-04-29 21:58:25 +09:00
Daan De Meyer 4cf30a318a cleanup: update bug prone argument comments (#37281)
@DaanDeMeyer Obviously this doesn't fix nearly everything, so gradually
moving things over is probably a smart thing? It seems clang-tidy does
support drop in configs for example:

```
# SPDX-License-Identifier: LGPL-2.1-or-later
---
Checks: '
    -*,
    bugprone-argument-comment
'
WarningsAsErrors: '*'
```

Its a bit strange that `WarningsAsErrors` isn't propagated, but dropping
this file in src/report/.clang-tiday invokes:

```
[1314/1543][1.5s] /usr/bin/clang-tidy --use-color -extra-arg=-fno-caret-diagnostics -p=/home/jelle/projects/systemd/build -quiet /home/jelle/projec
ts/systemd/src/repart/repart.c
../src/repart/repart.c:4715:41: error: argument name 'pubkey' in comment does not match parameter name 'public' [bugprone-argument-comment,-warning
s-as-errors]
 4715 |                                         /* pubkey= */ NULL,      /* Turn this one off for the 2nd shard */
      |                                         ^
../src/shared/tpm2-util.h:281:108: note: 'public' declared here
  281 | int tpm2_calculate_sealing_policy(const Tpm2PCRValue *pcr_values, size_t n_pcr_values, const TPM2B_PUBLIC *public, bool use_pin, const Tpm2
PCRLockPolicy *policy, TPM2B_DIGEST *digest);
      |                                                                                                            ^
```

So that seems to behave as intended :)

And in some cases I am not sure if switching to the correct argument is
an improvement ie.:
```
../src/bootctl/bootctl-reboot-to-firmware.c:66:51: [38;2;190;132;255m0;1;31merror: argument name 'dispatch_table' in comment does not match paramet
er name 'table' [bugprone-argument-comment,-warnings-as-errors]
   66 |         r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL);
      | [38;2;190;132;255m0;1;32m                                                  ^
../src/systemd/sd-varlink.h:187:98: [38;2;190;132;255m0;1;36mnote: 'table' declared here
  187 | int sd_varlink_dispatch(sd_varlink *v, sd_json_variant *parameters, const sd_json_dispatch_field table[], void *userdata);
      | [38;2;190;132;255m0;1;32m                                                                                                 ^
```

or
```
../src/validatefs/validatefs.c:274:83: [38;2;190;132;255m0;1;31merror: argument name 'ret_len' in comment does not match parameter name 'len' [bugprone-argument-comment,-warnings-as-errors]
  274 |                         (void) blkid_probe_lookup_value(b, "PART_ENTRY_TYPE", &v, /* ret_len= */ NULL);
      | [38;2;190;132;255m0;1;32m                                                                                  ^
/usr/include/blkid/blkid.h:455:52: [38;2;190;132;255m0;1;36mnote: 'len' declared here
  455 |                         const char **data, size_t *len)
      | [38;2;190;132;255m0;1;32m                                                   ^
```

But that's also half a style thing with `len` winning over `ret_len`.
2025-04-29 14:34:37 +02:00
joo es 7d65961629 po: Translated using Weblate (Arabic)
Currently translated at 100.0% (257 of 257 strings)

po: Translated using Weblate (Arabic)

Currently translated at 93.7% (241 of 257 strings)

Co-authored-by: joo es <johndevand@tutanota.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ar/
Translation: systemd/main
2025-04-29 09:31:26 +09:00
David Rheinsberg 8166075498 basic/time-util: fix error handling of clock_nanosleep()
`clock_nanosleep()` returns error codes directly, rather than using
`errno`. Ensure that we use those codes, rather than checking for `<0`.
2025-04-28 19:31:16 +02:00
Jelle van der Waa 2517262d17 ssh-generator: update argument comments 2025-04-28 17:20:13 +02:00
Jelle van der Waa 50829577ea network: update argument comments 2025-04-28 17:15:55 +02:00
Mike Yuan f0deccd0c5 socket-activate: various modernizations (#37267) 2025-04-28 14:28:22 +02:00
joo es 3e9c399465 po: Translated using Weblate (Arabic)
Currently translated at 50.1% (129 of 257 strings)

Co-authored-by: joo es <johndevand@tutanota.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ar/
Translation: systemd/main
2025-04-28 08:31:05 +09:00
Mike Yuan 93fcf15ae4 socket-activate: set up SIGCHLD handler only in --accept mode 2025-04-27 20:32:36 +02:00
Mike Yuan 3bff4701d8 socket-activate: signal READY=1 once sockets are open for --accept mode 2025-04-27 20:26:42 +02:00
Mike Yuan 8a157f78f2 socket-activate: clean up control flow a bit 2025-04-27 20:21:10 +02:00
Mike Yuan 0964b022fa socket-activate: remove effectively unused 'name' param for exec_process() 2025-04-27 20:21:10 +02:00
Mike Yuan 7e672795be socket-activate: drop arg_args
To follow our usual coding style.
2025-04-27 20:21:10 +02:00
Mike Yuan bce295ef00 journald-server: use generic NOTIFY_READY message 2025-04-27 20:21:09 +02:00
Yu Watanabe 531cf425e8 man/busctl: many other commands can take --json=/-j
Also, in a futre remaining commands may also support the option.
Let's not mention which command support the options.

Closes #37210.
2025-04-27 10:41:34 +09:00
Yu Watanabe 4db8663b81 tree-wide: fix typo 2025-04-27 10:36:12 +09:00
Jesper Nilsson d93292bc59 man/sd_bus_slot_set_floating: Improve wording around b parameter 2025-04-27 09:18:05 +09:00
Mike Yuan 406f5ea700 Several Coverity fixes (#37253) 2025-04-26 16:58:54 +02:00
Yu Watanabe b09f351bd7 networkd: reduce the default IPv4 DAD (ACD) timeout and make it configurable (#37138)
RFC 5227 specifies randomized intervals to avoid that a large number of
hosts powered up at the same time send their message simultaneously.
Performing the conflict detection takes a variable time between 4 and 7
seconds from the beginning to the first announcement, as shown by the
following diagram where P indicates a probe and A an announcement:

```
     time(s)     0   1   2   3   4   5   6   7   8   9
                 +---+---+---+---+---+---+---+---+---+
     SHORTEST    P   P   P       A       A
     LONGEST         P       P       P       A       A
```

The host can't use the address until the first announcement is sent. 7
seconds is a very long time on modern computers especially considering
the fact that the round-trip time on current LAN technologies is at most
few milliseconds. Section 2.2 of the RFC addresses this matter and hints
that a future standard will adjust those timeouts; however that standard
doesn't exist yet.

Make the timeout configurable via a new
"IPv4DuplicateAddressDetectionTimeoutSec=" option. The intervals defined
in the RFC are then scaled proportionally so that the duration of the
conflict detection takes at most the given value. Interval happening
after the first announcement are not scaled, as recommended by the RFC.

Also reduce the default value from 7s to 200ms, which is a more suitable
value for today's technology.
2025-04-26 16:19:33 +09:00
Beniamino Galvani 2451cd2512 networkd: reduce the IPv4 DAD timeout to 200ms
The original timeout of 7 seconds is very long for today's networks. Reduce it
to 200ms. Note that this change also affects IPv4 link-local addressing.
2025-04-26 14:44:52 +09:00
Beniamino Galvani c2691d8e7c networkd: make the ACD timeout configurable
RFC 5227 specifies randomized intervals to avoid that a large number of hosts
powered up at the same time send their message simultaneously. Performing the
conflict detection takes a variable time between 4 and 7 seconds from the
beginning to the first announcement, as shown by the following diagram where P
indicates a probe and A an announcement:

 time(s)     0   1   2   3   4   5   6   7   8   9
             +---+---+---+---+---+---+---+---+---+
 SHORTEST    P   P   P       A       A
 LONGEST         P       P       P       A       A

The host can't use the address until the first announcement is sent. 7 seconds
is a very long time on modern computers especially considering the fact that
the round-trip time on current LAN technologies is at most few milliseconds.
Section 2.2 of the RFC addresses this matter and hints that a future standard
will adjust those timeouts; however that standard doesn't exist yet.

Make the timeout configurable via a new IPv4DuplicateAddressDetectionTimeoutSec=
option. The intervals defined in the RFC are then scaled proportionally so that
the duration of the conflict detection takes at most the given value. Interval
happening after the first announcement are not scaled, as recommended by the
RFC.
2025-04-26 14:44:31 +09:00
Yu Watanabe 9d902ed4cc journal-file: fix meaning less assertion
Closes CID#1609495.
2025-04-26 09:37:18 +09:00
Yu Watanabe f96867edde format-table: add _TABLE_ERSATZ_INVALID to follow our usual coding style
Closes CID#1609497.
2025-04-26 09:32:23 +09:00
Yu Watanabe d6891af577 core/device: fix meaningless assertion
Closes CID#1609498.
2025-04-26 09:29:43 +09:00
joo es 52990feb2b po: Translated using Weblate (Arabic)
Currently translated at 28.0% (72 of 257 strings)

Co-authored-by: joo es <johndevand@tutanota.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ar/
Translation: systemd/main
2025-04-25 22:29:51 +09:00
Luca Boccassi 30c3e937e3 Update example to F42 and fix invocation with dnf5 (#37250) 2025-04-25 13:35:05 +01:00
Zbigniew Jędrzejewski-Szmek f6d524a0e6 man: update fedora release to F42
F42 was released a few weeks ago.
2025-04-25 14:00:59 +02:00
Zbigniew Jędrzejewski-Szmek 392a9bd0cf man/systemd-nspawn: call dnf with --use-host-config
This is needed for dnf5. But dnf-4 doesn't know about it. So also add a hint to
skip the option with dnf-4. We can drop this later when dnf5 is the default
everywhere.

Also, s/vim-minimal/nano/. Nano is the default editor in Fedora since
https://fedoraproject.org/wiki/Changes/UseNanoByDefault.
2025-04-25 14:00:59 +02:00
joo es cf0f741241 po: Added translation using Weblate (Arabic)
Co-authored-by: joo es <johndevand@tutanota.com>
2025-04-25 11:38:50 +01:00
Daan De Meyer c2ba4a2864 docs: Document manual cgroup controller management for Delegate=yes
This isn't immediately clear, so let's explicitly document this fact.

More context in https://github.com/systemd/systemd/issues/7355.
2025-04-25 00:42:24 +01:00
Werner Sembach d2502f55a2 hwdb/keyboard: Map FN key on TUXEDO InfinityFlex 14 Gen1
Map the FN key of TUXEDO InfinityFlex 14 Gen1 that wrongly produces the F23
scancode by default.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
2025-04-25 07:20:22 +09:00
Daan De Meyer d04f6fe446 selinux: Disable selinux logging in mac_init() as well
We currently only disable selinux logging in mac_selinux_setup(),
but not in mac_init(). We don't want libraries we use to log unless
we tell them to, so disable selinux's logging in mac_init() as well.
2025-04-25 06:17:28 +09:00
Michal Koutný 3a4aa7f5b2 update TODO 2025-04-25 06:14:42 +09:00
Luca Boccassi a3dc2bbf96 test: use /run/ for test configuration, not /etc/
In case of failures we don't want to leave an image with intermediate
test configuration, as images are reused across multiple tests

Follow-up for edca63a632
2025-04-25 06:13:43 +09:00
Daan De Meyer 45f63c3db7 test: Add custom signal handlers to integration test wrapper script
meson will send SIGTERM if the test gets stuck and hits the timeout,
in which case we still want to do log saving and analysis, so let's
add some signal handlers which allow us to do that.

This won't be very useful until https://github.com/mesonbuild/meson/pull/14513
lands, since we only get half a second from meson to handle SIGTERM
before it sends SIGKILL, but let's land this already so we immediately
start taking advantage of the meson fix once it lands.
2025-04-25 06:11:43 +09:00
Yu Watanabe 497b7a30a9 Several cleanups for reading IP address from DBus message (#37230) 2025-04-25 06:07:18 +09:00
Yu Watanabe 90e799de1f sd-json: fix conditions
Fixes a bug in 6647bbeab1 (v257).

Fixes CID#1609496.
2025-04-25 06:06:38 +09:00
Daan De Meyer dcedcb443c Various clang-tidy improvements (#37237) 2025-04-24 14:40:39 +02:00
Daan De Meyer d06abcf68e meson: Implement duplicate includes check with clang-tidy
Instead of doing this with our own script, let's use clang-tidy
instead.
2025-04-24 12:36:38 +02:00
Daan De Meyer 5008a92469 network: Remove duplicate include 2025-04-24 12:36:38 +02:00
Daan De Meyer 44e86153d1 meson: Define our own clang-tidy target
meson's target has a few issues:
- Runs on all source files regardless if they're included in the
  build or not
- Doesn't have any dependencies on generated sources which means we
  have to do a full build first before we can run clang-tidy
- Doesn't allow us to pass any extra arguments

To work around these, let's define our own clang-tidy target instead
using llvm's run-clang-tidy script. Alongside the clang-tidy target,
let's start keeping track of all generated sources which we make the
clang-tidy target depend on. We also add a new target which will only
generate source files which is useful for setting up the source tree
for running code analysis against it.
2025-04-24 12:36:36 +02:00
Yu Watanabe 10594762c7 Remove unused code and fix one bug (#37225) 2025-04-24 12:28:48 +09:00
Daan De Meyer bcf716ca01 tree-wide: Remove dead code
This code seems to not be used anywhere at all, so let's drop it.

Follow up for ba8d00e859
Follow up for 85686b37b0
Follow up for aff853f8ea
Follow up for 36dad381a2
2025-04-24 10:15:19 +09:00
Daan De Meyer 8621c646b8 core: Use parse_syscall_archs() in bus_exec_context_set_transient_property() 2025-04-24 10:15:19 +09:00
Daan De Meyer 058d680625 network: Fix wrong config parser for Bridge.MulticastIGMPVersion
Follow up for afa51e2dfb
2025-04-24 10:14:57 +09:00
Yu Watanabe 264749453c core/dbus-cgroup: use bus_message_read_in_addr_auto() at one more place 2025-04-24 10:11:07 +09:00
Daan De Meyer 176b887da4 bus-message-util: use bus_message_read_family() at one more place 2025-04-24 10:11:07 +09:00
Yu Watanabe 06a5d24d78 resolvectl: skip reading remaining elements when an invalid address is specified
Previous code assumed that both family and address are read when
-EINVAL, hence the following read of port and name could succeed.

Let's drop the assumption, and skip reading remaining elements.

No functional change, just refactoring and preparation for later change.
2025-04-24 10:11:07 +09:00
Yu Watanabe 90293a9583 resolvectl: make three booleans for read_dns_server_one() into one enum 2025-04-24 10:11:07 +09:00