]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agotests: log_tests_skipped() already appends ", skipping tests" 22014/head
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 11:02:11 +0000 (12:02 +0100)] 
tests: log_tests_skipped() already appends ", skipping tests"

We would say:
test-bpf-lsm: Can't use mlock(), skipping., skipping tests.

3 years agonetwork: move logging from route_set_netlink_message() to the callers
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 10:34:55 +0000 (11:34 +0100)] 
network: move logging from route_set_netlink_message() to the callers

Overall size change for the whole series:
$ size build/systemd-networkd{.0,}
   text    data     bss     dec     hex filename
1878634  394016      36 2272686  22adae build/systemd-networkd.0
1755066  394080      36 2149182  20cb3e build/systemd-networkd

i.e. 121 kb.

3 years agonetwork: move logging from routing_policy_rule_set_netlink_message() to the callers
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 10:20:12 +0000 (11:20 +0100)] 
network: move logging from routing_policy_rule_set_netlink_message() to the callers

3 years agonetwork: move logging from qdisc_configure()/tclass_configure() to the caller
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 10:16:22 +0000 (11:16 +0100)] 
network: move logging from qdisc_configure()/tclass_configure() to the caller

3 years agonetwork: simplify logging in request_process_bridge_fdb()
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 09:52:17 +0000 (10:52 +0100)] 
network: simplify logging in request_process_bridge_fdb()

3 years agonetwork: move logging from tc .fill_message to the callers
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 09:35:19 +0000 (10:35 +0100)] 
network: move logging from tc .fill_message to the callers

Structured initialization is used a bit more.

There were two kinds of log messages: about failed size calculations and
about failed appends to the message. I "downgraded" the first type to log_debug,
and moved the latter to the caller. This way there should be at most one high-priority
message.

I also changed sizeof(<type>) to sizeof(var) — there is less chance of select-and-paste
error in the second form.

3 years agonetwork: split out neighbor_configure_message(), simplify logging
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 21:29:50 +0000 (22:29 +0100)] 
network: split out neighbor_configure_message(), simplify logging

3 years agonetwork: split out dhcp4_pd_create_6rd_tunnel_message(), simplify logging
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 21:17:45 +0000 (22:17 +0100)] 
network: split out dhcp4_pd_create_6rd_tunnel_message(), simplify logging

3 years agonetwork: adjust log message about MACsec associations
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 21:06:44 +0000 (22:06 +0100)] 
network: adjust log message about MACsec associations

3 years agonetwork: simplify logging in macsec netdev code
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 21:05:42 +0000 (22:05 +0100)] 
network: simplify logging in macsec netdev code

3 years agonetwork: simplify logging in l2tp_create_session() and l2tp_create_tunnel()
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:56:42 +0000 (21:56 +0100)] 
network: simplify logging in l2tp_create_session() and l2tp_create_tunnel()

All the detailed logging is replaced by a simple "Failed to create netlink message",
which should be enough for the user in the unlikely case that this ever fails.

3 years agonetwork: split out link_configure_fill_message(), simplify logging
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:47:48 +0000 (21:47 +0100)] 
network: split out link_configure_fill_message(), simplify logging

3 years agonetwork: move logging from can_set_netlink_message() to the caller
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:43:39 +0000 (21:43 +0100)] 
network: move logging from can_set_netlink_message() to the caller

3 years agonetwork: de-duplicate logging in bridge_vlan_append_info() and the caller
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 10:05:02 +0000 (11:05 +0100)] 
network: de-duplicate logging in bridge_vlan_append_info() and the caller

The remaining message is changed, because the user would most likely not
understand that "append VLANs" is just talking about the netlink message.

3 years agonetwork: move logging from ipoib_set_netlink_message() to the caller
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:34:21 +0000 (21:34 +0100)] 
network: move logging from ipoib_set_netlink_message() to the caller

3 years agonetwork: split out netdev_fill_fou_tunnel_message(), simplify logging
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:28:23 +0000 (21:28 +0100)] 
network: split out netdev_fill_fou_tunnel_message(), simplify logging

3 years agonetwork: split out netdev_create_message(), simplify logging
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:20:54 +0000 (21:20 +0100)] 
network: split out netdev_create_message(), simplify logging

3 years agonetwork: replace more detailed netlink append messages
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 18:37:55 +0000 (19:37 +0100)] 
network: replace more detailed netlink append messages

Some refactoring was needed here to avoid duplicate messages.
Some select-and-paste errors were fixed on the way.

systemd-networkd is thinner by 8k.

3 years agonetwork: use SYNTHETIC_ERRNO in one more place
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 18:16:16 +0000 (19:16 +0100)] 
network: use SYNTHETIC_ERRNO in one more place

3 years agonetwork: replace detailed netlink append messages with a single generic message
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 18:16:01 +0000 (19:16 +0100)] 
network: replace detailed netlink append messages with a single generic message

This commit is the first in the series, and they generally follow the same
idea: we had very detailed logging for message append operations which would
only fail either with some type error or intrinsic limit (and then they would
fail everywhere, so this would be noticed during development or in CI), or they
would fail with ENOMEM, in which case the exact location is not very interesting
since this is not repeatable.

I am in general in favour of detailed logging messages, because it helps with
diagnosis of errors, but I think case is an exception. Despite not being very
useful, those messages required a lot of effort, because they were customized
for each and every append operation. In fact some of the messages contained copy
errors. The text of the messages (since they are generally unique) also added up
to a considerable size.

This removes the log messages after each sd_netlink_message_append_*() in
fill_message_create() with a single line in netdev_create(). As described
above, we are just appending fields to a message, so those calls would almost
never fail.

A forgotten 'return' was added in one place.

$ size build/systemd-networkd{.0,}
   text    data     bss     dec     hex filename
1878634  394016      36 2272686  22adae build/systemd-networkd.0
1842450  394080      36 2236566  222096 build/systemd-networkd

… so we save 30k too.

3 years agofuzz: no longer skip empty files
Evgeny Vereshchagin [Mon, 3 Jan 2022 12:31:07 +0000 (12:31 +0000)] 
fuzz: no longer skip empty files

Empty files and empty strings seem to have triggered various
issues in the past so it seems they shouldn't be ignore by the
fuzzers just because fmemopen can't handle them.

Prompted by https://github.com/systemd/systemd/pull/21939#issuecomment-1003113669

3 years agopo: Update translation files
Weblate [Tue, 4 Jan 2022 00:18:19 +0000 (01:18 +0100)] 
po: Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/
Translation: systemd/main

3 years agomeson: generate better arch defines for clang bpf compilation
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 17:38:23 +0000 (18:38 +0100)] 
meson: generate better arch defines for clang bpf compilation

The code assume that meson's cpu_family can be mapped directly to
'-D__<cpu_family>__'. This works in a surprising number of cases, but not for a
few architectures. PPC uses "powerpc", and RISC-V omits the trailing underscores.
ARM and RISC-V require a second define too.

Fixes #21900.

(I don't think this matters too much: we need *something* so that gnu/stubs.h
can be successfully included. But we don't actually call syscalls or depend too
much on the host environment, so things should be fine as long as we don't get
a compilation error.)

3 years agoMerge pull request #21990 from keszybz/indentation-and-comments
Luca Boccassi [Tue, 4 Jan 2022 00:18:10 +0000 (00:18 +0000)] 
Merge pull request #21990 from keszybz/indentation-and-comments

Indentation and comments

3 years agobasic/log: allow errno values higher than 255
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 16:53:29 +0000 (17:53 +0100)] 
basic/log: allow errno values higher than 255

When the support for "synthetic errno" was added, we started truncating
the errno value to just the least significant byte. This is generally OK,
because errno values are defined up to ~130.

The docs don't really say what the maximum value is. But at least in principle
higher values could be added in the future. So let's stop truncating
the values needlessly.

The kernel (or libbpf?) have an error where they return 524 as an errno
value (https://bugzilla.redhat.com/show_bug.cgi?id=2036145). We would
confusingly truncate this to 12 (ENOMEM). It seems much nicer to let
strerror() give us "Unknown error 524" rather than to print the bogus
message about ENOMEM.

3 years agocoredump: do not crash if we failed to acquire exe path
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 08:24:03 +0000 (09:24 +0100)] 
coredump: do not crash if we failed to acquire exe path

The COREDUMP_EXE attribute is "optional", i.e. we continue to process the
crash even if we didn't acquire it. The coredump generation code assumed
that it is always available:

 #5 endswith at ../src/fundamental/string-util-fundamental.c:41
 [ endswith() is called with NULL here, and an assertion fails. ]
 #6 submit_coredump at ../src/coredump/coredump.c:823
 #7 process_socket at ../src/coredump/coredump.c:1038
 #8 run at ../src/coredump/coredump.c:1413

We use the exe path for loop detection, and also (ultimately) pass it to
dwfl_core_file_report(). The latter seems to be fine will NULL, so let's just
change our code to look at COMM, which should be more reliable anyway.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2036517.

3 years agoMerge pull request #21985 from yuwata/elf-util-cleanups
Luca Boccassi [Mon, 3 Jan 2022 22:44:20 +0000 (22:44 +0000)] 
Merge pull request #21985 from yuwata/elf-util-cleanups

elf-util: several cleanups

3 years agopo: drop Project-Id-Version from header template 21990/head
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 20:19:06 +0000 (21:19 +0100)] 
po: drop Project-Id-Version from header template

Since they were pretty inconsistent anyway, let's assume that they
don't matter.

3 years agovarious: fix three spelling issues found by fossies
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 20:15:06 +0000 (21:15 +0100)] 
various: fix three spelling issues found by fossies

3 years agodocs: update branch names
Zbigniew Jędrzejewski-Szmek [Thu, 23 Dec 2021 20:25:31 +0000 (21:25 +0100)] 
docs: update branch names

Also use --atomic when pushing multiple items with git;
adjust some external URLs.

3 years agocoredump: drop unnecessary parentheses 21985/head
Yu Watanabe [Mon, 3 Jan 2022 19:11:26 +0000 (04:11 +0900)] 
coredump: drop unnecessary parentheses

3 years agoelf-util: add missing assertion
Yu Watanabe [Mon, 3 Jan 2022 17:02:12 +0000 (02:02 +0900)] 
elf-util: add missing assertion

3 years agoelf-util: reduce variable scope
Yu Watanabe [Mon, 3 Jan 2022 16:55:32 +0000 (01:55 +0900)] 
elf-util: reduce variable scope

3 years agoelf-util: executable argument for parse_elf() may be NULL
Yu Watanabe [Mon, 3 Jan 2022 16:55:03 +0000 (01:55 +0900)] 
elf-util: executable argument for parse_elf() may be NULL

Fixes assertion triggered by parse_package_metadata() and json_build().

3 years agoelf-util: reduce variable scope and indentation
Yu Watanabe [Mon, 3 Jan 2022 16:22:11 +0000 (01:22 +0900)] 
elf-util: reduce variable scope and indentation

3 years agoelf-util: reduce variable scope and indentation
Yu Watanabe [Mon, 3 Jan 2022 16:12:16 +0000 (01:12 +0900)] 
elf-util: reduce variable scope and indentation

3 years agoMerge pull request #21941 from yuwata/hostname-handle-empty
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 18:56:57 +0000 (19:56 +0100)] 
Merge pull request #21941 from yuwata/hostname-handle-empty

hostname-setup: support kernel with empty CONFIG_DEFAULT_HOSTNAME

3 years agoboot: Do not warn if an initializing driver returns EFI_ABORTED
Jan Janssen [Sun, 2 Jan 2022 13:37:32 +0000 (14:37 +0100)] 
boot: Do not warn if an initializing driver returns EFI_ABORTED

Fixes: #21965
3 years agobasic: adjust wording and wrapping of comments
Zbigniew Jędrzejewski-Szmek [Tue, 28 Dec 2021 14:47:08 +0000 (15:47 +0100)] 
basic: adjust wording and wrapping of comments

3 years agotest-bpf-lsm: drop some parens
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 13:33:35 +0000 (14:33 +0100)] 
test-bpf-lsm: drop some parens

3 years agotest-job-type: modernize code a bit
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 10:29:22 +0000 (11:29 +0100)] 
test-job-type: modernize code a bit

3 years agocore/bpf: tighten handling of return values, improve messages
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 10:14:18 +0000 (11:14 +0100)] 
core/bpf: tighten handling of return values, improve messages

The code was written unidiomatically, using r as a boolean value, and
confusing errno and r in some places. AFAICS, there wasn't any actual
problem: even in the one place where errno was used instead of r, it would
almost certainly be initialized.

It seems that some libbpf functions set errno, while others return the
error, possibly encoded. Since there are almost no docs, the only way to
know is to read the code of the function. To make matters worse, there is
a global libbpf_mode which can be set to change the convention. With
LIBBPF_STRICT_DIRECT_ERRS in libbpf_mode, some functions set errno while others
return a negative error, and the only way to know is to read the code, except
that the split is now different. We currently don't set
LIBBPF_STRICT_DIRECT_ERRS, but even the possibility makes everything harder
to grok.

This is all very error-prone. Let's at least add some asserts to make sure that
the returned values are as expected.

3 years agocore/bpf: avoid unnecessary initialization of variables, tighten scope
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 09:29:13 +0000 (10:29 +0100)] 
core/bpf: avoid unnecessary initialization of variables, tighten scope

No funtional change.

3 years agoMerge pull request #21970 from yuwata/seccomp-util-fix-build
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 15:44:10 +0000 (16:44 +0100)] 
Merge pull request #21970 from yuwata/seccomp-util-fix-build

seccomp-util: fix build failure

3 years agoci: bump mkosi to v12 with libsolv workaround
Frantisek Sumsal [Mon, 3 Jan 2022 12:07:21 +0000 (13:07 +0100)] 
ci: bump mkosi to v12 with libsolv workaround

Replaces: https://github.com/systemd/systemd/pull/21574
Related:
    * https://github.com/systemd/mkosi/issues/861
    * https://github.com/systemd/mkosi/pull/878

3 years agoMerge pull request #21960 from medhefgo/boot-gap
Evgeny Vereshchagin [Sun, 2 Jan 2022 23:35:15 +0000 (02:35 +0300)] 
Merge pull request #21960 from medhefgo/boot-gap

boot: Use objcopy to align sections

3 years agoseccomp-util: include missing_syscall_def.h to make __SNR_foo mapped to __NR_foo 21970/head
Yu Watanabe [Sun, 2 Jan 2022 18:47:27 +0000 (03:47 +0900)] 
seccomp-util: include missing_syscall_def.h to make __SNR_foo mapped to __NR_foo

Fixes #21969.

3 years agoMerge pull request #21944 from yuwata/nss-systemd-fix-pointer
Yu Watanabe [Sun, 2 Jan 2022 20:32:05 +0000 (05:32 +0900)] 
Merge pull request #21944 from yuwata/nss-systemd-fix-pointer

nss-systemd: fix pointer calculation

3 years agoci: Test efi binaries for section table gaps 21960/head
Jan Janssen [Sun, 2 Jan 2022 19:05:58 +0000 (20:05 +0100)] 
ci: Test efi binaries for section table gaps

3 years agoboot: Use objcopy to align sections
Jan Janssen [Sat, 1 Jan 2022 15:37:27 +0000 (16:37 +0100)] 
boot: Use objcopy to align sections

Not aligning these can create gaps in the section table. Some
firmware does not handle this nicely resulting in secure boot
signature fails.
Using objcopy ensures that any new sections in the future will be
properly aligned.

Fixes: #21956
3 years agomissing-syscall: add __NR_openat2
Yu Watanabe [Sun, 2 Jan 2022 18:44:50 +0000 (03:44 +0900)] 
missing-syscall: add __NR_openat2

3 years agosyscalls: update syscall definitions
Yu Watanabe [Sun, 2 Jan 2022 18:48:10 +0000 (03:48 +0900)] 
syscalls: update syscall definitions

3 years agoMerge pull request #21928 from medhefgo/boot-meson
Yu Watanabe [Sun, 2 Jan 2022 14:40:46 +0000 (23:40 +0900)] 
Merge pull request #21928 from medhefgo/boot-meson

meson: Boot

3 years agoboot: Add disabled secure boot mode without setup mode
Jan Janssen [Sat, 1 Jan 2022 15:21:42 +0000 (16:21 +0100)] 
boot: Add disabled secure boot mode without setup mode

3 years agomake HP 15s-eq0xxx changes specific to sku9MG38EA#ABZ
Marco Scardovi [Sat, 1 Jan 2022 14:20:45 +0000 (15:20 +0100)] 
make HP 15s-eq0xxx changes specific to sku9MG38EA#ABZ

Signed-Off-By: Marco Scardovi <marco@scardovi.com>
3 years agoMerge pull request #21915 from evverx/fuzz-bcd
Frantisek Sumsal [Sun, 2 Jan 2022 10:05:13 +0000 (10:05 +0000)] 
Merge pull request #21915 from evverx/fuzz-bcd

tests: add fuzz-bcd

3 years agomeson: Get objcopy location from compiler 21928/head
Jan Janssen [Wed, 29 Dec 2021 14:13:35 +0000 (15:13 +0100)] 
meson: Get objcopy location from compiler

3 years agomeson: Remove efi-cc option
Jan Janssen [Wed, 29 Dec 2021 14:02:04 +0000 (15:02 +0100)] 
meson: Remove efi-cc option

Changing the efi compiler this way doesn't really work. The gnu-efi
header checks as well as supported compiler flag checks use the
regular cc that meson detects. Changing the compiler this way will
end up with bad compiler flags. For the very same reason, this does
not work with a cross-compiler without going through proper meson
cross-compilation steps either.

The proper way to build systemd-boot with a different compiler is to
use a different build folder and then just use the proper ninja build
target to only build the bootloader/stub.

3 years agobuild(deps): bump meson from 0.60.2 to 0.60.3 in /.github/workflows
dependabot[bot] [Sat, 1 Jan 2022 09:05:41 +0000 (09:05 +0000)] 
build(deps): bump meson from 0.60.2 to 0.60.3 in /.github/workflows

Bumps [meson](https://github.com/mesonbuild/meson) from 0.60.2 to 0.60.3.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/0.60.2...0.60.3)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoudev: fix ID_NET_NAME_MAC= udev property
Yu Watanabe [Thu, 30 Dec 2021 21:05:21 +0000 (06:05 +0900)] 
udev: fix ID_NET_NAME_MAC= udev property

This fixes a bug introduced by eaba9bb3e69635d2c490c5e1b0d262b763753e1d.

The commit mistakenly drops 'x' in ID_NET_NAME_MAC, and adds colons.
The colons were dropped by the commit dfa4876c417e2a9935d58100d44d94bb41cd5bfb,
but the missing 'x' was not added at that time.

Follow-up for dfa4876c417e2a9935d58100d44d94bb41cd5bfb.

3 years agonss-myhostname: do not apply non-zero offset to null pointer 21944/head
Yu Watanabe [Fri, 31 Dec 2021 00:13:00 +0000 (09:13 +0900)] 
nss-myhostname: do not apply non-zero offset to null pointer

Fixes https://github.com/systemd/systemd/issues/21935#issuecomment-1003216503.

3 years agonss-systemd: fix alignment of gr_mem
Yu Watanabe [Thu, 30 Dec 2021 21:59:42 +0000 (06:59 +0900)] 
nss-systemd: fix alignment of gr_mem

Follow-up for 1e65eb8f9b7d567462030b2e625998d77677e636.

Fixes #21935.

3 years agomeson: fix detection of libcryptsetup functions
Zbigniew Jędrzejewski-Szmek [Thu, 30 Dec 2021 13:51:44 +0000 (14:51 +0100)] 
meson: fix detection of libcryptsetup functions

Meson would generate the following compile test:

  #define crypt_set_metadata_size meson_disable_define_of_crypt_set_metadata_size

  #include <limits.h>
  #undef crypt_set_metadata_size

  #ifdef __cplusplus
  extern "C"
  #endif
  char crypt_set_metadata_size (void);

  #if defined __stub_crypt_set_metadata_size || defined __stub___crypt_set_metadata_size
  fail fail fail this function is not going to work
  #endif

  int main(void) {
    return crypt_set_metadata_size ();
  }

This works fine when the identifier being queried is an actual function. But
crypt_token_max() is an inline function, so getting the address would fail,
leading to a false negative result. Complation would fail because the function
would be defined twice.

With this patch, the check is changed to include the header:

  #include <libcryptsetup.h>
  #include <limits.h>

  #if defined __stub_crypt_set_metadata_size || defined __stub___crypt_set_metadata_size
  fail fail fail this function is not going to work
  #endif

  int main(void) {
    void *a = (void*) &crypt_set_metadata_size;
    long long b = (long long) a;
    return (int) b;
  }

which seems to work correctly.

3 years agoMerge pull request #21940 from yuwata/network-wireguard-mask-allowed-ips
Luca Boccassi [Thu, 30 Dec 2021 21:18:05 +0000 (21:18 +0000)] 
Merge pull request #21940 from yuwata/network-wireguard-mask-allowed-ips

network: wireguard: handle invalid AllowedIPs= gracefully

3 years agohostname-util: drop GET_HOSTNAME_ALLOW_NONE flag and always refuse "(none)" 21941/head
Yu Watanabe [Thu, 30 Dec 2021 18:56:59 +0000 (03:56 +0900)] 
hostname-util: drop GET_HOSTNAME_ALLOW_NONE flag and always refuse "(none)"

The flag is now only used in test-sysctl-util.c, and it should be
replaced with uname(), because of the same reason as the previous
commit.

3 years agohostname-setup: gracefully handle kernel with empty CONFIG_DEFAULT_HOSTNAME
Yu Watanabe [Thu, 30 Dec 2021 18:48:17 +0000 (03:48 +0900)] 
hostname-setup: gracefully handle kernel with empty CONFIG_DEFAULT_HOSTNAME

Previously, sethostname_idempotent_full() calls gethostname_full() with
GET_HOSTNAME_ALLOW_NONE and GET_HOSTNAME_ALLOW_LOCALHOST flags. That
intended to get any values set by kernel. But, that does not work, as
the hostname may be empty.

Let's simplify the logic. The function sethostname_idempotent_full()
intends to set the requested hostname only when the current hostname
is different from the requested one. So, no check in getostname_full()
is required. Hence, simply use the result of uname() here.

Fixes #21896.

3 years agonss-systemd: fix required buffer size calculation
Yu Watanabe [Thu, 30 Dec 2021 15:31:51 +0000 (00:31 +0900)] 
nss-systemd: fix required buffer size calculation

This also fixes the pointer assigned to the gr_mem element of struct group.

Fixes a bug introduced by 47fd7fa6c650d7a0ac41bc89747e3b866ffb9534.

Fixes #21935.

3 years agosysusers: use filename if /proc is not mounted
Yu Watanabe [Thu, 30 Dec 2021 15:11:01 +0000 (00:11 +0900)] 
sysusers: use filename if /proc is not mounted

During system install, /proc may not be mounted yet.

Fixes RHBZ#2036217 (https://bugzilla.redhat.com/show_bug.cgi?id=2036217).

3 years agotest-network: add testcase for invalid AllowedIPs= 21940/head
Yu Watanabe [Thu, 30 Dec 2021 17:15:40 +0000 (02:15 +0900)] 
test-network: add testcase for invalid AllowedIPs=

3 years agonetwork: wireguard: warn about invalid allowed IP addresses
Yu Watanabe [Thu, 30 Dec 2021 17:08:56 +0000 (02:08 +0900)] 
network: wireguard: warn about invalid allowed IP addresses

But handle them gracefully. Otherwise, when the route to the address is
being configured, kernel refuse the route.

Note that kernel's wireguard module handle e.g. 192.168.10.3/24 as
192.168.10.0/24.

Fixes #21929.

3 years agonetwork: complete example for xfrm setup
Noel Kuntze [Thu, 30 Dec 2021 11:49:23 +0000 (12:49 +0100)] 
network: complete example for xfrm setup

3 years agosystemd-run: ensure error logs suggest to use '--user' when appropriate
Luca Boccassi [Thu, 30 Dec 2021 00:54:32 +0000 (00:54 +0000)] 
systemd-run: ensure error logs suggest to use '--user' when appropriate

Before:

$ systemd-run --service-type=notify --user false
Job for run-rc3fe52ee6ddd4a6eaaf1a20e0a949cdf.service failed because the control process exited with error code.
See "systemctl status run-rc3fe52ee6ddd4a6eaaf1a20e0a949cdf.service" and "journalctl -xeu run-rc3fe52ee6ddd4a6eaaf1a20e0a949cdf.service" for details.

After:

$ systemd-run --service-type=notify --user false
Job for run-r7791e380a7b6400ea01d6a0e5a458b23.service failed because the control process exited with error code.
See "systemctl --user status run-r7791e380a7b6400ea01d6a0e5a458b23.service" and "journalctl --user -xeu run-r7791e380a7b6400ea01d6a0e5a458b23.service" for details.

Fixes https://github.com/systemd/systemd/issues/21933

3 years agodbus-wait-for-jobs: add extra_args to bus_wait_for_jobs_one()
Luca Boccassi [Thu, 30 Dec 2021 00:53:29 +0000 (00:53 +0000)] 
dbus-wait-for-jobs: add extra_args to bus_wait_for_jobs_one()

And pass it through to bus_wait_for_jobs()

3 years agoMerge pull request #21922 from medhefgo/boot-fix
Luca Boccassi [Wed, 29 Dec 2021 19:35:42 +0000 (19:35 +0000)] 
Merge pull request #21922 from medhefgo/boot-fix

boot: More BCD parser fixes

3 years agotest: mark partition bootable
Ludwig Nussel [Mon, 27 Dec 2021 09:34:52 +0000 (10:34 +0100)] 
test: mark partition bootable

Make test suite partition bootable so nspawn can use the image directly.
Useful for local testing.

https://systemd.io/DISCOVERABLE_PARTITIONS/

3 years agoboot: Introduce helper macros for offset checking 21922/head
Jan Janssen [Wed, 29 Dec 2021 13:35:07 +0000 (14:35 +0100)] 
boot: Introduce helper macros for offset checking

This fixes a subtle sizeof overflow on 32bit machines.

3 years agoboot: Reject unaligned data
Jan Janssen [Tue, 28 Dec 2021 15:07:09 +0000 (16:07 +0100)] 
boot: Reject unaligned data

The data seems to be properly aligned in real BCD stores, so it
should be fine to just reject bad ones.

Fixes: #21917
3 years agoboot: Build BCD parser only on arches supported by Windows
Jan Janssen [Tue, 28 Dec 2021 12:10:39 +0000 (13:10 +0100)] 
boot: Build BCD parser only on arches supported by Windows

3 years agoMerge pull request #21898 from yuwata/meson-dbus-interfaces-dir
Luca Boccassi [Wed, 29 Dec 2021 12:39:50 +0000 (12:39 +0000)] 
Merge pull request #21898 from yuwata/meson-dbus-interfaces-dir

meson: obtain dbus related directories from pkg-config

3 years agomanager: always close idle pipe when sending ready notification
Yu Watanabe [Wed, 29 Dec 2021 03:04:46 +0000 (12:04 +0900)] 
manager: always close idle pipe when sending ready notification

This fixes a bug introduced by 6d9326595592f98e8126eacb4176acd8c3516d5c.

The commit makes several functions skipped if the manager is already
in finished state, as
> In manager_check_finished(), more steps are skipped if MANAGER_IS_FINISHED().
> Those steps are idempotent, but no need to waste cycles trying to do them
> more than once.

However, the idle pipe may be re-opened after manager is finished:
manager_dispatch_run_queue() -> manager_watch_idle_pipe().
So, the closing the pipe is not idempotent here.

Fixes #21889.

3 years agooss-fuzz: turn on the alignment check 21915/head
Evgeny Vereshchagin [Tue, 28 Dec 2021 17:10:18 +0000 (17:10 +0000)] 
oss-fuzz: turn on the alignment check

3 years agotests: add fuzz-bcd
Evgeny Vereshchagin [Sun, 26 Dec 2021 23:26:56 +0000 (23:26 +0000)] 
tests: add fuzz-bcd

3 years agostub: Do not assume having DeviceHandle
ksa678491784 [Tue, 28 Dec 2021 15:09:33 +0000 (18:09 +0300)] 
stub: Do not assume having DeviceHandle

3 years agonetwork: ndisc: ignore route prefix to ::/0
Yu Watanabe [Tue, 28 Dec 2021 13:42:03 +0000 (22:42 +0900)] 
network: ndisc: ignore route prefix to ::/0

Fixes #21912.

3 years agoMerge pull request #21925 from yuwata/unit-file-symlinked-drop-in-directory
Luca Boccassi [Tue, 28 Dec 2021 20:38:24 +0000 (20:38 +0000)] 
Merge pull request #21925 from yuwata/unit-file-symlinked-drop-in-directory

unit-file: fix symlinked drop-in directory handling

3 years agotest: add testcases of symlinked drop-in directories 21925/head
Yu Watanabe [Tue, 28 Dec 2021 15:49:11 +0000 (00:49 +0900)] 
test: add testcases of symlinked drop-in directories

3 years agounti-file: fix symlinked drop-in directory handling
Yu Watanabe [Tue, 28 Dec 2021 15:47:20 +0000 (00:47 +0900)] 
unti-file: fix symlinked drop-in directory handling

This fixes a bug introduced by 95ef0eaf0d5cd43fcc8e9eb541f2c342f25f8f2f.

Fixes #21920.

3 years agomeson: obtain dbus directories from pkg-config 21898/head
Yu Watanabe [Sun, 26 Dec 2021 07:19:17 +0000 (16:19 +0900)] 
meson: obtain dbus directories from pkg-config

3 years agomeson: show dbus interfaces directory in summary
Yu Watanabe [Sun, 26 Dec 2021 01:44:52 +0000 (10:44 +0900)] 
meson: show dbus interfaces directory in summary

3 years agomeson: move dbus-interfaces-dir
Yu Watanabe [Sun, 26 Dec 2021 01:30:28 +0000 (10:30 +0900)] 
meson: move dbus-interfaces-dir

3 years agocore: do not touch /run/systemd/systemd-units-load from user session instances
Luca Boccassi [Mon, 27 Dec 2021 18:22:43 +0000 (18:22 +0000)] 
core: do not touch /run/systemd/systemd-units-load from user session instances

Follow-up for: https://github.com/systemd/systemd/commit/15b9243c0d7f6d1531fa65dbc01bd11e8e6c12ca
Fixes: https://github.com/systemd/systemd/issues/21911
3 years agoMerge pull request #21916 from medhefgo/boot-fix
Luca Boccassi [Tue, 28 Dec 2021 11:48:19 +0000 (11:48 +0000)] 
Merge pull request #21916 from medhefgo/boot-fix

boot: Fixes

3 years agoboot: Fix name length comparison 21916/head
Jan Janssen [Mon, 27 Dec 2021 21:49:02 +0000 (22:49 +0100)] 
boot: Fix name length comparison

3 years agoboot: Fix off-by-one offset sanity checks
Jan Janssen [Mon, 27 Dec 2021 21:46:06 +0000 (22:46 +0100)] 
boot: Fix off-by-one offset sanity checks

3 years agoboot: Fix off-by-one NUL-termination
Jan Janssen [Mon, 27 Dec 2021 21:41:50 +0000 (22:41 +0100)] 
boot: Fix off-by-one NUL-termination

3 years agobuild(deps): bump github/super-linter from 4.8.4 to 4.8.5
dependabot[bot] [Mon, 27 Dec 2021 09:14:40 +0000 (09:14 +0000)] 
build(deps): bump github/super-linter from 4.8.4 to 4.8.5

Bumps [github/super-linter](https://github.com/github/super-linter) from 4.8.4 to 4.8.5.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/563be7dc5568017515b9e700329e9c6d3862f2b7...b8641364ca9a79b3cf07f3c4c59a82709cd39094)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agochrattr-util: return EOPNOTSUPP from chrattr_full if no other failure was observed
Luca Boccassi [Sun, 26 Dec 2021 16:45:13 +0000 (16:45 +0000)] 
chrattr-util: return EOPNOTSUPP from chrattr_full if no other failure was observed

When chattr_full tries to apply flags one-by-one, and one fails,
record which errno was returned. But record EOPNOTSUPP(&friends)
only if no other error is observed, and return it only in that case
(otherwise keep returning ENOANO), so that callers can respond
appropriately to EOPNOTSUPP vs more relevant errors.
For example, this lets tmpfiles.d log at debug level when a filesystem
flag cannot be applied because the filesystem does not support it,
but at warning level if something else went wrong when applying it.
Restores logging behaviour of tmpfiles.d to pre-250.

Follow-up for: https://github.com/systemd/systemd/commit/c1631ee124a30abfb9c71e2a1534b8afffc3b6a7

Fixes: https://github.com/systemd/systemd/issues/21901
3 years agoMerge pull request #21881 from yuwata/update-linux-headers
Luca Boccassi [Sun, 26 Dec 2021 17:30:47 +0000 (17:30 +0000)] 
Merge pull request #21881 from yuwata/update-linux-headers

Update linux headers

3 years agoMerge pull request #21892 from yuwata/network-vxlan-automatic-local-address-selection
Luca Boccassi [Sun, 26 Dec 2021 17:27:41 +0000 (17:27 +0000)] 
Merge pull request #21892 from yuwata/network-vxlan-automatic-local-address-selection

network: vxlan: automatic local address selection

3 years agoci: replace apt-key with signed-by
Evgeny Vereshchagin [Sun, 26 Dec 2021 01:11:00 +0000 (01:11 +0000)] 
ci: replace apt-key with signed-by

to limit the scope of the key to apt.llvm.org only.

This is mostly inspired by https://blog.cloudflare.com/dont-use-apt-key/