]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agologinctl: show session idle status in list-sessions 27740/head
David Tardon [Fri, 19 May 2023 12:03:09 +0000 (14:03 +0200)] 
loginctl: show session idle status in list-sessions

2 years agologinctl: use bus_map_all_properties
David Tardon [Fri, 19 May 2023 11:33:58 +0000 (13:33 +0200)] 
loginctl: use bus_map_all_properties

2 years agologinctl: shorten variable name
David Tardon [Tue, 23 May 2023 08:48:15 +0000 (10:48 +0200)] 
loginctl: shorten variable name

2 years agotest: extend test for loginctl list-*
David Tardon [Fri, 19 May 2023 12:21:44 +0000 (14:21 +0200)] 
test: extend test for loginctl list-*

2 years agoMerge pull request #27739 from dtardon/test-session-properties
Luca Boccassi [Mon, 22 May 2023 22:55:25 +0000 (23:55 +0100)] 
Merge pull request #27739 from dtardon/test-session-properties

Add a test for org.freedesktop.logind1.Session SetIdleHint

2 years agomkosi: Make sure persistent journal storage is enabled
Daan De Meyer [Mon, 22 May 2023 11:33:01 +0000 (13:33 +0200)] 
mkosi: Make sure persistent journal storage is enabled

We ship with empty /var, so /var/log/journal does not exist, which
means journald does not do persistent logging. Let's fix that by
setting the config to explicitly enable persistent logging.

2 years agorepart: Default to vfat for ESP/XBOOTLDR partitions
Daan De Meyer [Mon, 22 May 2023 17:32:18 +0000 (19:32 +0200)] 
repart: Default to vfat for ESP/XBOOTLDR partitions

vfat makes a lot more sense than ext4 for these partitions.

2 years agoMerge pull request #27733 from mrc0mmand/more-test-followups
Yu Watanabe [Mon, 22 May 2023 20:02:36 +0000 (05:02 +0900)] 
Merge pull request #27733 from mrc0mmand/more-test-followups

test: a couple of follow-ups

2 years agologin: add test for SetIdleHint 27739/head
David Tardon [Mon, 22 May 2023 13:30:03 +0000 (15:30 +0200)] 
login: add test for SetIdleHint

2 years agologin: do not hardcode tty used in TEST-35-LOGIN
David Tardon [Mon, 22 May 2023 13:36:21 +0000 (15:36 +0200)] 
login: do not hardcode tty used in TEST-35-LOGIN

The test can be run manually outside of CI.

2 years agoman: use setlogmask in LogControl1 example
Luca Boccassi [Mon, 22 May 2023 15:25:50 +0000 (16:25 +0100)] 
man: use setlogmask in LogControl1 example

Useful to show programs using syslog() how to easily set a mask.

2 years agotest: use run_testcases() in a few more places 27733/head
Frantisek Sumsal [Mon, 22 May 2023 14:02:43 +0000 (16:02 +0200)] 
test: use run_testcases() in a few more places

2 years agotest: add a missing session activation
Frantisek Sumsal [Mon, 22 May 2023 13:08:29 +0000 (15:08 +0200)] 
test: add a missing session activation

Otherwise test_list_user_sessions() would fail unless ordered after
test_session(), which activates the session.

2 years agotest: prefix "internal" stuff with an underscore
Frantisek Sumsal [Mon, 22 May 2023 11:24:12 +0000 (13:24 +0200)] 
test: prefix "internal" stuff with an underscore

Since bash has no namespaces, let's do the second best thing and prefix
all "internal" stuff with an underscore, to minimize the chance of a name
conflict in the future.

2 years agotest: abstract the test case logic into a shared function
Frantisek Sumsal [Mon, 22 May 2023 10:39:25 +0000 (12:39 +0200)] 
test: abstract the test case logic into a shared function

2 years agoMerge pull request #27703 from keszybz/systemd-vconsole-ordering
Zbigniew Jędrzejewski-Szmek [Mon, 22 May 2023 11:27:33 +0000 (13:27 +0200)] 
Merge pull request #27703 from keszybz/systemd-vconsole-ordering

Order systemd-vconsole-setup before getty units

2 years agozsh: amend completion for networkctl edit
Ronan Pigott [Sun, 21 May 2023 20:33:22 +0000 (13:33 -0700)] 
zsh: amend completion for networkctl edit

2 years agotest: fix a typo in the cleanup stuff
Frantisek Sumsal [Mon, 22 May 2023 10:06:16 +0000 (12:06 +0200)] 
test: fix a typo in the cleanup stuff

2 years agotest: avoid memleak when allocation fails
Frantisek Sumsal [Sun, 21 May 2023 21:13:16 +0000 (23:13 +0200)] 
test: avoid memleak when allocation fails

==8==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 168 byte(s) in 3 object(s) allocated from:
    #0 0x4a0e6e in __interceptor_calloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:77:3
    #1 0x4dec61 in calloc (/build/fuzz-bus-match+0x4dec61)
    #2 0x7f7c25e2b92d in bus_match_add_leaf /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-match.c:548:13
    #3 0x7f7c25e2b92d in bus_match_add /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-match.c:886:16
    #4 0x4de864 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/libsystemd/sd-bus/fuzz-bus-match.c:83:21
    #5 0x4defc8 in NaloFuzzerTestOneInput (/build/fuzz-bus-match+0x4defc8)
    #6 0x4fdf53 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #7 0x4fd73a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #8 0x4fee09 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
    #9 0x4ffad5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
    #10 0x4eee3f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #11 0x4ef708 in LLVMFuzzerRunDriver /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:925:10
    #12 0x4df225 in main (/build/fuzz-bus-match+0x4df225)
    #13 0x7f7c252e3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)

DEDUP_TOKEN: __interceptor_calloc--calloc--bus_match_add_leaf
SUMMARY: AddressSanitizer: 168 byte(s) leaked in 3 allocation(s).

Found by Nallocfuzz.

2 years agoshared: correctly propagate possible allocation errors
Frantisek Sumsal [Sun, 21 May 2023 19:00:26 +0000 (21:00 +0200)] 
shared: correctly propagate possible allocation errors

instead of just asserting in case the memstream couldn't be resized.

Found by Nallocufuzz.

2 years agowait-online: downgrade log level of failure that interface is removed or unmanaged...
Yu Watanabe [Mon, 22 May 2023 05:30:58 +0000 (14:30 +0900)] 
wait-online: downgrade log level of failure that interface is removed or unmanaged during processing it

Closing #27145.

2 years agoboot: Read files in small chunks on broken firmware
Jan Janssen [Thu, 5 Jan 2023 17:35:19 +0000 (18:35 +0100)] 
boot: Read files in small chunks on broken firmware

Fixes: #25911
2 years agoMerge pull request #27726 from yuwata/network-wireguard-doc
Yu Watanabe [Mon, 22 May 2023 07:46:38 +0000 (16:46 +0900)] 
Merge pull request #27726 from yuwata/network-wireguard-doc

network: update doc

2 years agoMerge pull request #26577 from ChenQi1989/revert-revert-journal
Daan De Meyer [Mon, 22 May 2023 05:51:01 +0000 (07:51 +0200)] 
Merge pull request #26577 from ChenQi1989/revert-revert-journal

Revert "Revert "journal: Make sd_journal_previous/next() return 0 at …

2 years agoman: AllowedIPs= can be specified multiple times 27726/head
Yu Watanabe [Mon, 22 May 2023 05:18:40 +0000 (14:18 +0900)] 
man: AllowedIPs= can be specified multiple times

Closes #27507.

2 years agonetwork/wireguard: make AllowedIPs= cleared by specifying an empty string
Yu Watanabe [Mon, 22 May 2023 05:15:49 +0000 (14:15 +0900)] 
network/wireguard: make AllowedIPs= cleared by specifying an empty string

2 years agotest: install test specific modules in test_append_files()
Yu Watanabe [Fri, 19 May 2023 20:01:05 +0000 (05:01 +0900)] 
test: install test specific modules in test_append_files()

2 years agoRevert "Revert "journal: Make sd_journal_previous/next() return 0 at HEAD/TAIL"" 26577/head
Chen Qi [Fri, 24 Feb 2023 04:36:55 +0000 (12:36 +0800)] 
Revert "Revert "journal: Make sd_journal_previous/next() return 0 at HEAD/TAIL""

This reverts commit 1db6dbb1dcdacfd7d2b4c84562fc6e77bc8c43a5.

The original patch was reverted because of issue #25369. The issue was created
because it wrongly assumed that sd_journal_seek_tail() seeks to 'current' tail.
But in fact, only when a subsequent sd_journal_previous() is called that it's
pointing to the tail at that time. The concept of 'tail' in sd_journal_seek_tail()
only has a logical meaning, and a sd_journal_previous is needed. In fact, if we
look at the codes in journalctl, we can see sd_journal_seek_tail() is followed by
sd_journal_previous(). By contrary, a sd_journal_next() after a 'logical' tail does
not make much sense. So the original patch is correct, and projects that are
using 'sd_journal_next()' right after 'sd_journal_seek_tail()' should do fixes
as in https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2823#note_1637715.

2 years agosd-journal: save correct location specifier
Yu Watanabe [Sun, 21 May 2023 16:59:18 +0000 (01:59 +0900)] 
sd-journal: save correct location specifier

2 years agotest-journal-interleaving: extend tests to clarify the issue in sd_journal_next(...
Yu Watanabe [Sun, 21 May 2023 16:56:08 +0000 (01:56 +0900)] 
test-journal-interleaving: extend tests to clarify the issue in sd_journal_next() or friends

This illustrates bug in sd_journal_next() or friends;
calling sd_jounral_next() followed by sd_journal_seek_tail() makes the
location saved in sd-journal something corrupted, and subsequent
sd_journal_previous() or friends may fail or provides unexpected result.

2 years agoudevadm-verify: introduce --no-summary option
Dmitry V. Levin [Tue, 16 May 2023 08:00:00 +0000 (08:00 +0000)] 
udevadm-verify: introduce --no-summary option

When udevadm verify is invoked by an analyzer tool like rpminspect
to verify individual udev rules files, the summary just clutters the
output, so provide an option to turn the summary off.

2 years agoMerge pull request #27157 from YHNdnzj/networkctl-edit
Yu Watanabe [Sun, 21 May 2023 12:36:56 +0000 (21:36 +0900)] 
Merge pull request #27157 from YHNdnzj/networkctl-edit

networkctl: add verb edit and cat to operate on network configs

2 years agotest: add tests for networkctl edit/cat 27157/head
Mike Yuan [Mon, 10 Apr 2023 10:45:00 +0000 (18:45 +0800)] 
test: add tests for networkctl edit/cat

2 years agonetworkctl: add verb edit and cat to operate on network configs
Mike Yuan [Sat, 1 Apr 2023 11:44:29 +0000 (19:44 +0800)] 
networkctl: add verb edit and cat to operate on network configs

This adds two verbs, edit and cat, to networkctl for
operating on network configs (namely .network, .netdev
and .link files). Specially, if the config name is
prefixed by @, it will be treated as network interface
name, and operations will be performed on config files
associated with the link.

Closes #26906

2 years agoconf-parser: move config_get_dropin_files to conf-files
Mike Yuan [Fri, 12 May 2023 18:38:41 +0000 (02:38 +0800)] 
conf-parser: move config_get_dropin_files to conf-files

2 years agonetworkctl: mark some verbs as online only
Mike Yuan [Sun, 9 Apr 2023 12:39:12 +0000 (20:39 +0800)] 
networkctl: mark some verbs as online only

2 years agonetworkctl: fix a typo in log message
Mike Yuan [Fri, 14 Apr 2023 18:04:34 +0000 (02:04 +0800)] 
networkctl: fix a typo in log message

2 years agonetworkctl: add missing asserts
Mike Yuan [Sun, 9 Apr 2023 23:31:24 +0000 (07:31 +0800)] 
networkctl: add missing asserts

2 years agonetworkctl: check netns only if networkd is running
Mike Yuan [Sun, 2 Apr 2023 18:20:32 +0000 (02:20 +0800)] 
networkctl: check netns only if networkd is running

2 years agoMerge pull request #27719 from mrc0mmand/fuzz-tweaks
Mike Yuan [Sun, 21 May 2023 07:41:15 +0000 (15:41 +0800)] 
Merge pull request #27719 from mrc0mmand/fuzz-tweaks

fuzz: a couple of fixes for issues found by Nallocfuzz

2 years agosd-event: check the allocation before calling expand_to_usable() 27719/head
Frantisek Sumsal [Sat, 20 May 2023 21:00:48 +0000 (23:00 +0200)] 
sd-event: check the allocation before calling expand_to_usable()

As it might hide a possible allocation error since it uses
the returns_nonnull attribute:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==8==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000004 (pc 0x7f317897db8d bp 0x7ffd436fe9a0 sp 0x7ffd436fe970 T0)
==8==The signal is caused by a WRITE memory access.
==8==Hint: address points to the zero page.
SCARINESS: 10 (null-deref)
    #0 0x7f317897db8d in source_new /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:1214:18
    #1 0x7f317897e68c in sd_event_add_time /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:1417:13
    #2 0x7f317897a0f6 in event_reset_time /work/build/../../src/systemd/src/libsystemd/sd-event/event-util.c:68:21
    #3 0x4e2c8e in client_initialize_time_events /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp-client.c:1366:13
    #4 0x4eb0fd in client_initialize_events /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp-client.c:1380:9
    #5 0x4eb0fd in client_start_delayed /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp-client.c:1410:16
    #6 0x4e30aa in client_start /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp-client.c:1415:16
    #7 0x4e30aa in sd_dhcp_client_start /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp-client.c:2045:13
    #8 0x4e700e in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/libsystemd-network/fuzz-dhcp-client.c:73:15
    #9 0x5062f8 in NaloFuzzerTestOneInput (/build/fuzz-dhcp-client+0x5062f8)
    #10 0x525283 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #11 0x524a6a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #12 0x526139 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
    #13 0x526e05 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
    #14 0x51616f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #15 0x516a38 in LLVMFuzzerRunDriver /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:925:10
    #16 0x506555 in main (/build/fuzz-dhcp-client+0x506555)
    #17 0x7f3177ce3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #18 0x420c4d in _start (/build/fuzz-dhcp-client+0x420c4d)

Found by Nallocfuzz.

2 years agofuzz: avoid a couple of NULL pointer dereferences
Frantisek Sumsal [Sat, 20 May 2023 18:13:20 +0000 (20:13 +0200)] 
fuzz: avoid a couple of NULL pointer dereferences

In case one of the allocations fails.

For example:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==17==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fb352a476e5 bp 0x7ffe45154850 sp 0x7ffe45154008 T0)
==17==The signal is caused by a READ memory access.
==17==Hint: address points to the zero page.
SCARINESS: 10 (null-deref)
    #0 0x7fb352a476e5  (/lib/x86_64-linux-gnu/libc.so.6+0x1886e5) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #1 0x435878 in __interceptor_strlen /src/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc
    #2 0x4de1e4 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-calendarspec.c:20:21
    #3 0x4deea8 in NaloFuzzerTestOneInput (/build/fuzz-calendarspec+0x4deea8)
    #4 0x4fde33 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #5 0x4fd61a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #6 0x4fece9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
    #7 0x4ff9b5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
    #8 0x4eed1f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #9 0x4ef5e8 in LLVMFuzzerRunDriver /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:925:10
    #10 0x4df105 in main (/build/fuzz-calendarspec+0x4df105)
    #11 0x7fb3528e3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #12 0x41f80d in _start (/build/fuzz-calendarspec+0x41f80d)

Found by Nallocfuzz.

2 years agoREADME: drop the CentOS CI SELinux job
Frantisek Sumsal [Sat, 20 May 2023 15:12:01 +0000 (17:12 +0200)] 
README: drop the CentOS CI SELinux job

It has been failing for more than a year and I don't think that anyone
cares about the stuff it keeps finding.

2 years agoMerge pull request #27714 from yuwata/cryptenroll-password
Mike Yuan [Sat, 20 May 2023 08:33:16 +0000 (16:33 +0800)] 
Merge pull request #27714 from yuwata/cryptenroll-password

cryptenroll-password: tiny cleanups

2 years agocryptenroll: update log messages 27714/head
Yu Watanabe [Fri, 19 May 2023 20:30:33 +0000 (05:30 +0900)] 
cryptenroll: update log messages

2 years agocryptenroll: drop unmet condition
Yu Watanabe [Fri, 19 May 2023 20:30:01 +0000 (05:30 +0900)] 
cryptenroll: drop unmet condition

2 years agoMerge pull request #27707 from mrc0mmand/tests
Yu Watanabe [Fri, 19 May 2023 23:40:01 +0000 (08:40 +0900)] 
Merge pull request #27707 from mrc0mmand/tests

test: provide coverage for a couple of recent-ish issues

2 years agotest: replace Makefile for several tests with symlink to the one for TEST-01-BASIC
Yu Watanabe [Fri, 19 May 2023 19:19:19 +0000 (04:19 +0900)] 
test: replace Makefile for several tests with symlink to the one for TEST-01-BASIC

2 years agoMerge pull request #27676 from ldv-alt/udevadm-verify
Yu Watanabe [Fri, 19 May 2023 20:41:05 +0000 (05:41 +0900)] 
Merge pull request #27676 from ldv-alt/udevadm-verify

udevadm-verify: add support for directory arguments

2 years agoMerge pull request #27701 from poettering/switch-root-same-file
Yu Watanabe [Fri, 19 May 2023 20:39:28 +0000 (05:39 +0900)] 
Merge pull request #27701 from poettering/switch-root-same-file

switch-root: use same_files() logic when checking whether new and old root dir are actually the same

2 years agoMerge pull request #27438 from bluca/dump_ratelimit
Luca Boccassi [Fri, 19 May 2023 20:29:58 +0000 (21:29 +0100)] 
Merge pull request #27438 from bluca/dump_ratelimit

manager: restrict Dump*() to privileged callers or ratelimit

2 years agotest: check if we correctly handle locales with leading spaces 27707/head
Frantisek Sumsal [Fri, 19 May 2023 17:53:55 +0000 (19:53 +0200)] 
test: check if we correctly handle locales with leading spaces

Provides coverage for #27179.

2 years agotests: run all functions with testcase_ prefix automagically
Frantisek Sumsal [Fri, 19 May 2023 16:48:07 +0000 (18:48 +0200)] 
tests: run all functions with testcase_ prefix automagically

2 years agotest: check if we correctly handle invalid UTF-8 in mount stuff
Frantisek Sumsal [Fri, 19 May 2023 16:42:36 +0000 (18:42 +0200)] 
test: check if we correctly handle invalid UTF-8 in mount stuff

Provides coverage for #27611.

2 years agotest: assorted TEST-13-NSPAWN tweaks
Frantisek Sumsal [Fri, 19 May 2023 15:27:38 +0000 (17:27 +0200)] 
test: assorted TEST-13-NSPAWN tweaks

2 years agotest: check if we can use --merge with --follow
Frantisek Sumsal [Fri, 19 May 2023 15:37:17 +0000 (17:37 +0200)] 
test: check if we can use --merge with --follow

Provides coverage for #24565.

2 years agounits: order sysinit.target, debug-shell.service after systemd-vconsole-setup 27703/head
Zbigniew Jędrzejewski-Szmek [Fri, 19 May 2023 13:58:18 +0000 (15:58 +0200)] 
units: order sysinit.target, debug-shell.service after systemd-vconsole-setup

Previous patch to add an implicit dependency effectively orders various getty
services after systemd-vconsole-setup.service. But I think it's cleaner to also
order the service before sysinit.target, like it was before
8125e8d38e3aa099c7dce8b0161997b8842aebdc. There might be units which don't do
use TTYVHangup= but would like to have the console fully initialized.

Also, add a manual ordering to debug-shell.service, because it has
ImplicitDependencies=no. This might delay debug-shell.service a bit, but
systemd-vconsole-setup.service has no dependencies and should be very quick, so
this should not be noticable in practice. Without the ordering, the terminal
might not have a key map loaded, making debug-shell.service hard to use.

2 years agorules: start systemd-vconsole-setup via unit
Zbigniew Jędrzejewski-Szmek [Fri, 19 May 2023 13:07:39 +0000 (15:07 +0200)] 
rules: start systemd-vconsole-setup via unit

We started systemd-vconsole-setup in two ways: via a dbus call from localed to
do systemd-vconsole-setup.service/restart, and from udev, calling the binary
directly. This patch makes udev call
  systemctl restart systemd-vconsole-setup.service
effectively implementing the same method as localed.

Ordering is implemented at the unit level, so we can use --no-block to not
block here.

2 years agopid1: order units using TTYVHangup= after vconsole setup
Zbigniew Jędrzejewski-Szmek [Fri, 19 May 2023 13:50:04 +0000 (15:50 +0200)] 
pid1: order units using TTYVHangup= after vconsole setup

The goal of this change is to delay getty services until after
systemd-vconsole-setup has finished. systemd-vconsole-setup starts loadkeys,
and it seems that when loadkeys is interrupted by the TTY hangup call we do
when starting tty services [1], so that loadkeys starts getting EIO from the
ioctl("/dev/tty1", KDSKBENT) syscall it does.

Fixes #26908.

[1] https://github.com/legionus/kbd/issues/92#issuecomment-1554451788

Initially I wanted to add ordering dependencies to individual units, but
TTYVHangup= can be added to other various external units too. The solution with
an implicit dependency should cover those cases too.

2 years agonamespace-util: use inode_same_at() instead of FORMAT_PROC_FD_PATH() 27701/head
Lennart Poettering [Fri, 19 May 2023 12:50:15 +0000 (14:50 +0200)] 
namespace-util: use inode_same_at() instead of FORMAT_PROC_FD_PATH()

Doesn't matter much, but this makes it leas magic and independent of
/proc/ mounts. (Well, it actually doesn't, since the right-hand path is
also in /proc/, but still...

2 years agostat-util: rename files_same() → inode_same()
Lennart Poettering [Fri, 19 May 2023 12:47:37 +0000 (14:47 +0200)] 
stat-util: rename files_same() → inode_same()

Let's be more accurate about what this function does: it checks whether
the underlying reported inode is the same. Internally, this already uses
a better named stat_inode_same() call, hence let's similarly name the
wrapping function following the same logic.

Similar for files_same_at() and path_equal_or_same_files().

No code changes, just some renaming.

2 years agoswitch-root: check if old and new root fs is same via files_same_at()
Lennart Poettering [Tue, 16 May 2023 12:57:20 +0000 (14:57 +0200)] 
switch-root: check if old and new root fs is same via files_same_at()

2 years agostat-util: add _at() variant for files_same()
Lennart Poettering [Mon, 15 May 2023 19:20:17 +0000 (21:20 +0200)] 
stat-util: add _at() variant for files_same()

2 years agojournalctl: make --follow work with --merge again
Frantisek Sumsal [Fri, 19 May 2023 07:17:29 +0000 (09:17 +0200)] 
journalctl: make --follow work with --merge again

Set --boot with --follow only if it's not already set and if --merge is
not used, since it's not compatible with --boot.

Follow-up to 2dd9285bac.
Resolves: #24565

2 years agoMerge pull request #27700 from poettering/switch-root-sync
Lennart Poettering [Fri, 19 May 2023 14:27:23 +0000 (07:27 -0700)] 
Merge pull request #27700 from poettering/switch-root-sync

switch-root: add sync() before getting rid of auxiliary mounts of old root

2 years agomanager: restrict Dump*() to privileged callers or ratelimit 27438/head
Luca Boccassi [Thu, 27 Apr 2023 22:23:30 +0000 (23:23 +0100)] 
manager: restrict Dump*() to privileged callers or ratelimit

Dump*() methods can take quite some time due to the amount of data to
serialize, so they can potentially stall the manager. Make them
privileged, as they are debugging tools anyway. Use a new 'dump'
capability for polkit, and the 'reload' capability for SELinux, as
that's also non-destructive but slow.

If the caller is not privileged, allow it but rate limited to 10 calls
every 10 minutes.

2 years agoratelimit: add ratelimit_left helper
Luca Boccassi [Fri, 28 Apr 2023 12:10:23 +0000 (13:10 +0100)] 
ratelimit: add ratelimit_left helper

2 years agoMerge pull request #27698 from mrc0mmand/test-tweaks
Frantisek Sumsal [Fri, 19 May 2023 13:29:35 +0000 (15:29 +0200)] 
Merge pull request #27698 from mrc0mmand/test-tweaks

test: a couple of performance-related tweaks

2 years agounits: order getty units after getty-pre.target unconditionally
Zbigniew Jędrzejewski-Szmek [Fri, 19 May 2023 13:05:30 +0000 (15:05 +0200)] 
units: order getty units after getty-pre.target unconditionally

Those two units had this ordering conditionalized on HAVE_SYSV_COMPAT. This
seems strange. 45e27532971ac84e835a2879df510a581f933fcd added the ordering
differently for those two files without any comment, and I think it was just
pasted or scripted erroneously.

2 years agovconsole-setup: reduce variable scope, shorten things
Zbigniew Jędrzejewski-Szmek [Thu, 18 May 2023 15:37:23 +0000 (17:37 +0200)] 
vconsole-setup: reduce variable scope, shorten things

2 years agoswitch-root: sync() before MNT_DETACH unmounting all old mounts 27700/head
Lennart Poettering [Fri, 19 May 2023 12:22:14 +0000 (14:22 +0200)] 
switch-root: sync() before MNT_DETACH unmounting all old mounts

As discussed here:

https://github.com/systemd/systemd/pull/27670#discussion_r1196716794

2 years agotree-wide: remove (void) cast around sync()
Lennart Poettering [Fri, 19 May 2023 12:21:21 +0000 (14:21 +0200)] 
tree-wide: remove (void) cast around sync()

The call is void anyway, it doesn't return an failure indication. Hence,
no need to cast void to (void)...

(We got this right in most cases, but forgot some)

2 years agoupdate TODO
Lennart Poettering [Fri, 19 May 2023 11:37:22 +0000 (13:37 +0200)] 
update TODO

2 years agoMerge pull request #27670 from poettering/switch-root-umount-all
Lennart Poettering [Fri, 19 May 2023 12:03:23 +0000 (05:03 -0700)] 
Merge pull request #27670 from poettering/switch-root-umount-all

umount all mounts during MS_MOVE switch root

2 years agotest: build the SELinux test module on the host 27698/head
Frantisek Sumsal [Fri, 19 May 2023 09:45:11 +0000 (11:45 +0200)] 
test: build the SELinux test module on the host

Let's save some time and build the SELinux test module on the host
instead of a possibly unaccelerated VM. This brings the runtime of
TEST-06-SELINUX from ~12 minutes down to a ~1 minute.

2 years agotest: drop generated stuff from the final coverage report
Frantisek Sumsal [Fri, 19 May 2023 09:07:07 +0000 (11:07 +0200)] 
test: drop generated stuff from the final coverage report

Let's drop stuff from the current $BUILD_DIR from the final coverage
report, as it's all generated files (mostly gperf) which we don't
really care about and it makes the Coveralls report confusing, since it
reports "source not available" for all such files.

2 years agotest: make the stress test slightly less stressful on slower machines
Frantisek Sumsal [Fri, 19 May 2023 08:48:15 +0000 (10:48 +0200)] 
test: make the stress test slightly less stressful on slower machines

Without acceleration this part of the test takes over 10 minutes (!),
which feels quite unnecessary. Let's cut down the number of stuff we
dump to the journal in such case, but keep the original value if we run
with acceleration (since in that case it takes less than 10 seconds).

2 years agocore/device: downgrade error when units specified in SYSTEMD_WANTS= not found
Yu Watanabe [Thu, 18 May 2023 20:27:46 +0000 (05:27 +0900)] 
core/device: downgrade error when units specified in SYSTEMD_WANTS= not found

Closes #27693.

2 years agounit: add conditions and deps to make oomd.socket and .service consistent
Yu Watanabe [Thu, 18 May 2023 19:47:34 +0000 (04:47 +0900)] 
unit: add conditions and deps to make oomd.socket and .service consistent

Fixes #27690.

2 years agoMerge pull request #27686 from keszybz/make-boot-output-nicer
Yu Watanabe [Thu, 18 May 2023 18:50:45 +0000 (03:50 +0900)] 
Merge pull request #27686 from keszybz/make-boot-output-nicer

Make boot output nicer

2 years agohwdb: fix Positivo CG15D key toggle touchpad and programmable keys (#27689)
Edson Juliano Drosdeck [Thu, 18 May 2023 18:06:42 +0000 (14:06 -0400)] 
hwdb: fix Positivo CG15D key toggle touchpad and programmable keys (#27689)

2 years agoMerge pull request #27685 from keszybz/the-semiannual-excercise-in-output-narrowing
Yu Watanabe [Thu, 18 May 2023 18:04:47 +0000 (03:04 +0900)] 
Merge pull request #27685 from keszybz/the-semiannual-excercise-in-output-narrowing

The semiannual excercise in output narrowing

2 years agoMerge pull request #27684 from mrc0mmand/more-nspawn-tests
Yu Watanabe [Thu, 18 May 2023 18:00:54 +0000 (03:00 +0900)] 
Merge pull request #27684 from mrc0mmand/more-nspawn-tests

test: further extend systemd-nspawn coverage

2 years agoudevadm-verify: add support for directory arguments 27676/head
Dmitry V. Levin [Wed, 17 May 2023 14:00:00 +0000 (14:00 +0000)] 
udevadm-verify: add support for directory arguments

When an argument specified to udevadm verify is a directory,
verify all *.rules files in that directory.

Suggested-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2 years agoudev-rules: avoid issuing redundant diagnostics in verify mode
Dmitry V. Levin [Thu, 18 May 2023 17:00:00 +0000 (17:00 +0000)] 
udev-rules: avoid issuing redundant diagnostics in verify mode

When udevadm verify is given an argument that doesn't point to an
existing file, there used to be two diagnostics messages, the first one
at a warning level, and the second one at an error level:

$ build/udevadm verify /no/such/directory
Failed to open /no/such/directory, ignoring: No such file or directory
Failed to parse rules file /no/such/directory: No such file or directory

Fix this by issuing just the error message.

2 years agointegration test: pass 'noresume' to qemu
Luca Boccassi [Thu, 18 May 2023 12:08:56 +0000 (13:08 +0100)] 
integration test: pass 'noresume' to qemu

When running on Debian/Ubuntu, I get a minute delay or so on every boot
because the local initramfs tries to resume from hibernation. This is
not really useful here, so always skip it

2 years agotestsuite-17.11.sh: fix assert_1()
Dmitry V. Levin [Thu, 18 May 2023 12:00:00 +0000 (12:00 +0000)] 
testsuite-17.11.sh: fix assert_1()

Fix assert_1() to exit with an error status in case of a failed assertion.

2 years agotest: wrap setfacl when running with ASan 27684/head
Frantisek Sumsal [Thu, 18 May 2023 15:30:36 +0000 (17:30 +0200)] 
test: wrap setfacl when running with ASan

2 years agooomd: shorten message 27686/head
Zbigniew Jędrzejewski-Szmek [Thu, 18 May 2023 14:29:20 +0000 (16:29 +0200)] 
oomd: shorten message

We can make the message shorter and more direct without changing
the meaning.

2 years agosd-bus,sd-event: allow querying of description even after fork
Zbigniew Jędrzejewski-Szmek [Thu, 18 May 2023 15:05:41 +0000 (17:05 +0200)] 
sd-bus,sd-event: allow querying of description even after fork

This in unnecessarilly unpleasant: the code might report about a bus
connection, e.g. in an error message or assert. Let's let it query
the name of the object.

This partially reverts f4b2933ee7890e5d414ab266d8586f19027a2bd9.

2 years agosd-bus: do not assert if bus description is not set
Zbigniew Jędrzejewski-Szmek [Thu, 18 May 2023 15:03:53 +0000 (17:03 +0200)] 
sd-bus: do not assert if bus description is not set

The code has an explicit fallback using runtime_scope_to_string(), which
is also documented in the man page. So -ENXIO should only be returned when
the fallback doesn't work, i.e. bus->runtime_scope == -EINVAL.

Fixup for f4b2933ee7890e5d414ab266d8586f19027a2bd9.

This should fix the following errors during boot:
May 18 16:05:37 fedora systemd-update-utmp[263]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora systemctl[360]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora systemctl[363]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora systemd-update-utmp[372]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora @ystemctl[387]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:40 fedora systemd-update-utmp[477]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:41 fedora systemd-homed[509]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:41 fedora systemd-logind[510]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:41 fedora systemd-update-utmp[529]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:42 fedora systemd-user-runtime-dir[531]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:42 fedora systemctl[542]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:42 fedora systemd-hostnamed[556]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.

2 years agomeson: rename "dist-check" suite to "dist" 27685/head
Zbigniew Jędrzejewski-Szmek [Thu, 18 May 2023 15:16:33 +0000 (17:16 +0200)] 
meson: rename "dist-check" suite to "dist"

*Now* one of those tests is the longest, let's make them a bit shorter.

2 years agomeson: rename "fuzzers" suite to "fuzz"
Zbigniew Jędrzejewski-Szmek [Thu, 18 May 2023 15:14:50 +0000 (17:14 +0200)] 
meson: rename "fuzzers" suite to "fuzz"

Fuzz tests have all the longest names, so by making this name
shorter, we save three columns of screen real estate.

2 years agotest: don't mount /sys & /proc if already mounted
Frantisek Sumsal [Thu, 18 May 2023 13:52:43 +0000 (15:52 +0200)] 
test: don't mount /sys & /proc if already mounted

2 years agonspawn: make the error message less confusing
Frantisek Sumsal [Thu, 18 May 2023 13:14:20 +0000 (15:14 +0200)] 
nspawn: make the error message less confusing

by not printing (null) and dropping the extraneous slash, e.g.:

systemd-nspawn[2049]: Failed to resolve (null)//proc: Permission denied

2 years agotest: add a couple of tests for nspawn config files
Frantisek Sumsal [Wed, 17 May 2023 20:36:07 +0000 (22:36 +0200)] 
test: add a couple of tests for nspawn config files

2 years agonspawn: correctly parse a list of interfaces
Frantisek Sumsal [Thu, 18 May 2023 10:54:15 +0000 (12:54 +0200)] 
nspawn: correctly parse a list of interfaces

Interface=/MACVLAN=/IPVLAN= nspawn options take a _list_ of interface
names - this was recently enhanced by 2f091b1b49 to support interface
pairs. Unfortunately, this also introduced a regression where we don't
parse the list as a list, but just as a single value. For example,
having `Interface=sd-shared1 sd-shared2` in an nspawn config file would
throw:

systemd-nspawn[898]: Network interface, interface name not valid: sd-shared1 sd-shared2
systemd-nspawn[898]: /run/systemd/nspawn/testsuite-13.nspawn-settings.1po.nspawn:41: Failed to parse file: Invalid argument

Follow-up to 2f091b1b49.

2 years agotest: create nspawn config files when collecting coverage
Frantisek Sumsal [Wed, 17 May 2023 19:49:20 +0000 (21:49 +0200)] 
test: create nspawn config files when collecting coverage

Which bind-mounts the $BUILD_DIR into the container. This whole coverage
thing is getting slightly ridiculous.

Follow-up to 3b2823a749, but for non-machinectl containers.

2 years agotest: cover --bind-user=
Frantisek Sumsal [Wed, 17 May 2023 13:35:10 +0000 (15:35 +0200)] 
test: cover --bind-user=

2 years agotest: add a couple of sanity tests for --port=
Frantisek Sumsal [Wed, 17 May 2023 12:57:50 +0000 (14:57 +0200)] 
test: add a couple of sanity tests for --port=