]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agojournalctl: Use STATIC_DESTRUCTOR_REGISTER() 23645/head
Daan De Meyer [Mon, 6 Jun 2022 14:04:53 +0000 (16:04 +0200)] 
journalctl: Use STATIC_DESTRUCTOR_REGISTER()

3 years agoshared: Rename pcre2-dlopen.h/c to pcre2-util.h/c
Daan De Meyer [Mon, 6 Jun 2022 14:01:20 +0000 (16:01 +0200)] 
shared: Rename pcre2-dlopen.h/c to pcre2-util.h/c

We already store the dlopen() stuff for other libraries in util headers
as well so let's do the same for pcre2. We also move the definition of
some trivial cleanup functions from journalctl.c to pcre2-util.h

3 years agomeson: Switch default-locale default to C.UTF-8
Daan De Meyer [Fri, 3 Jun 2022 11:29:47 +0000 (13:29 +0200)] 
meson: Switch default-locale default to C.UTF-8

We're already using C.UTF-8 as the default locale for nspawn. Let's
make the same change for the default-locale option instead of deciding
what to use based on the locale used by the host system. Users can
still override the locale using the default-locale option if needed.

3 years agocore: suppress message about missing libbpf if in initrd()
Zbigniew Jędrzejewski-Szmek [Fri, 3 Jun 2022 14:45:47 +0000 (16:45 +0200)] 
core: suppress message about missing libbpf if in initrd()

It is quite likely that libbpf is not present in the initrd, and
there isn't much reason to use the bpf filters there.

https://bugzilla.redhat.com/show_bug.cgi?id=2084955#c25

3 years agocryptenroll: fix typo
Antonio Alvarez Feijoo [Fri, 3 Jun 2022 15:09:23 +0000 (17:09 +0200)] 
cryptenroll: fix typo

3 years agoMerge pull request #23297 from medhefgo/trivial-auto-var-init
Zbigniew Jędrzejewski-Szmek [Fri, 3 Jun 2022 13:27:51 +0000 (15:27 +0200)] 
Merge pull request #23297 from medhefgo/trivial-auto-var-init

meson: Compile with -ftrivial-auto-var-init

3 years agotest: add dlopen test for pam_systemd_home
Yu Watanabe [Thu, 2 Jun 2022 21:40:43 +0000 (06:40 +0900)] 
test: add dlopen test for pam_systemd_home

3 years agosha256: fix compilation on efi-ia32
Zbigniew Jędrzejewski-Szmek [Fri, 3 Jun 2022 07:32:02 +0000 (09:32 +0200)] 
sha256: fix compilation on efi-ia32

/usr/bin/gcc -c ../src/fundamental/sha256.c -o src/boot/efi/sha256.c.o -Wno-format-signedness -Wno-missing-field-initializers -Wno-unused-parameter -Wdate-time -Wendif-labels -Werror=format=2 -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wno-unused-result -fno-stack-protector -fno-strict-aliasing -fpic -fwide-exec-charset=UCS2 -Wall -Wextra -Wsign-compare -nostdlib -std=gnu99 -ffreestanding -fshort-wchar -fvisibility=hidden -isystem /usr/include/efi -isystem /usr/include/efi/ia32 -I /builddir/build/BUILD/systemd-stable-250.7/src/fundamental -DSD_BOOT -DGNU_EFI_USE_MS_ABI -include src/boot/efi/efi_config.h -include version.h -mno-sse -mno-mmx -flto -O2 -flto=auto
../src/fundamental/sha256.c: In function ‘sha256_finish_ctx’:
../src/fundamental/sha256.c:61:25: error: ‘false’ undeclared (first use in this function)
   61 | # define UNALIGNED_P(p) false
      |                         ^~~~~
../src/fundamental/sha256.c:136:21: note: in expansion of macro ‘UNALIGNED_P’
  136 |                 if (UNALIGNED_P(resbuf))
      |                     ^~~~~~~~~~~
../src/fundamental/sha256.c:32:1: note: ‘false’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’?
   31 | #include "sha256.h"
  +++ |+#include <stdbool.h>
   32 |
...

3 years agoMerge pull request #23583 from yuwata/boot-efi-string-follow-ups
Yu Watanabe [Fri, 3 Jun 2022 01:23:24 +0000 (10:23 +0900)] 
Merge pull request #23583 from yuwata/boot-efi-string-follow-ups

boot: follow-ups for efi-string functions

3 years agoshared/utmp-wtmp: fix build without utmp
Christian Hesse [Thu, 2 Jun 2022 18:49:46 +0000 (20:49 +0200)] 
shared/utmp-wtmp: fix build without utmp

Commit 16618332388442f2f1c3e52b0a9fde00121564a3 changed a function to
add an extra argument. The data types used when building without utmp
missed the change.

3 years agologin: fix typo
Yu Watanabe [Thu, 2 Jun 2022 19:27:40 +0000 (04:27 +0900)] 
login: fix typo

Follow-up for ea74f39c24344eafc238d1c69155bd5aca5f2e08.

3 years agoboot: use CMP() macro for safety 23583/head
Yu Watanabe [Tue, 31 May 2022 21:36:55 +0000 (06:36 +0900)] 
boot: use CMP() macro for safety

3 years agoboot: make several functions inline
Yu Watanabe [Tue, 31 May 2022 21:25:52 +0000 (06:25 +0900)] 
boot: make several functions inline

Follow-ups for #23512.

3 years agoboot: fix typo
Yu Watanabe [Tue, 31 May 2022 21:48:45 +0000 (06:48 +0900)] 
boot: fix typo

3 years agoMerge pull request #23596 from keszybz/bpf-messages-more
Zbigniew Jędrzejewski-Szmek [Thu, 2 Jun 2022 17:48:01 +0000 (19:48 +0200)] 
Merge pull request #23596 from keszybz/bpf-messages-more

Silence messages from libbpf

3 years agotest: enable virtio-rng device for QEMU guests
Franck Bui [Thu, 2 Jun 2022 07:31:55 +0000 (09:31 +0200)] 
test: enable virtio-rng device for QEMU guests

If rngd is included in the host initrd, QEMU guests need at least one source of
entropy otherwise rngd will refuse to start. Hence this patch enables the
virtio RNG device in QEMU guests (exposed as a HW RNG device available at
/dev/hwrng).

As a safety measure, the patch limits the data sent to the guest to 1KB per
second in order to not let the guest starve the host entropy.

3 years agocore: rework variable initialization to avoid gcc warning 23297/head
Zbigniew Jędrzejewski-Szmek [Thu, 2 Jun 2022 15:30:35 +0000 (17:30 +0200)] 
core: rework variable initialization to avoid gcc warning

In file included from ../src/basic/siphash24.h:11,
                 from ../src/basic/hash-funcs.h:6,
                 from ../src/basic/hashmap.h:8,
                 from ../src/shared/fdset.h:6,
                 from ../src/shared/bpf-program.h:9,
                 from ../src/core/unit.h:11,
                 from ../src/core/all-units.h:4,
                 from ../src/core/manager.c:23:
../src/basic/time-util.h: In function 'manager_dispatch_jobs_in_progress':
../src/basic/time-util.h:140:38: error: 'x' may be used uninitialized [-Werror=maybe-uninitialized]
  140 | #define FORMAT_TIMESPAN(t, accuracy) format_timespan((char[FORMAT_TIMESPAN_MAX]){}, FORMAT_TIMESPAN_MAX, t, accuracy)
      |                                      ^~~~~~~~~~~~~~~
In function 'manager_print_jobs_in_progress',
    inlined from 'manager_dispatch_jobs_in_progress' at ../src/core/manager.c:3007:9:
../src/core/manager.c:219:18: note: 'x' was declared here
  219 |         uint64_t x;
      |                  ^
cc1: all warnings being treated as errors

For some reason this (false positive) warning starts appearing after
-ftrivial-auto-var-init is used.

3 years agoMerge pull request #23576 from yuwata/network-erspan-version
Zbigniew Jędrzejewski-Szmek [Thu, 2 Jun 2022 14:58:55 +0000 (16:58 +0200)] 
Merge pull request #23576 from yuwata/network-erspan-version

network: support erspan version 0 and 2

3 years agoMerge pull request #23579 from yuwata/sha256-unaligned
Zbigniew Jędrzejewski-Szmek [Thu, 2 Jun 2022 14:38:19 +0000 (16:38 +0200)] 
Merge pull request #23579 from yuwata/sha256-unaligned

sha256: use memcpy() to accept unaligned result buffer

3 years agoman: add missing arguments to systemd-creds synopsis
Antonio Alvarez Feijoo [Thu, 2 Jun 2022 13:58:33 +0000 (15:58 +0200)] 
man: add missing arguments to systemd-creds synopsis

3 years agoMerge pull request #23582 from bnf/dns-proxy-stub-ifindex
Zbigniew Jędrzejewski-Szmek [Thu, 2 Jun 2022 14:34:55 +0000 (16:34 +0200)] 
Merge pull request #23582 from bnf/dns-proxy-stub-ifindex

resolved: define source address for proxy-only stub replies

3 years agocore/bpf: prefix log messages from different bpf subsystems 23596/head
Zbigniew Jędrzejewski-Szmek [Thu, 2 Jun 2022 09:15:35 +0000 (11:15 +0200)] 
core/bpf: prefix log messages from different bpf subsystems

When something goes awry, we would get identical log messages from all the
bpf subsystems. E.g. "Failed to load BPF object: %m" appeared 5 times in the
sources. But it is very important to know *which* object we failed to load.
This could be guessed, e.g. from surroudning messages or from filename/line
metadata, but when we get log messages in bug reports, this might not be
available. Let's make the messages distinguishable.

While at it, some messages were adjusted a bit. In particular, we shouldn't use
internal names like BPFProgram which have no meaning outside of the codebase.

3 years agocore: define a helper function for basic bpf checks
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jun 2022 21:56:25 +0000 (23:56 +0200)] 
core: define a helper function for basic bpf checks

3 years agotest-socket-bind: fix comment
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jun 2022 22:40:33 +0000 (00:40 +0200)] 
test-socket-bind: fix comment

3 years agotests: drop pointless checks for root
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jun 2022 22:38:14 +0000 (00:38 +0200)] 
tests: drop pointless checks for root

Testing the error paths is very important. If we are not root, we should
try and get a failure, which we should report nicely and mark the test
as skipped. After those checks are removed, this is what seems to happen.
This way we can see what will happen e.g. in the user manager when we try
to perform some bpf ops.

3 years agoshared/bpf: install log callback and suppress most messages from libbpf
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jun 2022 22:27:52 +0000 (00:27 +0200)] 
shared/bpf: install log callback and suppress most messages from libbpf

$ build/test-socket-bind
...
libbpf: load bpf program failed: Operation not permitted
libbpf: failed to load program 'sd_bind4'
libbpf: failed to load object 'socket_bind_bpf'
libbpf: failed to load BPF skeleton 'socket_bind_bpf': -1
Failed to load BPF object: Operation not permitted

Now all lines with "libbpf:" are at debug level and will be hidden by
default.

Partially fixes https://bugzilla.redhat.com/show_bug.cgi?id=2084955#c14
(i.e. the error that was exposed when the initial error was fixed.)

3 years agomeson: use files() for libcore_sources too
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jun 2022 21:58:28 +0000 (23:58 +0200)] 
meson: use files() for libcore_sources too

C.f. f1b98127ff6320648cc3dc876f3b6a5aa3af204b.

3 years agouserwork: use a better errno value
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jun 2022 15:49:58 +0000 (17:49 +0200)] 
userwork: use a better errno value

ESRCH is literally "No such process".

3 years agovarious: add %m in messages
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jun 2022 15:49:27 +0000 (17:49 +0200)] 
various: add %m in messages

Sometimes we want to suppress strerror() message because the are providing
something better. But in those cases, it seems it was just forgotten.

3 years agotest: fix indentation 23579/head
Yu Watanabe [Thu, 2 Jun 2022 05:14:12 +0000 (14:14 +0900)] 
test: fix indentation

3 years agotest: add test for sha256
Yu Watanabe [Thu, 2 Jun 2022 05:12:20 +0000 (14:12 +0900)] 
test: add test for sha256

3 years agosha256: use memcpy() when result buffer is unaligned
Yu Watanabe [Tue, 31 May 2022 17:31:10 +0000 (02:31 +0900)] 
sha256: use memcpy() when result buffer is unaligned

Fixes #23578.

3 years agoDocuments the AssertCPUFeature= flag (#23594)
Steve Ramage [Thu, 2 Jun 2022 04:16:48 +0000 (21:16 -0700)] 
Documents the AssertCPUFeature= flag (#23594)

Fixes #23593

3 years agoMove basic/recovery-key.* to shared/
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 09:34:05 +0000 (11:34 +0200)] 
Move basic/recovery-key.* to shared/

No particular reason to have it in basic/. We should let homectl
and other users share the single copy through libsystemd-shared.

3 years agoMerge pull request #23575 from keszybz/logind-wall-message-cleanup
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jun 2022 14:26:29 +0000 (16:26 +0200)] 
Merge pull request #23575 from keszybz/logind-wall-message-cleanup

Cleanup wall messages emitted by logind and systemctl

3 years agoMerge pull request #23574 from keszybz/logind-pty-wall
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jun 2022 14:26:03 +0000 (16:26 +0200)] 
Merge pull request #23574 from keszybz/logind-pty-wall

Do not print logind wall message to local terminals

3 years agoresolved: choose correct file descriptor for proxy stub replies 23582/head
Benjamin Franzke [Wed, 1 Jun 2022 12:40:51 +0000 (14:40 +0200)] 
resolved: choose correct file descriptor for proxy stub replies

find_socket_fd() does not expect the sender address, but the
listen-address. This is in fact the destination of the DNS packet.
Matching via sender address caused a fallback to the default stub
listener in manager_dns_stub_fd() as the sender address can never
match the proxy stub listen address.

Note that manager_dns_stub_fd() is only used for the default
listener stub and the proxy stub, that means *extra* listeners
stubs (DNSStubListenerExtra=…) have not been affected as
`struct DnsStubListenerExtra` provides a direct link to the event
source.

By using the correct fd we ensure the correct socket options
(like TTL) are used and prevent issues like #23495 in case ifindex
could not be determined.

3 years agobuild(deps): bump actions/upload-artifact from 2.3.1 to 3.1.0
dependabot[bot] [Wed, 1 Jun 2022 10:27:03 +0000 (10:27 +0000)] 
build(deps): bump actions/upload-artifact from 2.3.1 to 3.1.0

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.3.1 to 3.1.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/82c141cc518b40d92cc801eee768e7aafc9c2fa2...3cea5372237819ed00197afe530f5a7ea3e805c8)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump github/super-linter from 4.9.3 to 4.9.4
dependabot[bot] [Wed, 1 Jun 2022 10:26:55 +0000 (10:26 +0000)] 
build(deps): bump github/super-linter from 4.9.3 to 4.9.4

Bumps [github/super-linter](https://github.com/github/super-linter) from 4.9.3 to 4.9.4.
- [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/431ee7836e8cdce5a460b0db682d9169563d919b...a320804d310fdeb8d1a46c6c6c1e615d443b10c9)

---
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 agosrc: The return value of server_vacuum () is not used and could be modified to void...
Li kunyu [Wed, 18 May 2022 06:52:43 +0000 (14:52 +0800)] 
src: The return value of server_vacuum () is not used and could be modified to void type

3 years agologin: do not issue wall messages on local terminals for suspend and hibernate 23574/head
Christian Göttsche [Fri, 27 May 2022 11:47:23 +0000 (13:47 +0200)] 
login: do not issue wall messages on local terminals for suspend and hibernate

Fixes: #23520
[zjs: I added the comment and tweaked the patch a bit.

The call to reset_scheduled_shutdown() is moved down a bit to allow the
callback to have access to information about the operation being cancelled.
This all happens within the same function, so there should be no observable
change in behaviour.]

3 years agoshared/pager: print the name of the pager we'll try next in debug message 23575/head
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 08:59:12 +0000 (10:59 +0200)] 
shared/pager: print the name of the pager we'll try next in debug message

I had a strange failure where the pager was hanging on invocation (gdm crashed
and the kernel got into a strange state where it was hanging on some tasks).
Based on the logs from 'SYSTEMCTL_LOG_LEVEL=debug journalctl', I couldn't even
tell which pager binary we're executing. So let's shorten the function a bit and
provide a bit more detail.

3 years agoman/systemctl: improve grammar in description of --check-inhibitors
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 08:30:09 +0000 (10:30 +0200)] 
man/systemctl: improve grammar in description of --check-inhibitors

3 years agosystemctl: drop translation of method names to descriptions in error message
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 07:49:29 +0000 (09:49 +0200)] 
systemctl: drop translation of method names to descriptions in error message

We had yet-another table of descriptive strings to use in error messages.
I started thinking how to synchronize them with the strings in logind, but
ultimately I think it's better to remove those altogether. Those strings
should almost never be used: normally if the call fails, logind will provide
an error message itself, which is probably more detailed than what we can
figure out on the client side. And the most important part that we want to
show here is what exactly we called, in particular RebootWithFlags vs. Reboot,
etc. By using the "descriptive strings" we were obfuscating this. So let's just
simplify our code and print the actual method name, since this is more useful
as an error statement that is googlable and unique.

While at it, let's print the correct method name ;)

3 years agosystemctl: make function static
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 10:38:58 +0000 (12:38 +0200)] 
systemctl: make function static

3 years agologind: reduce scope of a few variables
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 12:34:05 +0000 (14:34 +0200)] 
logind: reduce scope of a few variables

3 years agologind: rework wall message about pending shutdown/halt/reboot/…
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 10:08:41 +0000 (12:08 +0200)] 
logind: rework wall message about pending shutdown/halt/reboot/…

Those messages simply *feel* dated: "The system is going for suspend NOW!".
Let's say "The system will suspend|power off|hibernate|… now!" instead.
The exclamation mark is enough to show the urgency.

Also, the "the" seemed out of place. We're not talking about a specific reboot.

3 years agoMerge pull request #23531 from yuwata/sd-bus-drop-version-2
Yu Watanabe [Wed, 1 Jun 2022 05:51:44 +0000 (14:51 +0900)] 
Merge pull request #23531 from yuwata/sd-bus-drop-version-2

sd-bus: drop version 2 format support

3 years agoMerge pull request #23512 from medhefgo/efi-clang
Yu Watanabe [Tue, 31 May 2022 21:16:48 +0000 (06:16 +0900)] 
Merge pull request #23512 from medhefgo/efi-clang

boot: Add string functions

3 years agoresolved: define source address for proxy-only stub replies
Benjamin Franzke [Tue, 31 May 2022 19:36:55 +0000 (21:36 +0200)] 
resolved: define source address for proxy-only stub replies

DnsPacket.ifindex=1 (loopback) is normalized to 0 whenever a message is
received on the loopback iface, so for both listeners, 127.0.0.53 and
127.0.0.54, the ifindex will be set to 0 by manager_recv() for queries
that have a local origin.

Replies to such local messages need to set a proper ifindex in any
case, as the supplied source-address would otherwise be ignored in
manager_ipv4_send() (CMSG generation is skipped due to ifindex > 0 check).

Note that this change only forces `ifindex` to loopback if it was actually
normalized to `0` before (due to a loopback detection) in order to keep the
nat-to-127.0.0.54-from-another-interface usecase that was described in
a8d09063447568d87288a8e868fe386c1da7ce09 intact.
Also note that nat is not supported for the main stub 127.0.0.53 which is
why forcing LOOPBACK_IFINDEX was/is fine for that case.

Fixes #23495

3 years agologind: do not print wall messages to local pseudoterminals
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 13:17:52 +0000 (15:17 +0200)] 
logind: do not print wall messages to local pseudoterminals

Fixes #23520. Replaces #23555.

The problem started with cdf370626f08ed509a5dde9d5618eed29d625032 and
90b1ec03b2ce939f589239133a32f4429f2ad6a6 which together started printing the
wall message in more cases. The motivation for those change was reasonable, but
this clearly causes problems described in #23520: users are getting unexpected
wall messages. Xterm, urxvt, (anything using libutempter?), and tmux (in some
configurations), register local pty sessions in utmp.

So let's try to suppress the message for local pseudo-terminal logins. This
patch based on #23538, but instead of filtering just on /dev/pts, it uses the
.ut_addr_v6 to only filter out local entries.

3 years agotests: add a helper that dumps /run/utmp in detail
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 13:23:35 +0000 (15:23 +0200)] 
tests: add a helper that dumps /run/utmp in detail

utmpdump doesn't print all the details. Looking at the list if useful
when trying to tweak the wall filtering logic.

This doesn't do much, but at least it serves as a smoke test for the cleanup
functions.

3 years agotest-network: call networkctl only when specified interface exists 23576/head
Yu Watanabe [Tue, 31 May 2022 19:01:10 +0000 (04:01 +0900)] 
test-network: call networkctl only when specified interface exists

Otherwise, this easily trigger another exception:
```
======================================================================
ERROR: test_erspan_tunnel_v0 (__main__.NetworkdNetDevTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./test/test-network/systemd-networkd-tests.py", line 686, in wait_online
    check_output(*args, env=env)
  File "./test/test-network/systemd-networkd-tests.py", line 65, in check_output
    return subprocess.check_output(command, universal_newlines=True, **kwargs).rstrip()
  File "/usr/lib64/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib64/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/lib/systemd/systemd-networkd-wait-online', '--timeout=20s', '--interface=erspan99:routable', '--interface=erspan98:routable', '--interface=dummy98:degraded']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./test/test-network/systemd-networkd-tests.py", line 1808, in test_erspan_tunnel_v0
    self.wait_online(['erspan99:routable', 'erspan98:routable', 'dummy98:degraded'])
  File "./test/test-network/systemd-networkd-tests.py", line 689, in wait_online
    output = check_output(*networkctl_cmd, '-n', '0', 'status', link.split(':')[0], env=env)
  File "./test/test-network/systemd-networkd-tests.py", line 65, in check_output
    return subprocess.check_output(command, universal_newlines=True, **kwargs).rstrip()
  File "/usr/lib64/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib64/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/networkctl', '-n', '0', 'status', 'erspan99']' returned non-zero exit status 1.
```

3 years agotest-network: add tests for erspan version 0 and 2
Yu Watanabe [Tue, 31 May 2022 14:36:16 +0000 (23:36 +0900)] 
test-network: add tests for erspan version 0 and 2

3 years agonetwork/erspan: support erspan version 0 and 2
Yu Watanabe [Tue, 31 May 2022 14:08:28 +0000 (23:08 +0900)] 
network/erspan: support erspan version 0 and 2

This also makes networkd accepts erspan index 0.

Closes #23570.

3 years agosd-bus: drop constant argument for message_extend_fields() 23531/head
Yu Watanabe [Tue, 31 May 2022 18:18:38 +0000 (03:18 +0900)] 
sd-bus: drop constant argument for message_extend_fields()

3 years agosd-bus: drop D-Bus version 2 format support
Yu Watanabe [Thu, 26 May 2022 20:37:47 +0000 (05:37 +0900)] 
sd-bus: drop D-Bus version 2 format support

It seems the format is used only by kdbus.

3 years agosd-bus: merge message_peek_fields() and buffer_peek()
Yu Watanabe [Tue, 31 May 2022 18:26:24 +0000 (03:26 +0900)] 
sd-bus: merge message_peek_fields() and buffer_peek()

3 years agosd-bus: make several functions static
Yu Watanabe [Thu, 26 May 2022 23:49:19 +0000 (08:49 +0900)] 
sd-bus: make several functions static

And drop 'bus_' prefix from them.

3 years agosd-bus: use UINT32_MAX
Yu Watanabe [Thu, 26 May 2022 23:16:46 +0000 (08:16 +0900)] 
sd-bus: use UINT32_MAX

3 years agosd-bus: drop unnecessary cast
Yu Watanabe [Fri, 27 May 2022 01:36:42 +0000 (10:36 +0900)] 
sd-bus: drop unnecessary cast

3 years agosd-bus: drop redundant condition
Yu Watanabe [Fri, 27 May 2022 02:23:46 +0000 (11:23 +0900)] 
sd-bus: drop redundant condition

By the previous commit, ALIGN8() is always equal to or greater than the
argument.

3 years agosd-bus: use ALIGN8()
Yu Watanabe [Tue, 31 May 2022 18:10:28 +0000 (03:10 +0900)] 
sd-bus: use ALIGN8()

3 years agoboot: use ALIGN4()
Yu Watanabe [Tue, 31 May 2022 18:07:30 +0000 (03:07 +0900)] 
boot: use ALIGN4()

3 years agomacro: make ALIGN4() and ALIGN8() also return SIZE_MAX on overflow
Yu Watanabe [Fri, 27 May 2022 01:51:47 +0000 (10:51 +0900)] 
macro: make ALIGN4() and ALIGN8() also return SIZE_MAX on overflow

This also drops unused ALIGN4_PTR(), ALIGN8_PTR(), and ALIGN_TO_PTR().

3 years agotree-wide: use ALIGN_PTR()
Yu Watanabe [Tue, 31 May 2022 18:06:57 +0000 (03:06 +0900)] 
tree-wide: use ALIGN_PTR()

3 years agoMove message repeat
Alexander Shopov [Tue, 31 May 2022 13:07:53 +0000 (15:07 +0200)] 
Move message repeat

Original catalog file is in English
Move the repeating German message to German catalog

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
3 years agoUpdate Bulgarian translation
Alexander Shopov [Mon, 16 May 2022 17:10:04 +0000 (19:10 +0200)] 
Update Bulgarian translation

po: catalog: Bring bg.po and catalog file to 100%

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
3 years agoportable: fix command option in comment
Yu Watanabe [Tue, 31 May 2022 12:37:41 +0000 (21:37 +0900)] 
portable: fix command option in comment

Follow-up for edea370222eec3d185dd84a7d9e942ec5933af63.

3 years agologind: use consistent casing in message
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 09:50:29 +0000 (11:50 +0200)] 
logind: use consistent casing in message

The other strings use "sentence capitalization". Let's do the
same here.

3 years agologind: align tables
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 09:49:12 +0000 (11:49 +0200)] 
logind: align tables

3 years agoshared/utmp-wtmp: pass information if entry is local to filter function
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 13:10:18 +0000 (15:10 +0200)] 
shared/utmp-wtmp: pass information if entry is local to filter function

This just adds an unused parameter for future use. No change in
behaviour.

3 years agotty-ask-password-agent: drop unnecessary code for non-absolute paths
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 13:02:56 +0000 (15:02 +0200)] 
tty-ask-password-agent: drop unnecessary code for non-absolute paths

utmp_wall() always prepends /dev/, so we don't need to do this a second
time here.

3 years agoboot: Use xstrdup8/16 23512/head
Jan Janssen [Wed, 25 May 2022 09:05:19 +0000 (11:05 +0200)] 
boot: Use xstrdup8/16

Note that xstrdup is now safe to call with a NULL pointer and will
just return NULL in that case.

3 years agoboot: Add xstrdup8/16
Jan Janssen [Wed, 25 May 2022 08:59:01 +0000 (10:59 +0200)] 
boot: Add xstrdup8/16

3 years agoboot: Use memcmp/memcpy/memset
Jan Janssen [Tue, 24 May 2022 11:39:00 +0000 (13:39 +0200)] 
boot: Use memcmp/memcpy/memset

3 years agoboot: Add memcmp/memcpy/memset
Jan Janssen [Tue, 24 May 2022 11:29:43 +0000 (13:29 +0200)] 
boot: Add memcmp/memcpy/memset

3 years agoboot: Use strsize8/16
Jan Janssen [Tue, 24 May 2022 09:07:04 +0000 (11:07 +0200)] 
boot: Use strsize8/16

3 years agoboot: Add strsize8/16
Jan Janssen [Tue, 24 May 2022 08:57:00 +0000 (10:57 +0200)] 
boot: Add strsize8/16

3 years agoboot: Use strchr8/16
Jan Janssen [Tue, 24 May 2022 08:26:35 +0000 (10:26 +0200)] 
boot: Use strchr8/16

3 years agoboot: Add strchr8/16
Jan Janssen [Tue, 24 May 2022 08:21:31 +0000 (10:21 +0200)] 
boot: Add strchr8/16

3 years agoboot: Use strcpy8/16
Jan Janssen [Tue, 24 May 2022 08:16:34 +0000 (10:16 +0200)] 
boot: Use strcpy8/16

3 years agoboot: Add strcpy8/16
Jan Janssen [Tue, 24 May 2022 08:14:35 +0000 (10:14 +0200)] 
boot: Add strcpy8/16

3 years agoboot: Use strtolower8/16
Jan Janssen [Thu, 26 May 2022 08:01:03 +0000 (10:01 +0200)] 
boot: Use strtolower8/16

3 years agoboot: Add strtolower8/16
Jan Janssen [Thu, 26 May 2022 07:57:16 +0000 (09:57 +0200)] 
boot: Add strtolower8/16

3 years agoboot: Use strcmp16 for cpio sorting
Jan Janssen [Thu, 26 May 2022 07:36:30 +0000 (09:36 +0200)] 
boot: Use strcmp16 for cpio sorting

3 years agoboot: Use strcmp8/16
Jan Janssen [Tue, 24 May 2022 08:07:07 +0000 (10:07 +0200)] 
boot: Use strcmp8/16

This also replaces streq and similar functions for consistency. Note
that streq16 is null pointer safe, so streq_ptr can be safely replaced
too.

3 years agoboot: Add strcmp8/16
Jan Janssen [Mon, 23 May 2022 11:09:03 +0000 (13:09 +0200)] 
boot: Add strcmp8/16

3 years agoboot: Use strlen8/16
Jan Janssen [Mon, 23 May 2022 10:32:50 +0000 (12:32 +0200)] 
boot: Use strlen8/16

The casts in this and the next few commits are curently necessary
because CHAR8 is defined as uint8_t in gnu-efi, while char is signed.
Once we switch from gnu-efi typedefs to stdint types, the casts
will be dropped.

3 years agoboot: Add strlen8/16
Jan Janssen [Mon, 23 May 2022 09:23:40 +0000 (11:23 +0200)] 
boot: Add strlen8/16

3 years agoboot: Use stddef.h offsetof
Jan Janssen [Mon, 23 May 2022 10:08:15 +0000 (12:08 +0200)] 
boot: Use stddef.h offsetof

3 years agoseccomp: fix a typo in error message
Frantisek Sumsal [Tue, 31 May 2022 09:20:44 +0000 (11:20 +0200)] 
seccomp: fix a typo in error message

3 years agoMerge pull request #23558 from msekletar/issue-20329-followup
Yu Watanabe [Tue, 31 May 2022 08:38:25 +0000 (17:38 +0900)] 
Merge pull request #23558 from msekletar/issue-20329-followup

Actually delay running of mount start jobs when /p/s/mountinfo is rate limited

3 years agodocs: fix typo XBOOOTLDR -> XBOOTLDR
Matthias Lisin [Tue, 31 May 2022 07:58:57 +0000 (09:58 +0200)] 
docs: fix typo XBOOOTLDR -> XBOOTLDR

3 years agoSimplify random number selection
Jason A. Donenfeld [Tue, 24 May 2022 13:09:20 +0000 (15:09 +0200)] 
Simplify random number selection

We currently have a convoluted and complex selection of which random
numbers to use. We can simplify this down to two functions that cover
all of our use cases:

1) Randomness for crypto: this one needs to wait until the RNG is
   initialized. So it uses getrandom(0). If that's not available, it
   polls on /dev/random, and then reads from /dev/urandom. This function
   returns whether or not it was successful, as before.

2) Randomness for other things: this one uses getrandom(GRND_INSECURE).
   If it's not available it uses getrandom(GRND_NONBLOCK). And if that
   would block, then it falls back to /dev/urandom. And if /dev/urandom
   isn't available, it uses the fallback code. It never fails and
   doesn't return a value.

These two cases match all the uses of randomness inside of systemd.

I would prefer to make both of these return void, and get rid of the
fallback code, and simply assert in the incredibly unlikely case that
/dev/urandom doesn't exist. But Luca disagrees, so this commit attempts
to instead keep case (1) returning a return value, which all the callers
already check, and fix the fallback code in (2) to be less bad than
before.

For the less bad fallback code for (2), we now use auxval and some
timestamps, together with various counters representing the invocation,
hash it all together and provide the output. Provided that AT_RANDOM is
secure, this construction is probably okay too, though notably it
doesn't have any forward secrecy. Fortunately, it's only used by
random_bytes() and not by crypto_random_bytes().

3 years agoMerge pull request #23533 from yuwata/portable-remove-drop-in-configs
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 06:52:30 +0000 (08:52 +0200)] 
Merge pull request #23533 from yuwata/portable-remove-drop-in-configs

portable: remove drop-in configs

3 years agoMerge pull request #23564 from yuwata/core-unit-add-dep
Yu Watanabe [Tue, 31 May 2022 05:07:34 +0000 (14:07 +0900)] 
Merge pull request #23564 from yuwata/core-unit-add-dep

core: fix notification about unit dependency change

3 years agocgroup-util: Properly handle conditions where cgroup.threads is empty after SIGKILL...
msizanoen1 [Mon, 30 May 2022 15:08:07 +0000 (22:08 +0700)] 
cgroup-util: Properly handle conditions where cgroup.threads is empty after SIGKILL but processes still remain

After sending a SIGKILL to a process, the process might disappear from
`cgroup.threads` but still show up in `cgroup.procs` and still remains in the
cgroup and cause migrating new processes to `Delegate=yes` cgroups to fail with
`-EBUSY`. This is especially likely for heavyweight processes that consume more
kernel CPU time to clean up.

Fix this by only returning 0 when both `cgroup.threads` and
`cgroup.procs` are empty.

3 years agoMerge pull request #23560 from mrc0mmand/coccinelle
Yu Watanabe [Mon, 30 May 2022 20:02:57 +0000 (05:02 +0900)] 
Merge pull request #23560 from mrc0mmand/coccinelle

A couple of tweaks suggested by Coccinelle

3 years agoMerge pull request #23565 from bnf/man-nspawn-wording
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 19:50:57 +0000 (21:50 +0200)] 
Merge pull request #23565 from bnf/man-nspawn-wording

man: nspawn related wording improvements