]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 months agoresolve: NSCOUNT of DNS query may not be zero
Yu Watanabe [Sun, 7 Jan 2024 17:02:33 +0000 (02:02 +0900)] 
resolve: NSCOUNT of DNS query may not be zero

This also separates check for DNS and LLMNR, as the existing comments
are for LLMNR, not DNS. And this moves the comment for mDNS.

Fixes the issue reported at
https://github.com/systemd/systemd/pull/30809#issuecomment-1880102804.

5 months agologind: don't use assertion for deserialized_pid
Mike Yuan [Fri, 5 Jan 2024 17:47:20 +0000 (01:47 +0800)] 
logind: don't use assertion for deserialized_pid

Follow-up for 9d5b6901007e6717c6a37c49eb73bc0260e93893

Otherwise if session_load() went wrong, and we got pidfd
from fdstore, the assertion is triggered.

5 months agotest: sync the "foobaz" namespace as well
Frantisek Sumsal [Sat, 6 Jan 2024 10:45:23 +0000 (11:45 +0100)] 
test: sync the "foobaz" namespace as well

Otherwise we might be too fast, resulting in failed namespace check
later:

[    7.351453] testsuite-44.sh[401]: + journalctl --list-namespaces
[    7.351784] testsuite-44.sh[402]: + grep foobar
[    7.358851] testsuite-44.sh[402]: foobar
[    7.359598] testsuite-44.sh[403]: + journalctl --list-namespaces
[    7.359974] testsuite-44.sh[404]: + grep foobaz
[    7.369882] systemd[1]: testsuite-44.service: Failed with result 'exit-code'.

Follow-up for 68f66a1713.

5 months agoTEST-24-CRYPTSETUP: depend on OpenSSL for testing PKCS#11 tokens
Vladimir Stoiakin [Sat, 6 Jan 2024 13:59:56 +0000 (16:59 +0300)] 
TEST-24-CRYPTSETUP: depend on OpenSSL for testing PKCS#11 tokens

5 months agorepart: don't crash when looping over dropped partitions
Frantisek Sumsal [Sat, 6 Jan 2024 15:07:42 +0000 (16:07 +0100)] 
repart: don't crash when looping over dropped partitions

Properly skip over dropped partitions and make sure they don't affect
the final graphical output (for example by leaving empty "spaces" where
their definition file name would otherwise be).

Resolves: #30742

5 months agoMerge pull request #30803 from yuwata/network-route-parser-trivial-cleanups
Yu Watanabe [Sat, 6 Jan 2024 20:26:06 +0000 (05:26 +0900)] 
Merge pull request #30803 from yuwata/network-route-parser-trivial-cleanups

network/route: trivial cleanups for conf parsers

5 months agonetwork/link: always join to the main interface when we receive IFLA_MASTER attribute
Yu Watanabe [Thu, 4 Jan 2024 16:58:01 +0000 (01:58 +0900)] 
network/link: always join to the main interface when we receive IFLA_MASTER attribute

Otherwise, e.g. when we enumerate a bridge port first, then the bridge
main interface, then the port cannot be managed by the main interface.

Fixes #30682.

5 months agotest: reinitialize arg_transport before parsing arguments
Frantisek Sumsal [Sat, 6 Jan 2024 12:57:09 +0000 (13:57 +0100)] 
test: reinitialize arg_transport before parsing arguments

Since libfuzzer feeds a single fuzzing process with multiple inputs, we
might carry over arg_transport from a previous invocation, tripping over
the assert in acquire_bus():

+----------------------------------------Release Build Stacktrace----------------------------------------+
Assertion 'transport != BUS_TRANSPORT_REMOTE || runtime_scope == RUNTIME_SCOPE_SYSTEM' failed at src/shared/bus-util.c:284, function bus_connect_transport(). Aborting.
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2739==ERROR: AddressSanitizer: ABRT on unknown address 0x00000ab3 (pc 0xf7f52509 bp 0xffdf74cc sp 0xffdf74b0 T0)
SCARINESS: 10 (signal)
    #0 0xf7f52509 in linux-gate.so.1
    #1 0xf703b415 in raise
    #2 0xf70233f6 in abort
    #3 0xf772ac0a in log_assert_failed systemd/src/basic/log.c:968:9
    #4 0xf77300d5 in log_assert_failed_return systemd/src/basic/log.c:987:17
    #5 0xf7432bbf in bus_connect_transport systemd/src/shared/bus-util.c:284:9
    #6 0x818cd17 in acquire_bus systemd/src/systemctl/systemctl-util.c:53:29
    #7 0x815fd3c in help_boot_loader_entry systemd/src/systemctl/systemctl-logind.c:431:13
    #8 0x819ca87 in systemctl_parse_argv systemd/src/systemctl/systemctl.c:863:37
    #9 0x8197632 in systemctl_dispatch_parse_argv systemd/src/systemctl/systemctl.c:1137:16
    #10 0x813328d in LLVMFuzzerTestOneInput systemd/src/systemctl/fuzz-systemctl-parse-argv.c:54:13
    #11 0x81bbe7e in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned int) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #12 0x81bb5b8 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned int, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #13 0x81bd42d in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7
    #14 0x81bd62e in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3
    #15 0x81ac84c in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned int)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #16 0x81d65c7 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #17 0xf7024ed4 in __libc_start_main
    #18 0x806bdb5 in _start

Resolves: #30802

5 months agoTODO: drop some implemented entries
Mike Yuan [Sat, 6 Jan 2024 17:46:09 +0000 (01:46 +0800)] 
TODO: drop some implemented entries

5 months agonetwork/route-metric: unify error messages 30803/head
Yu Watanabe [Fri, 5 Jan 2024 20:36:48 +0000 (05:36 +0900)] 
network/route-metric: unify error messages

5 months agonetwork/route-metric: pass attribute type to conf parsers
Yu Watanabe [Sat, 6 Jan 2024 04:07:11 +0000 (13:07 +0900)] 
network/route-metric: pass attribute type to conf parsers

The passed attribute type will be used later.

This also
- rename conf parsers,
- sort gperf entries by the attr type.

No functional change, just refactoring and preparation for later commits.

5 months agonetwork/route: move several conf parsers to networkd-route-metric.c and networkd...
Yu Watanabe [Fri, 5 Jan 2024 20:08:40 +0000 (05:08 +0900)] 
network/route: move several conf parsers to networkd-route-metric.c and networkd-route-nexthop.c

This also split config_parse_route_boolean() into two:
for GatewayOnline= and boolean route metrics.

No functional change, just refactoring and preparation for later commits.

5 months agonetwork/route: rename n -> route in conf parsers
Yu Watanabe [Fri, 5 Jan 2024 19:44:40 +0000 (04:44 +0900)] 
network/route: rename n -> route in conf parsers

5 months agonetwork/route: do not invalidate [Route] section when an empty string is assigned...
Yu Watanabe [Fri, 5 Jan 2024 20:23:06 +0000 (05:23 +0900)] 
network/route: do not invalidate [Route] section when an empty string is assigned to MultiPathRoute=

5 months agoMerge pull request #30801 from yuwata/test-network-cleanups
Frantisek Sumsal [Sat, 6 Jan 2024 10:26:39 +0000 (11:26 +0100)] 
Merge pull request #30801 from yuwata/test-network-cleanups

test-network: several cleanups

5 months agotest-network: do not call networkctl if networkd is in failed state 30801/head
Yu Watanabe [Sat, 6 Jan 2024 03:42:02 +0000 (12:42 +0900)] 
test-network: do not call networkctl if networkd is in failed state

Otherwise, networkd may be restarted by DBus and we may get wrong
results.

5 months agotest-network: introduce networkctl() and friends
Yu Watanabe [Sat, 6 Jan 2024 03:33:09 +0000 (12:33 +0900)] 
test-network: introduce networkctl() and friends

5 months agotest-network: use read_networkd_log() at one more place
Yu Watanabe [Sat, 6 Jan 2024 02:32:03 +0000 (11:32 +0900)] 
test-network: use read_networkd_log() at one more place

5 months agotest-network: sync journal before read
Yu Watanabe [Sat, 6 Jan 2024 02:29:01 +0000 (11:29 +0900)] 
test-network: sync journal before read

Otherwise, test cases that check journal entries, e.g. test_unit_file()
may fail.

5 months agonspawn: lock down access to notify socket a bit
Lennart Poettering [Fri, 5 Jan 2024 15:41:24 +0000 (16:41 +0100)] 
nspawn: lock down access to notify socket a bit

On Linux only the "w" access bit is necessary to connect to an AF_UNIX
socket, hence let's only set that and nothing else, to limit exposure.

Just paranoia.

5 months agocore: escape spaces in paths during serialization
Frantisek Sumsal [Fri, 5 Jan 2024 19:39:40 +0000 (20:39 +0100)] 
core: escape spaces in paths during serialization

Otherwise we split them incorrectly when deserializing them.

Resolves: #30747

5 months agoMerge pull request #30794 from poettering/parse-vsock-better
Yu Watanabe [Sat, 6 Jan 2024 02:16:19 +0000 (11:16 +0900)] 
Merge pull request #30794 from poettering/parse-vsock-better

socket-util: add more careful parsers for AF_VSOCK cid/port

5 months agoudevadm: allow to override the default log level by environment variable
Yu Watanabe [Fri, 5 Jan 2024 18:27:07 +0000 (03:27 +0900)] 
udevadm: allow to override the default log level by environment variable

Previously, there was no way to override the log level for test and
test-builtin commands. Let's re-parse environment after setting the log
level to debug. Then, we can control the log level through environment
variable.

5 months agoMerge pull request #30796 from mrc0mmand/journalctl-namespaces
Yu Watanabe [Fri, 5 Jan 2024 23:30:31 +0000 (08:30 +0900)] 
Merge pull request #30796 from mrc0mmand/journalctl-namespaces

journalctl: provide shell completion for --namespace=

5 months agodev-setup: rework make_inaccessible_nodes() around openat() and friends
Lennart Poettering [Fri, 5 Jan 2024 15:35:35 +0000 (16:35 +0100)] 
dev-setup: rework make_inaccessible_nodes() around openat() and friends

Let's operate on fds rather than paths. Make some tweaks to the logic on
top:

1. Mark the resulting dir as read-only after we are done.
2. Use the new inode_type_to_string() calls to determine the inode
   names.
3. If an inode already exists, try to adjust the access mode, just in
   case.
4. Use FOREACH_ARRAY()

5 months agoMerge pull request #30775 from yuwata/network-nexthop-is-ready
Yu Watanabe [Fri, 5 Jan 2024 23:27:35 +0000 (08:27 +0900)] 
Merge pull request #30775 from yuwata/network-nexthop-is-ready

network: introduce nexthop_is_ready() helper function and use it

5 months agoparse-helpers: allow port 0 for socket bind items
networkException [Thu, 4 Jan 2024 17:45:25 +0000 (18:45 +0100)] 
parse-helpers: allow port 0 for socket bind items

This patch adds a new parameter to parse_ip_port_range, giving callers
the option to allow ranges to have their min be 0 instead of 1.

This is then used by parse_ip_ports_token, intern used by
parse_socket_bind_item to allow port 0 when restricting bind system
calls with SocketBindDeny / SocketBindAllow.

With this, users running server software written using the golang
standard library will be able to effectively sandbox their software,
albeit with a small loss in security protections by allowing the
process to bind on a random port in the
/proc/sys/net/ipv4/ip_local_port_range.

5 months agoMerge pull request #30791 from poettering/nspawn-restrict-run-host
Lennart Poettering [Fri, 5 Jan 2024 21:37:29 +0000 (22:37 +0100)] 
Merge pull request #30791 from poettering/nspawn-restrict-run-host

nspawn: make some files we expose in /run/host/ in nspawn read-only via access mode

5 months agonspawn: add new common make_run_host() helper
Lennart Poettering [Fri, 5 Jan 2024 15:40:45 +0000 (16:40 +0100)] 
nspawn: add new common make_run_host() helper

This new helper creates the /run/host/ top-level dir inside the
container.

5 months agosocket-util: add more careful parsers for AF_VSOCK cid/port 30794/head
Lennart Poettering [Fri, 5 Jan 2024 15:32:59 +0000 (16:32 +0100)] 
socket-util: add more careful parsers for AF_VSOCK cid/port

Let's handle the magic CIDs, and filter out invalid ports.

5 months agomissing: add a bunch of vsock related defines
Lennart Poettering [Fri, 5 Jan 2024 21:29:15 +0000 (22:29 +0100)] 
missing: add a bunch of vsock related defines

5 months agoMerge pull request #30790 from poettering/null-creds-allow-with-tpm
Yu Watanabe [Fri, 5 Jan 2024 19:26:38 +0000 (04:26 +0900)] 
Merge pull request #30790 from poettering/null-creds-allow-with-tpm

creds: allow using NULL encryption if explicitly requested even if TPM is available, and add a comprehensive credential encryption/decrpytion test

5 months agoshell-completion: provide completion for journalctl --namespace= 30796/head
Frantisek Sumsal [Fri, 5 Jan 2024 17:58:43 +0000 (18:58 +0100)] 
shell-completion: provide completion for journalctl --namespace=

Resolves: #30381

5 months agoshell-completion: fix mixed indent
Frantisek Sumsal [Fri, 5 Jan 2024 17:58:26 +0000 (18:58 +0100)] 
shell-completion: fix mixed indent

5 months agojournalctl: implement --list-namespaces
Frantisek Sumsal [Fri, 5 Jan 2024 17:06:08 +0000 (18:06 +0100)] 
journalctl: implement --list-namespaces

Apart from being useful on its own, this will be used in the following
commit for shell completions.

5 months agonspawn: set read-only access mode on two /run/host/ files 30791/head
Lennart Poettering [Fri, 5 Jan 2024 15:42:46 +0000 (16:42 +0100)] 
nspawn: set read-only access mode on two /run/host/ files

The diectory is mounted read-only anyway, hence this doesn't do much,
but let's lock this down on every level we can.

5 months agofileio: add new flag WRITE_STRING_FILE_MODE_0444
Lennart Poettering [Fri, 5 Jan 2024 15:31:55 +0000 (16:31 +0100)] 
fileio: add new flag WRITE_STRING_FILE_MODE_0444

With this write_string_file() will create the file with 0444 access mode
(i.e. read-only).

5 months agotest: add credential encryption/decryption test 30790/head
Lennart Poettering [Tue, 21 Nov 2023 13:17:31 +0000 (14:17 +0100)] 
test: add credential encryption/decryption test

5 months agocreds-util: optionally, allow NULL credentials even with TPM
Lennart Poettering [Mon, 20 Nov 2023 17:00:35 +0000 (18:00 +0100)] 
creds-util: optionally, allow NULL credentials even with TPM

5 months agoMerge pull request #30754 from poettering/iovecification
Lennart Poettering [Fri, 5 Jan 2024 13:45:15 +0000 (14:45 +0100)] 
Merge pull request #30754 from poettering/iovecification

tpm2-util: convert various things over to struct iovec rather that data ptr + size

5 months agoMerge pull request #30784 from poettering/json-dispatch-enum
Lennart Poettering [Fri, 5 Jan 2024 13:44:59 +0000 (14:44 +0100)] 
Merge pull request #30784 from poettering/json-dispatch-enum

json: add macro for automatically defining a dispatcher for an enum

5 months agoMerge pull request #30785 from poettering/json-allow-extensions
Lennart Poettering [Fri, 5 Jan 2024 13:44:50 +0000 (14:44 +0100)] 
Merge pull request #30785 from poettering/json-allow-extensions

json: add flag for allowing extension of json objects when dispatching, without otherwise being permissive

5 months agotest: wait for verbose-success.service finished
Yu Watanabe [Fri, 5 Jan 2024 09:53:56 +0000 (18:53 +0900)] 
test: wait for verbose-success.service finished

Otherwise, the command 'echo' may not be invoked yet.

Follow-up for 25aa35d465cf4725bc3ebd2a919e7f39ecafb920.

5 months agotree-wide: use JSON_ALLOW_EXTENSIONS when disptching at various places 30785/head
Lennart Poettering [Fri, 5 Jan 2024 11:39:28 +0000 (12:39 +0100)] 
tree-wide: use JSON_ALLOW_EXTENSIONS when disptching at various places

If we want to allow method replies to be extended without this breaking
compat, then we should set this flag. Do so at various method call
replies hence.

Also do it when parsing user/group records, which are expressly
documented to be extensible, as well as the hibernate JSON record.

5 months agojson: add new dispatch flag JSON_ALLOW_EXTENSIONS
Lennart Poettering [Mon, 4 Dec 2023 17:10:02 +0000 (18:10 +0100)] 
json: add new dispatch flag JSON_ALLOW_EXTENSIONS

This is a subset of JSON_PERMISSIVE focussed on allowing parsing of
varlink replies that get extended, i.e. gain new fields, without
allowing more than that (i.e. without allowing missing fields, or bad
field types or such).

5 months agoMerge pull request #29692 from H5117/fix_pkcs11_uri
Lennart Poettering [Fri, 5 Jan 2024 11:14:26 +0000 (12:14 +0100)] 
Merge pull request #29692 from H5117/fix_pkcs11_uri

cryptenroll: change class in provided PKCS#11 URI if necessary

5 months agooomd: make use of new JSON_DISPATCH_ENUM_DEFINE() macro 30784/head
Lennart Poettering [Fri, 5 Jan 2024 10:50:47 +0000 (11:50 +0100)] 
oomd: make use of new JSON_DISPATCH_ENUM_DEFINE() macro

5 months agouser-record: port over to JSON_DISPATCH_ENUM_DEFINE()
Lennart Poettering [Fri, 5 Jan 2024 11:06:52 +0000 (12:06 +0100)] 
user-record: port over to JSON_DISPATCH_ENUM_DEFINE()

5 months agotest: add unit test for JSON_DISPATCH_ENUM_DEFINE()
Lennart Poettering [Fri, 5 Jan 2024 11:00:35 +0000 (12:00 +0100)] 
test: add unit test for JSON_DISPATCH_ENUM_DEFINE()

5 months agojson: add macro for automatically defining a dispatcher for an enum
Lennart Poettering [Mon, 4 Dec 2023 17:12:10 +0000 (18:12 +0100)] 
json: add macro for automatically defining a dispatcher for an enum

5 months agotpm2-util: more iovec'ification 30754/head
Lennart Poettering [Mon, 20 Nov 2023 16:18:43 +0000 (17:18 +0100)] 
tpm2-util: more iovec'ification

Let's move more code to using struct iovec for passing around binary
chunks of data.

No real changes in behaviour, just refactoring.

5 months agotest: add unit tests for the new iovec helpers
Lennart Poettering [Fri, 5 Jan 2024 10:34:34 +0000 (11:34 +0100)] 
test: add unit tests for the new iovec helpers

5 months agoiovec-util: add CONST_IOVEC_MAKE_STRING()
Lennart Poettering [Tue, 21 Nov 2023 13:16:44 +0000 (14:16 +0100)] 
iovec-util: add CONST_IOVEC_MAKE_STRING()

5 months agoiovec-util: add new iovec_memdup() helper
Lennart Poettering [Tue, 21 Nov 2023 12:12:08 +0000 (13:12 +0100)] 
iovec-util: add new iovec_memdup() helper

5 months agoiovec-util: add new iovec_memcmp() helper
Lennart Poettering [Tue, 21 Nov 2023 12:11:45 +0000 (13:11 +0100)] 
iovec-util: add new iovec_memcmp() helper

5 months agoiovec-util: add iovec_is_valid() helper
Lennart Poettering [Mon, 20 Nov 2023 16:06:06 +0000 (17:06 +0100)] 
iovec-util: add iovec_is_valid() helper

5 months agoiovec-util: rework IOVEC_MAKE_STRING() to work with compound initialized input
Lennart Poettering [Mon, 20 Nov 2023 16:04:46 +0000 (17:04 +0100)] 
iovec-util: rework IOVEC_MAKE_STRING() to work with compound initialized input

This avoids the ({}) that IOVEC_MAKE_STRING() so far used and might
cause a memory corruption if the parameter passed in is itself allocated
via a compount initialized array or so.

Also, this makes sure both IOVEC_MAKE_STRING() and IOVEC_MAKE() accept
'const' parameters without this causing a compiler warning.

5 months agojson: add more iovec helpers for serializing/deserializing binary data
Lennart Poettering [Tue, 21 Nov 2023 10:44:16 +0000 (11:44 +0100)] 
json: add more iovec helpers for serializing/deserializing binary data

5 months agoupdate TODO
Lennart Poettering [Fri, 5 Jan 2024 10:09:00 +0000 (11:09 +0100)] 
update TODO

5 months agoMerge pull request #30772 from yuwata/test-network-improvements
Frantisek Sumsal [Fri, 5 Jan 2024 10:09:14 +0000 (11:09 +0100)] 
Merge pull request #30772 from yuwata/test-network-improvements

test-network: add more test cases and several cleanups

5 months agotest: fix typo
Yu Watanabe [Fri, 5 Jan 2024 10:07:37 +0000 (19:07 +0900)] 
test: fix typo

Follow-up for 995bf013a1959d4fb5aed8b135740490888fc196.

5 months agoman: fix typo
Yu Watanabe [Fri, 5 Jan 2024 10:06:06 +0000 (19:06 +0900)] 
man: fix typo

Follow-up for 7d93e4af8088fae7b50eb638c6e297fb8371e307.

5 months agovpick: fix typo
Yu Watanabe [Fri, 5 Jan 2024 10:03:24 +0000 (19:03 +0900)] 
vpick: fix typo

Follow-up for 76511c1bd32a262c76d462919083925c47cbd212.

5 months agologin: noone -> no one
Yu Watanabe [Fri, 5 Jan 2024 10:02:07 +0000 (19:02 +0900)] 
login: noone -> no one

Follow-up for 59afe07c217c73e3c7c19fb06aef2ff7bf609fd2.

5 months agocore/dbus-manager: fix typo
Yu Watanabe [Fri, 5 Jan 2024 10:00:58 +0000 (19:00 +0900)] 
core/dbus-manager: fix typo

Follow-up for 84c01612de805d88875d4d91cfcf73cf10f99447.

5 months agostring-util: fix typo
Yu Watanabe [Fri, 5 Jan 2024 09:59:11 +0000 (18:59 +0900)] 
string-util: fix typo

Follow-up for 63566c6b6ffbb747727db4d6f78c28547430d54f.

5 months agoTODO: fix typo
Yu Watanabe [Fri, 5 Jan 2024 09:57:49 +0000 (18:57 +0900)] 
TODO: fix typo

Follow-up for 97c493f2140b207ace89e9e028949ceb254fbfc6.

5 months agoMerge pull request #30728 from polarina/noda
Lennart Poettering [Fri, 5 Jan 2024 10:04:11 +0000 (11:04 +0100)] 
Merge pull request #30728 from polarina/noda

Assign noDA attribute to TPM2 objects not dependant on a PIN

5 months agocore: Add %D specifier for $XDG_DATA_HOME
Adrian Vovk [Thu, 28 Dec 2023 23:12:06 +0000 (18:12 -0500)] 
core: Add %D specifier for $XDG_DATA_HOME

We already have specifiers that resolve to $XDG_STATE_HOME, and
$XDG_CONFIG_HOME. $XDG_DATA_HOME is in a similar vein.

It allows units belonging to the user service manager to correctly look
into ~/.local/share. I imagine this would be most useful inside of
condition checks (i.e. only run a service on session startup if some
data is not found in ~/.local/share) or in the inotify monitoring of a
.path unit

5 months agocryptenroll: change class in provided PKCS#11 URI if necessary 29692/head
Vladimir Stoiakin [Tue, 24 Oct 2023 16:00:43 +0000 (19:00 +0300)] 
cryptenroll: change class in provided PKCS#11 URI if necessary

cryptenroll accepts only PKCS#11 URIs that match both a certificate and a private key in a token.
This patch allows users to provide a PKCS#11 URI that points to a certificate only, and makes possible to use output of some PKCS#11 tools directly.
Internally the patch changes 'type=cert' in the provided PKCS#11 URI to 'type=private' before storing in a LUKS2 header.

Fixes: #23479
5 months agonetwork: do not make the implied default have the first priority
Yu Watanabe [Thu, 4 Jan 2024 16:10:56 +0000 (01:10 +0900)] 
network: do not make the implied default have the first priority

Follow-up for b732606950f8726c0280080c7d055a714c2888f5 and
6706ce2fd2a13df0ae5e469b72d688eaf643dac4.

If Network.ignore_carrier_loss_set flag is set, then the timeout value
is always used, hence the logic implemented by
b732606950f8726c0280080c7d055a714c2888f5 never worked.

5 months agocore/cgroup: use designated initializer more, make dup source const
Mike Yuan [Thu, 4 Jan 2024 12:26:00 +0000 (20:26 +0800)] 
core/cgroup: use designated initializer more, make dup source const

5 months agoMerge pull request #30731 from poettering/logind-user-early
Lennart Poettering [Fri, 5 Jan 2024 09:01:30 +0000 (10:01 +0100)] 
Merge pull request #30731 from poettering/logind-user-early

logind: rework the special casing we give root's sessions

5 months agoUse .d path for PCRLOCK_KERNEL_*_PATH
Alberto Planas [Thu, 4 Jan 2024 14:12:22 +0000 (15:12 +0100)] 
Use .d path for PCRLOCK_KERNEL_*_PATH

Fix the path for the generated.pcrlock files for the cmdline and initrd
cases.  Without it the tool complains with:

    Failed to parse component file /var/lib/pcrlock.d/720-kernel-initrd.pcrlock, ignoring: Is a directory

Signed-off-by: Alberto Planas <aplanas@suse.com>
5 months agoMerge pull request #30753 from aafeijoo-suse/special-refactor
Lennart Poettering [Fri, 5 Jan 2024 09:00:03 +0000 (10:00 +0100)] 
Merge pull request #30753 from aafeijoo-suse/special-refactor

tree-wide: use defines from special.h in some missing places

5 months agoMerge pull request #30769 from AdrianVovk/statx-timestamp
Lennart Poettering [Fri, 5 Jan 2024 08:59:40 +0000 (09:59 +0100)] 
Merge pull request #30769 from AdrianVovk/statx-timestamp

stat-util: Add statx version of timespec_load

5 months agoMerge pull request #30743 from bluca/coverity
Luca Boccassi [Fri, 5 Jan 2024 08:27:21 +0000 (09:27 +0100)] 
Merge pull request #30743 from bluca/coverity

Assorted coverity fixes

5 months agoMerge pull request #30774 from mrc0mmand/test-tweaks
Luca Boccassi [Fri, 5 Jan 2024 08:26:42 +0000 (09:26 +0100)] 
Merge pull request #30774 from mrc0mmand/test-tweaks

test: install correct kpartx udev rules (again) and dump cores of sanitized binaries

5 months agoMerge pull request #30759 from mrc0mmand/resolved-followup
Luca Boccassi [Fri, 5 Jan 2024 08:26:19 +0000 (09:26 +0100)] 
Merge pull request #30759 from mrc0mmand/resolved-followup

resolve: initialize `r` during OOM

5 months agojournalctl: add --exclude-identifier option
Sergei Zhmylev [Mon, 11 Dec 2023 19:23:47 +0000 (22:23 +0300)] 
journalctl: add --exclude-identifier option

5 months agocreds-util: automatically append NUL byte to decrypted creds
Lennart Poettering [Tue, 21 Nov 2023 08:59:46 +0000 (09:59 +0100)] 
creds-util: automatically append NUL byte to decrypted creds

Both as safety net and as convenience feature of a string is contained
in the credential

5 months agocreds: rename "tpm2-absent" encryption to "null" encryption
Lennart Poettering [Mon, 20 Nov 2023 15:22:33 +0000 (16:22 +0100)] 
creds: rename "tpm2-absent" encryption to "null" encryption

This is what it is after all: encryption with a NULL key. This is more
descriptive, but also relevant since we want to use this kind of
credentials in a different context soon: for carrying pcrlock data into
a UKI. In that case we don#t want encryption, since the pcrlock data is
intended to help unlocking secrets, hence should not be a secret itself.

This only changes the code labels and the way this is labelled in the
output. We retain compat with the old name.

5 months agofind-esp: adjust parameter indentating to our usual coding style
Lennart Poettering [Mon, 20 Nov 2023 16:42:38 +0000 (17:42 +0100)] 
find-esp: adjust parameter indentating to our usual coding style

5 months agologind: use unlink_and_free() at once more place
Lennart Poettering [Wed, 29 Nov 2023 10:21:21 +0000 (11:21 +0100)] 
logind: use unlink_and_free() at once more place

5 months agojson: drop redundant check
Lennart Poettering [Thu, 4 Jan 2024 14:17:19 +0000 (15:17 +0100)] 
json: drop redundant check

The same check is done exactly one line later, because this is one of
the things that json_variant_is_regular() checks.

As per: https://github.com/systemd/systemd/pull/30578/commits/fa9a6db478e3f0f2753e4633af6d0d4881707c2b#r1441792019

5 months agoMerge pull request #30749 from poettering/tmpfiles-verb-fix
Lennart Poettering [Thu, 4 Jan 2024 21:55:23 +0000 (22:55 +0100)] 
Merge pull request #30749 from poettering/tmpfiles-verb-fix

tmpfiles: correctly apply globbing when cleaning 'x' lines

5 months agoMerge pull request #30758 from YHNdnzj/vpick-not-ptr
Lennart Poettering [Thu, 4 Jan 2024 21:54:41 +0000 (22:54 +0100)] 
Merge pull request #30758 from YHNdnzj/vpick-not-ptr

vpick: trivial follow-up

5 months agonetwork/route: use nexthop_is_ready() 30775/head
Yu Watanabe [Thu, 4 Jan 2024 20:30:43 +0000 (05:30 +0900)] 
network/route: use nexthop_is_ready()

5 months agonetwork/nexthop: wait for requests for group members being processed
Yu Watanabe [Thu, 4 Jan 2024 19:58:37 +0000 (04:58 +0900)] 
network/nexthop: wait for requests for group members being processed

This also split out the check as nexthop_is_ready().

5 months agonetwork/nexthop: refuse id == 0 earlier
Yu Watanabe [Thu, 4 Jan 2024 20:01:05 +0000 (05:01 +0900)] 
network/nexthop: refuse id == 0 earlier

All requested nexthop has a non-zero ID.

5 months agoci: build with -O2 and -Wmaybe-uninitialized 30759/head
Frantisek Sumsal [Thu, 4 Jan 2024 16:51:40 +0000 (17:51 +0100)] 
ci: build with -O2 and -Wmaybe-uninitialized

According to the comment in meson.build this should be a supported
configuration, so let's test it in the CI as well.

5 months agoshared: initialize a couple of values explicitly
Frantisek Sumsal [Thu, 4 Jan 2024 16:50:13 +0000 (17:50 +0100)] 
shared: initialize a couple of values explicitly

As gcc has trouble figuring this itself with -O2 and -Wmaybe-initialized.

5 months agoresolve: initialize `r` during OOM
Frantisek Sumsal [Thu, 4 Jan 2024 15:48:10 +0000 (16:48 +0100)] 
resolve: initialize `r` during OOM

Otherwise we'd use some garbage value in the error path.

../src/resolve/resolved-dns-query.c: In function ‘dns_query_accept’:
../src/resolve/resolved-dns-query.c:944:27: error: ‘r’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  944 |         q->answer_errno = -r;
      |                           ^~
cc1: all warnings being treated as errors

Follow-up for 9ca133e97a0.

5 months agotest: allow sanitized binaries to dump a core 30774/head
Frantisek Sumsal [Thu, 4 Jan 2024 19:31:32 +0000 (20:31 +0100)] 
test: allow sanitized binaries to dump a core

If a binary built with ASan crashes for a reason unrelated to ASan
stuff, we're left with pretty much nothing, as there is neither an ASan
trace nor a coredump. Let's make this slightly more debug-able by
allowing such binaries to dump a core, but without the huge shadow map
(we should be actually fine by just setting disable_coredump=0, since
use_madv_dontdump defaults to true, but let's play it safe and not
potentially dump a 16+ TB core file).

5 months agotest: install correct kpartx udev rules on Ubuntu
Frantisek Sumsal [Thu, 4 Jan 2024 19:28:37 +0000 (20:28 +0100)] 
test: install correct kpartx udev rules on Ubuntu

Follow-up for 519f0074cf.

5 months agotest-network: add test case about replacing nexthop 30772/head
Yu Watanabe [Tue, 2 Jan 2024 19:40:48 +0000 (04:40 +0900)] 
test-network: add test case about replacing nexthop

5 months agotest-network: merge three tests for neighbor
Yu Watanabe [Tue, 2 Jan 2024 19:40:54 +0000 (04:40 +0900)] 
test-network: merge three tests for neighbor

To speed up tests.

5 months agotest-network: show monotonic timestamp and drop hopstname from logs
Yu Watanabe [Tue, 2 Jan 2024 19:41:01 +0000 (04:41 +0900)] 
test-network: show monotonic timestamp and drop hopstname from logs

5 months agotmpfiles: Use statx_timestamp_load 30769/head
Adrian Vovk [Thu, 4 Jan 2024 17:49:34 +0000 (12:49 -0500)] 
tmpfiles: Use statx_timestamp_load

This is a new utility function recently added. Let's use it.

5 months agostat-util: Add statx version of timespec_load
Adrian Vovk [Thu, 4 Jan 2024 17:48:39 +0000 (12:48 -0500)] 
stat-util: Add statx version of timespec_load

statx_timestamp is, for all intents and purposes, the same as a struct
timespec. So, we can trivially convert it and call timespec_load on it.

This commit adds helper functions that do just that.