1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
Commit Graph

57960 Commits

Author SHA1 Message Date
Jan Janssen
d17c93a72b test: Test STRLEN for C11 string literals 2022-05-22 20:21:04 +01:00
Phaedrus Leeds
ec5e113f09 NEWS: Fix some minor mistakes 2022-05-22 20:33:56 +02:00
Daan De Meyer
08e86b15fc coredump: Fix format string type mismatch
Fixes #23471
2022-05-22 19:28:38 +02:00
Victor Westerhuis
87c7779599 Do not require a valid version when parsing sd-boot loader entries
This fixes #20820
2022-05-22 12:17:52 +02:00
Luca Boccassi
a17ebc687b
Merge pull request #23465 from mrc0mmand/bump-actions-to-ubuntu-2204
ci: bump GH Actions to Ubuntu Jammy where applicable
2022-05-22 02:29:59 +01:00
Benjamin Franzke
ae00bafdf8 docs: improve table readability
Let the table span more than the default content width,
if the table contains alot of data (controlled by width: auto)
(720px is very good for continuous text, but too narrow for tables).

The container class is therefore adapted to put the
width restriction on the elements itself, allowing for
exceptions for individual elements like <table> and
<h1> (which used an offset margin before and is now
streamlined to use a max-width as well).

Also add a striped background to ease reading rows
and allow for horizontal mobile scrolling without
overflowing the entire document, only the table itself.
2022-05-21 22:41:21 +01:00
Luca Boccassi
ebd4571e31
Merge pull request #22550 from medhefgo/boot-mixed
boot: EFI mixed mode support
2022-05-21 22:38:56 +01:00
Frantisek Sumsal
6c0259e502 ci: temporarily disable validation of GH Action files
since the current version of super-linter doesn't recognize
ubuntu-22.04 as a valid runner specification. This should
be fixed once https://github.com/github/super-linter/pull/2897
is merged, which includes
09a60b0f57
2022-05-21 23:28:18 +02:00
Frantisek Sumsal
dfe7cfe4fb cryptsetup: fix build with -Db_ndebug=true
```
 ...
 ../src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-fido2.c:33:13: error: variable 'r' set but not used [-Werror,-Wunused-but-set-variable]
         int r;
             ^
 1 error generated.
 ...
 ../src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-pkcs11.c:34:13: error: variable 'r' set but not used [-Werror,-Wunused-but-set-variable]
         int r;
             ^
 1 error generated.
 ninja: build stopped: subcommand failed.
 + fatal ''\''meson compile'\'' failed with -Db_ndebug=true'
```
2022-05-21 23:27:24 +02:00
Frantisek Sumsal
50b2b52004 ci: prefer the distro llvm version if available 2022-05-21 20:23:48 +02:00
Frantisek Sumsal
aa1bf7e61d ci: bump GH Actions to Ubuntu Jammy where applicable 2022-05-21 20:23:48 +02:00
Luca Boccassi
1f9aa3d2a6 resolved: default to OpenSSL
If both gnutls and openssl are available, prefer openssl.
We are gradually moving toward supporting openssl only as the
crypto library, and the resolved gnutls backend will be dropped
at some point, so start nudging users toward the openssl one.
2022-05-21 18:13:38 +02:00
Zbigniew Jędrzejewski-Szmek
6be96a9aed
Merge pull request #23460 from keszybz/docs-redirect
docs: rename COREDUMP_PACKAGE_METADATA → ELF_PACKAGE_METADATA
2022-05-21 18:11:18 +02:00
Benjamin Franzke
9ba7734f1e docs: adapt forward layout to systemd.io design 2022-05-21 18:09:50 +02:00
Zbigniew Jędrzejewski-Szmek
d4224b9cc7 docs: rename COREDUMP_PACKAGE_METADATA → ELF_PACKAGE_METADATA
The format described by this document is used not only for coredumps,
but also for other purposes, so we've outgrown the old title.

A redirect was added based on https://codepo8.github.io/github-redirection-demo/.
I tried to use a relative link, but it's hard to test if it works
before merging.

Co-authored-by: Benjamin Franzke <benjaminfranzke@googlemail.com>
2022-05-21 18:08:19 +02:00
Yu Watanabe
7d3f2499b8
Merge pull request #23464 from bnf/update-wiki-links
tree-wide: replace obsolete wiki links with systemd.io/manpages
2022-05-21 23:48:58 +09:00
Jan Janssen
6e9165397f bootctl: Add EFI arch detection support 2022-05-21 15:11:13 +01:00
Jan Janssen
c43a282c29 boot: Support booting in EFI mixed mode
The kernel provides a ".compat" PE section that contains a list of
compat entry points with their respective arches. This entry point
does all the heavy lifting to support running 64bit kernels when
the UEFI firmware is 32bit.

Note that the EFI handover protocol code in linux_x86.c does not
need any adjustments as it already correctly calls the 32bit handover
code.

Fixes: #17056
2022-05-21 15:11:13 +01:00
Jan Janssen
46ce6cf774 boot: Add LINUX_INITRD_MEDIA support to boot.c 2022-05-21 15:11:13 +01:00
Jan Janssen
acdf7d157b boot: Keep initrds separate from cmdline options
This is in preparation for LINUX_INITRD_MEDIA support in boot.c. One
downside is that adding or changing the used initrds by command line
editing is not possible anymore.
2022-05-21 15:11:13 +01:00
Jan Janssen
5c330b3682 boot: Edit config entry options inline
An edited entry command line should not be saved globally as it
should be tied to that one entry only.
2022-05-21 15:11:13 +01:00
Jan Janssen
7b19627697 fundamental: Move some helpers into string-util-fundamental 2022-05-21 15:11:13 +01:00
Jan Janssen
f386daa054 boot: Use cleanup handler to unload image
This also moves the message about failed image execution into
image_start() as we would otherwise show two error messages if
any of the preparatory steps failed.
2022-05-21 15:11:13 +01:00
Yu Watanabe
93a72170bd network: drop support for old kernels which cannot set prefix route with non-main route table
Not sure when the issue was fixed.
- kernel-3.10 on CentOS 7 has the issue,
- kernel-4.18 on CentOS 8 works fine.

Note, the workaround dropped by the commit is not incomplete:
with an old kernel which has the issue, all non-prefix routes are
configured on the specified route table, but the prefix route is
configured on the main table. That should not work for most cases,
hence, the workaround is mostly meaningless.
2022-05-21 15:09:53 +01:00
Luca Boccassi
0168b91603
Merge pull request #23339 from poettering/sockaddr-size-limit
tree-wide: add support for connecting to AF_UNIX sockets in the file system beyond the 108ch limit
2022-05-21 15:09:04 +01:00
Luca Boccassi
051c4e5419
Merge pull request #23342 from poettering/efi-monotonic-counter-random-seed
sd-boot: include GetNextMonotonicCount() in random seed calculations
2022-05-21 15:08:21 +01:00
Jan Janssen
7d4953de13 boot: Build with -flto=auto if available
Without this, we may get the following warning with gcc-12:
    lto-wrapper: warning: using serial compilation of 2 LTRANS jobs
2022-05-21 15:07:47 +01:00
Jan Janssen
351b30dae0 macro: Use C11 noreturn only
No need to provide a fallback as we compile with gnu11.
2022-05-21 15:01:47 +01:00
Yu Watanabe
1246d09705 networkctl: show error message provided through dbus
Prompted by #23416.
2022-05-21 15:01:09 +01:00
Luca Boccassi
6910d43af5
Merge pull request #23453 from keszybz/strv-parsing
Add strv methods with externally-supplied size argument and speed up parsing of /etc/hosts
2022-05-21 15:00:51 +01:00
Luca Boccassi
b622e95f2f
Merge pull request #23463 from bluca/hwdb
Finalize NEWS and hwdb for v251
2022-05-21 14:23:41 +01:00
Benjamin Franzke
a8c03388f8 tree-wide: Update homepage to systemd.io 2022-05-21 14:33:24 +02:00
Benjamin Franzke
92897d768d tree-wide: replace obsolete wiki links with systemd.io/manpages
All wiki pages that contain a deprecation banner
pointing to systemd.io or manpages are updated to
point to their replacements directly.

Helpful command for identification of available links:
git grep freedesktop.org/wiki | \
    sed "s#.*\(https://www.freedesktop.org/wiki[^ $<'\\\")]*\)\(.*\)#\\1#" | \
    sort | uniq
2022-05-21 14:29:14 +02:00
Benjamin Franzke
a25d9395ad tree-wide: streamline wiki links
* Avoid traling slash as most links are defined without.
* Always use https:// protocol and www. subdomain

Allows for easier tree-wide linkvalidation
for our migration to systemd.io.
2022-05-21 14:28:03 +02:00
Luca Boccassi
7f2ec323f6 NEWS: finalize 2022-05-21 12:55:07 +01:00
Luca Boccassi
5ea8bcd93d hwdb: update via ninja -C build update-hwdb 2022-05-21 12:44:36 +01:00
Luca Boccassi
410b996a72 NEWS: update contributors list 2022-05-21 12:43:19 +01:00
Yu Watanabe
30e29edf4c sysext: refuse empty release ID to avoid triggering assertion
Otherwise, the assertion in extension_release_validate() will be
triggered.
2022-05-21 06:37:56 +09:00
Yu Watanabe
1f97c2da0c test: add test for bus introspection of portable1
Follow-up for #23454.
2022-05-21 06:31:19 +09:00
Yu Watanabe
f65dcad5b7
Merge pull request #23439 from keszybz/kernel-install-verbose
Make kernel-install --verbose more verbose and some autodetection logic fixups
2022-05-21 04:26:03 +09:00
Yu Watanabe
3833c3356b
Merge pull request #23451 from medhefgo/boot-static-assert
boot: C11/static_assert
2022-05-21 04:22:17 +09:00
Luca Boccassi
54cd2d6869 sd-bus: add comment and test in sd_bus_path_decode() for empty string
3970	        e = object_path_startswith(path, prefix);
(gdb) p path
$1 = 0x55c5a166f768 "/org/freedesktop/portable1/image"
(gdb) p prefix
$2 = 0x55c59ffc2928 "/org/freedesktop/portable1/image"
(gdb) p e
$1 = 0x5581a1675788 ""

This can be a bit confusing in certain cases, so add a comment and a
test to make the behaviour clearer and explicit.
2022-05-21 03:44:09 +09:00
Yu Watanabe
cd532c633f
Merge pull request #23454 from keszybz/portable-introspect
Fix bus introspection of portable1
2022-05-21 03:41:22 +09:00
Zbigniew Jędrzejewski-Szmek
1b43f86893 kernel-install: restore priority of check for /boot/loader/entries
Before 9e82a74cb0, we had a check like the
following:

if [[ -d /efi/loader/entries ]] || [[ -d /efi/$MACHINE_ID ]]; then
    ENTRY_DIR_ABS="/efi/$MACHINE_ID/$KERNEL_VERSION"
elif [[ -d /boot/loader/entries ]] || [[ -d /boot/$MACHINE_ID ]]; then
    ENTRY_DIR_ABS="/boot/$MACHINE_ID/$KERNEL_VERSION"
elif [[ -d /boot/efi/loader/entries ]] || [[ -d /boot/efi/$MACHINE_ID ]]; then
    ENTRY_DIR_ABS="/boot/efi/$MACHINE_ID/$KERNEL_VERSION"
…

In stock Fedora 34-, /efi isn't used, but grub creates /boot/loader/entries and
installs kernels and initrds directly in /boot. Thus the second arm of the
check wins, and we end up with BOOT_ROOT=/boot.

After 9e82a74cb0, we iterate over the inner
directory first and over the second directory later:

[ -d /efi/<machine-id> ]
[ -d /boot/efi/<machine-id> ]
[ -d /boot/<machine-id> ]
[ -d /efi/Default ]
[ -d /boot/efi/Default ]
[ -d /boot/Default ]
[ -d /efi/loader/entries ]
[ -d /boot/efi/loader/entries ]
[ -d /boot/loader/entries ]

This was partially reverted by 447a822f8e which
removed Default from the list, and a5307e173b,
which moved checks for /boot up, so we ended up with:

[ -d /efi/<machine-id> ]
[ -d /boot/<machine-id> ]
[ -d /boot/efi/<machine-id> ]
[ -d /efi/loader/entries ]
[ -d /boot/loader/entries ]
[ -d /boot/efi/loader/entries ]

6637cf9db6 added autodetection of an entry
token, so we end up checking the following suffixes:

<machine-id>, $IMAGE_ID, $ID, Default

But the important unchanged characteristic is that we iterate over the suffix
first. Sadly this breaks Fedora, because we find /boot/efi/<machine-id> before
we could find /boot/loader/entries. It seems that every possible aspect of
behaviour matters for somebody, so we need to keep the original order of
detection.

With the patch:

[ -d /efi/<machine-id> ]
...
[ -d /efi/loader/entries ]
[ -d /boot/<machine-id> ]
...
[ -d /boot/loader/entries ]
[ -d /boot/efi/<machine-id> ]
...
[ -d /boot/efi/loader/entries ]

Note that we need to check for "loader/entries" too, even though it is not
an entry-token candidate, so that we get the same detection priority as
before.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2071034.
2022-05-20 15:34:17 +02:00
Zbigniew Jędrzejewski-Szmek
eb164c51ea resolved: use strv_extend_with_size() to avoid slow parsing of /etc/hosts
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43942 is a simple case
where a repeated entry generates a timeout. I didn't import that case, but
generated a simpler one by hand.

$ time build/fuzz-etc-hosts test/fuzz/fuzz-etc-hosts/timeout-many-entries
test/fuzz/fuzz-etc-hosts/timeout-many-entries... ok
build/fuzz-etc-hosts test/fuzz/fuzz-etc-hosts/timeout-many-entries  3.17s (old)
  ↓
build/fuzz-etc-hosts test/fuzz/fuzz-etc-hosts/timeout-many-entries  0.11s (new)

I considered simply disallowing too many aliases. E.g. microsoft appearently
sometimes ignores entries after the ninth [1], and other systems set stringent
limits [2,3], but the recommended way to get around that is to simply use more
lines (as is done in the sample), so this wouldn't change anything.

Even if we cannot put all those names in a reply packet, the resolution from
the alias to the address should work. I think cases where people define lots
and lots of aliases through some programmatic interface is realistic, for
example for a blocklist, and such a file shouldn't bring resolved down to its
knees.

[1] https://superuser.com/questions/932112/is-there-a-maximum-number-of-hostname-aliases-per-line-in-a-windows-hosts-file
[2] https://library.netapp.com/ecmdocs/ECMP1516135/html/GUID-C6F3B6D1-232D-44BB-A76C-3304C19607A3.html
[3] https://www.ibm.com/docs/en/zos/2.1.0?topic=optional-creating-etchosts
2022-05-20 15:18:28 +02:00
Zbigniew Jędrzejewski-Szmek
3ec3ae68d2 basic/strv: add optimizable version of strv_push/consume/extend
This will be helpful in cases where we are repeatedly adding entries
to a long strv and want to skip the iteration over old entries leading
to quadratic behaviour.

Note that we don't want to calculate the length if not necessary, so
the calculation is delayed until after we've checked that value is not
NULL.
2022-05-20 15:18:28 +02:00
Zbigniew Jędrzejewski-Szmek
5943d85f34 portabled: wrap long lines and fix typo in error message 2022-05-20 15:01:56 +02:00
Zbigniew Jędrzejewski-Szmek
4313e2b69f portabled: refuse queries for empty image name
I took inspiration from pid1:
bus_unit_find()
  → find_unit()
    → manager_load_unit_from_dbus_path()
      → unit_name_from_dbus_path()
        → !startswith(path, "/org/freedesktop/systemd1/unit/")
          → return -EINVAL
          ←
        ←
      ←
    ← if (r < 0) return 0
  ← 0
←

i.e. we return 0 when queried for "/org/freedesktop/systemd1/unit".

Fixes #23445.
2022-05-20 14:59:50 +02:00
Yu Watanabe
d316426eee shared/extension-release: drop unnecessary strna() wrapper
These are not NULL.
2022-05-20 14:26:47 +02:00
Luca Boccassi
7b2e763242 portable: reject root directories without an ID field in os-release
We always require at least ID to be set in os-release, reject
and propagate error to the caller instead of asserting later
2022-05-20 13:08:45 +01:00