Commit graph

65383 commits

Author SHA1 Message Date
Yu Watanabe f06390d504 mkosi: install HyperScale repository for CentOS 8
Preparation for bumping meson requirement higher than 0.56.2.
2023-06-16 10:43:06 +09:00
Yu Watanabe 0b01cac59a meson: drop non-existent test directories 2023-06-16 10:43:06 +09:00
Yu Watanabe d1b0d8415c meson: drop redundant spaces 2023-06-16 10:43:06 +09:00
Luca Boccassi 9a109e7cd6
Merge pull request #28053 from mrc0mmand/assorted-fixes
A bunch of typo fixes and code cleanups
2023-06-16 01:21:22 +01:00
наб f26c794308 find-esp: fix XBOOTLDR stx_dev_major=0 and not btrfs fix
The original commit is fully correct in its analysis, description, and
mechanics, but the patch changes an identical condition around line 500
(find_esp_and_warn()), instead of line 800 (find_xbootldr_and_warn()).

The internal patch I distributed to testers was correct (L800), and
neither the reviewers, nor me, caught that I wrote the wrong line for
upstream submission. I've re-checked that this patch applied to
systemd 252.11-1 fixes the issue.

Keep the -ENOTTY condition for find_esp_and_warn(), since the conditions
are clearly supposed to be the same and similar semantics apply.

Fixes: commit ed89819f8f ("find-esp: don't
 silently error bootctl install if presumed XBOOTLDR part is
 stx_dev_major=0 but not btrfs")
2023-06-16 01:20:52 +01:00
Luca Boccassi c94237468f core: fix post-fork memory leak
Doesn't matter really, but it is caught by ASAN when things fail
and there's no execve, so fix it.

https://jenkins-systemd.apps.ocp.cloud.ci.centos.org/job/upstream-vagrant-archlinux-sanitizers/3245/console
2023-06-15 23:25:00 +01:00
Frantisek Sumsal 8df6874927 udev: use timestamp_is_set() in one more place 2023-06-15 20:58:24 +02:00
Frantisek Sumsal 0347b9fdaa audit-util,varlink: use IOVEC_MAKE() in a couple more places 2023-06-15 20:58:24 +02:00
Frantisek Sumsal 9a27ef092e tree-wide: fix a couple of typos
As reported by Fossies.org.
2023-06-15 20:52:45 +02:00
Joyce 34c4496ef2
Update badge on README to refer new scorecard viewer (#28050)
* Update scorecard badge on README.md

Signed-off-by: Joyce <joycebrum@google.com>
2023-06-15 19:24:32 +01:00
Frantisek Sumsal 3bba91ef44 test: set $PATH to something predictable in the ASan wrapper
This is still necessary when running with clang's ASan, as it uses an
external binary to symbolize the stack traces.

Follow-up to ba79e8c2cc.
2023-06-15 14:53:32 +01:00
Lennart Poettering 6e89663d23 systemctl: let's emphasize a bit that halt/poweroff/reboot/shutdown are compat commands
Let's try to make clear that these calls really should not be extended
anymore, but remain as the compat glue they are but not more.

Anything new should really be added to systemctl poweroff/halt/reboot,
which is actually defined and owned by us.

This is added in light of a9c3cc8db0 which
really shouldn't have been added I am sure.

This adds two things: a note to the --help text that people use the
relevant systemctl commands instead (as they are a lot more powerful,
for example give you inhibitor and boot loader control, kexec, and so
on). And a note to developers that they stop adding new stuff to the
compat interfaces.
2023-06-15 14:06:37 +02:00
Lennart Poettering c4ffb53054 update TODO 2023-06-15 13:43:54 +02:00
Haochen Tong adeff82234 execute: fix the condition of private mounts for user namespacing
Follow-up for: 6ef721cbc7
2023-06-15 13:12:24 +02:00
Yu Watanabe a5ebaf7982 kernel-install: skip to read /etc/machine-info in test
We do not provide any way to override /etc/machine-info.
As the file is deprecated in kernel-install, let's skip to read it when
we test kernel-install.

Fixes #28011.
2023-06-15 18:53:29 +09:00
Henrik Holst cf4dbd84ac
network: make degraded-carrier bond/bridge as routable (#27776)
This makes a bond or bridge interface in the degraded-carrier state but has a routable address
handled as routable operational state.

If the carrier is degraded but the address state is routable then the operational state should be
seen as routable and not degraded because that may be the case for bonds if some of the links are down,
but when that happens the bond as whole is still routable.

This also makes operational state to degraded if address state is degraded even if the link state is
degraded-carrier.

Fixes #22713.
2023-06-15 13:32:10 +09:00
Luca Boccassi 4dad6101fd
Merge pull request #28038 from mrc0mmand/cleanups
A couple of cleanups
2023-06-14 23:18:04 +01:00
Joyce Brum 2b3211c836 Squashed commit of the following:
commit ef2fc83647f69c172c11e0dea318bf6ecf79a4aa
Author: Joyce <joycebrum@google.com>
Date:   Wed Jun 14 12:18:23 2023 -0300

    Update scorecards.yml

    Signed-off-by: Joyce <joycebrum@google.com>

commit c59c05c6ab156b20249e8056d8cbaafbe0c495f8
Merge: 7431a54568 f66d040d95
Author: Joyce <joycebrum@google.com>
Date:   Wed Jun 14 10:22:28 2023 -0300

    Merge branch 'main' into fix/disable-code-scanning-alerts

commit 7431a54568746a2fa4db1b23e1359984335df41e
Author: Joyce <joycebrum@google.com>
Date:   Tue Jun 13 18:15:21 2023 -0300

    Remove code scanning alerts scorecards.yml

    Signed-off-by: Joyce <joycebrum@google.com>

Signed-off-by: Joyce Brum <joycebrum@google.com>
2023-06-14 20:22:50 +01:00
Luca Boccassi 0302e38f7a
Merge pull request #28036 from medhefgo/meson
meson: Minor improvements
2023-06-14 20:12:35 +01:00
Frantisek Sumsal 7f4544c9bc activate: rename to socket-activate
To make the naming consistent with the rest of the utils, i.e. binary
name minus the systemd- prefix.
2023-06-14 20:39:10 +02:00
Frantisek Sumsal 9457dd8bae test: split TEST-04 into smaller chunks 2023-06-14 20:28:20 +02:00
Frantisek Sumsal 0ea6e6a526 test: exit on first failing subtest
Let's take a step back and revert back to the original behavior where we
exit on a first failing subtest. The current behavior makes fishing out the
failing test details quite unpleasant, and in certain situations the
journal may even be rotated away so we end up with no actionable logs.
2023-06-14 20:28:20 +02:00
Daan De Meyer 969eb0390f mkfs-util: Hide /proc/self/mounts before running mkfs
mkfs.btrfs refuses to operate on a block device with mounted
partitions, even if doing so is perfectly safe. An example when
this happens is when using systemd-repart with it's --image switch
to add a root partition to a /usr only image. As a workaround until
the issue is fixed, let's hide the information on mounted filesystems
from mkfs.btrfs so it doesn't fail and formats the new filesystem as
expected.
2023-06-14 19:53:49 +02:00
Lennart Poettering 43b49c0f14 resolvectl: fix double free issue
Follow-up for: #28012

Addresses these: https://github.com/systemd/systemd/pull/28012#issuecomment-1590889386
2023-06-14 18:31:32 +02:00
Lennart Poettering c4ccb80e39 bootctl: warn if the ESP random seed is stored on a world-readable dir
This takes heavy inspiration from @zx2c4 (Jason A. Donenfeld)'s
PR #25531 but changes it considerably, but always going by fd instead of
paths, and only warning about the side file itself and the ESP mount
point, nothing else. This shuld be more than enough and should not be
brittle against concurrent path modifications.

Replaces: #25531
2023-06-14 18:00:24 +02:00
Zbigniew Jędrzejewski-Szmek 2b8628c704
Merge pull request #27946 from keszybz/ukify-genkey-verb
Add 'genkey' verb to ukify
2023-06-14 17:57:24 +02:00
Frantisek Sumsal 9352db7abb coverage: fix build with g++
Guard the coverage-related shenanigans from g++ when building the one
C++ unit test we have, so we don't have to make it C++ compatible:

[1573/2109] Compiling C++ object test-bus-vtable-cc.p/src_libsystemd_sd-bus_test-bus-vtable-cc.cc.o
FAILED: test-bus-vtable-cc.p/src_libsystemd_sd-bus_test-bus-vtable-cc.cc.o
ccache c++ -Itest-bus-vtable-cc. ... -c ../src/libsystemd/sd-bus/test-bus-vtable-cc.cc
In file included from <command-line>:
../src/basic/coverage.h:17:15: error: ‘_Noreturn’ does not name a type
   17 | static inline _Noreturn void _coverage__exit(int status) {
      |               ^~~~~~~~~
../src/basic/coverage.h:46:29: error: conflicting declaration of ‘int _coverage_execveat(int, const char*, char* const*, char* const*, int)’ with ‘C’ linkage
   46 | #define execveat(d,p,a,e,f) _coverage_execveat(d, p, a, e, f)
      |                             ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:34:19: note: previous declaration with ‘C++’ linkage
   34 | static inline int _coverage_execveat(
      |                   ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:46:29: error: declaration of ‘int _coverage_execveat(int, const char*, char* const*, char* const*, int) noexcept’ has a different exception specifier
   46 | #define execveat(d,p,a,e,f) _coverage_execveat(d, p, a, e, f)
      |                             ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:34:19: note: from previous declaration ‘int _coverage_execveat(int, const char*, char* const*, char* const*, int)’
   34 | static inline int _coverage_execveat(
      |                   ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:58:24: error: conflicting declaration of ‘int _coverage_execvpe(const char*, char* const*, char* const*)’ with ‘C’ linkage
   58 | #define execvpe(f,a,e) _coverage_execvpe(f, a, e)
      |                        ^~~~~~~~~~~~~~~~~
../src/basic/coverage.h:48:19: note: previous declaration with ‘C++’ linkage
   48 | static inline int _coverage_execvpe(
      |                   ^~~~~~~~~~~~~~~~~
../src/basic/coverage.h:58:24: error: declaration of ‘int _coverage_execvpe(const char*, char* const*, char* const*) noexcept’ has a different exception specifier
   58 | #define execvpe(f,a,e) _coverage_execvpe(f, a, e)
      |                        ^~~~~~~~~~~~~~~~~
../src/basic/coverage.h:48:19: note: from previous declaration ‘int _coverage_execvpe(const char*, char* const*, char* const*)’
   48 | static inline int _coverage_execvpe(
      |                   ^~~~~~~~~~~~~~~~~
[1582/2109] Compiling C object test-event.p/src_libsystemd_sd-event_test-event.c.o
ninja: build stopped: subcommand failed.
2023-06-14 16:44:57 +02:00
Jan Janssen 816df466a7 meson: Use build_tgt.name() 2023-06-14 16:10:55 +02:00
Jan Janssen 739a62bb40 meson: Use fs module in more places 2023-06-14 16:05:52 +02:00
Christoph Anton Mitterer 14941724ec sleep-config: add comment about security
Adds information about attacks that might become possible when the hibernate
location is automatically determined.
2023-06-14 15:27:41 +02:00
Lennart Poettering f66d040d95
Merge pull request #28032 from poettering/mumumµ
deal with µ unicode ambiguities
2023-06-14 14:00:10 +02:00
Zbigniew Jędrzejewski-Szmek 814e4d7a67 ukify: make the certficate validity configurable
Requested in 4cc743319a (r1228592001)
2023-06-14 13:18:00 +02:00
Zbigniew Jędrzejewski-Szmek a3f758b310 man/ukify: add structure to describe verbs, document genkey
This just adds two paragraphs of text, but moves a lot of the text
one level down into a subsection.
2023-06-14 13:18:00 +02:00
Zbigniew Jędrzejewski-Szmek 13a29b0efb test_ukify: skip test requiring cryptography
I'll add the dep in Fedora spec so it does get tested at least
in some cases.
2023-06-14 13:18:00 +02:00
Zbigniew Jędrzejewski-Szmek 27140fc7d1 man: add example how to configure automatic signing
Fixes #978.
2023-06-14 13:18:00 +02:00
Zbigniew Jędrzejewski-Szmek ff7580e280 test_ukify: cleanups suggested by pylint 2023-06-14 13:18:00 +02:00
Zbigniew Jędrzejewski-Szmek a1c80efddc ukify: add 'genkey' verb
The idea is to make it easy to generate all the signing key and certs
that can be used for local signing. The verb is the modeled after
'mkosi genkey', but there are some important differences: we generate
the keys to the paths where they will be read from, both pcr signing
keys and the SecureBoot certificate+key.

If any of the outputs exist, operation is refused. Maybe we could add a
--force option in the future, but this operation should be rare, so I think
it's better to refuse to overwrite anything initially.

I'm only doing a token man page change here.
https://github.com/systemd/systemd/pull/27621 reworks the man page,
and the changes done here would conflict heavily with that work. I'll
submit a follow-up patch later.
2023-06-14 13:17:33 +02:00
Lennart Poettering 2d0855154f bootctl: fix docs/--help to say that "bootctl random-seed" not just initializes but also refreshes ESP random seeds 2023-06-14 11:58:37 +01:00
Lennart Poettering d754cdc994
Merge pull request #28012 from poettering/resolvectl-dump-cache
add "resolvectl show-cache" call and IPC backend for that
2023-06-14 10:33:13 +02:00
Lennart Poettering e503019bc7 tree-wide: when in doubt use greek small letter mu rather than micro symbol
Doesn't really matter since the two unicode symbols are supposedly
equivalent, but let's better follow the unicode recommendations to
prefer greek small letter mu, as per:

https://www.unicode.org/reports/tr25
2023-06-14 10:23:56 +02:00
Lennart Poettering d0a6d7c4d1 time-util,socket: accept both kinds of unicode µ symbols
Apparently there are two µ symbols, accept both when parsing.

One is the greek small letter mu (μ) the other is the micro sign (µ).
Unicode recommendation considers both equivalent, and says use of greek
small letter mu is preferred. See:

https://www.unicode.org/reports/tr25

Hence accept both when parsing.

Inspired by: #28029
2023-06-14 10:15:41 +02:00
Lennart Poettering 5bc4570fd4
Merge pull request #26728 from keszybz/meson-update
Meson version update
2023-06-13 23:38:41 +02:00
Joyce 3f2ff79763
Fix scorecard version comment format (#28027)
* Update scorecards.yml version comments

Signed-off-by: Joyce <joycebrum@google.com>
2023-06-13 22:36:32 +01:00
Lennart Poettering 18cad4ebda
Merge pull request #27846 from keszybz/link-mode-generation
Autogenerate list of link modes
2023-06-13 23:03:51 +02:00
김인수 09c24f81ff po: Translated using Weblate (Korean)
Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: 김인수 <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
2023-06-13 22:53:09 +02:00
Yu Watanabe 331aa7aa15 udev-node: optimize device node symlink creation
If multiple devices requested the same device node symlink with the same
priority, then previously we read O(N^2) of files saved in
/run/udev/links.

This makes if the requested symlink already exists with equal or higher
priority, then the symlink is kept, and skip to read all existing files,
except for one related to the current device node, in /run/udev/links.
Hence, the total amount of file read becomes O(N).

This improves performance of testcase_simultaneous_events_2 added by the
previous commit about 30%.
Before (32.8 sec):
```
 ## 3 iterations start: 11:13:44.690953163
 ## 3 iterations end: 11:14:17.493974927
```
After (23.8 sec):
```
 ## 3 iterations start: 11:17:53.869938387
 ## 3 iterations end: 11:18:17.624268345
```

This is based on the idea and analysis by Franck Bui.

Replaces #25839.

Co-authored-by: Franck Bui <fbui@suse.com>
2023-06-13 22:51:00 +02:00
Daniele Medri 0b75d6579b it.po: minor updates 2023-06-13 21:18:16 +01:00
Lennart Poettering c27e8cd272
Merge pull request #28020 from DaanDeMeyer/followups
Followups
2023-06-13 22:14:33 +02:00
Luca Boccassi 59936b66d1
Merge pull request #27952 from mrc0mmand/drop-TEST-61
test: merge TEST-61-UNITTESTS-QEMU with TEST-02-UNITTESTS
2023-06-13 21:13:14 +01:00
Daan De Meyer 22afd5cb2c
Merge pull request #27977 from DaanDeMeyer/update-mkosi
Update mkosi
2023-06-13 16:56:54 +02:00