Yu Watanabe [Sun, 14 Jan 2024 04:49:30 +0000 (13:49 +0900)]
network/route-nexthop: introduce route_nexthops_copy()
This also introduce an extra argument for route_dup(), but it is
currently unused, will be used later.
No functional change, just preparation for later commits.
Yu Watanabe [Sat, 13 Jan 2024 04:49:24 +0000 (13:49 +0900)]
network/route-nexthop: use RTA_MULTIPATH when weight is not zero
As we have no way to specify the weight of gateway without using
RTA_MULTIPATH.
Alberto Planas [Thu, 18 Jan 2024 14:38:30 +0000 (15:38 +0100)]
Measure empty PK and KEK EFI vars
The OVMF UEFI firmware is measuring PK and KEK when secure boot is
disabled, and those variables are absent. This can be checked via the
event log to see that there are extensions for PCR 7 associated with PK
and KEK events of type EV_EFI_VARIABLE_DRIVER_CONFIG.
When running the "lock-secureboot-policy" verb, pcrlock complains that
those variables are not found and refuse to generate the
240-secureboot-policy.pcrlock.d/generated.pcrlock file.
The "TCG PC Client Platform Firmware Profile Specification Version 1.05
Revision 23"[1] from May 7, 2021, in section "3.3.4.8 PCR[7] - Secure
Boot Policy Measurements", point 10.b:
If reading a UEFI variable returns UEFI_NOT_FOUND, platform firmware
SHALL measure the absence of the variable. The
UEFI_VARIABLE_DATA.VariableDataLength field MUST be set to zero and
UEFI_VARIABLE_DATA.VariableData field will have a size of zero.
This patch mark those variables to be marked as "synthesize empty",
generating the correct hash for those variables.
Signed-off-by: Alberto Planas <aplanas@suse.com>
Nick Cao [Wed, 17 Jan 2024 21:28:15 +0000 (16:28 -0500)]
network: Add L3MasterDevice= into routing policy
Luca Boccassi [Thu, 18 Jan 2024 22:45:24 +0000 (22:45 +0000)]
Merge pull request #30988 from bluca/dbus_docs
A couple of clarification for D-Bus methods
Luca Boccassi [Wed, 17 Jan 2024 17:00:35 +0000 (17:00 +0000)]
man: explicitly say that portable1's Attach/Detach are synchronous
Luca Boccassi [Wed, 17 Jan 2024 16:59:26 +0000 (16:59 +0000)]
man: add more suggestions on how to use StartUnit and JobRemoved
This is not immediately clear for users, so spell out the preferred pattern
clearly in the D-Bus documentation.
Nandakumar Raghavan [Mon, 15 Jan 2024 14:39:35 +0000 (14:39 +0000)]
networkd: Adding DHCPv4 private options to D-BUS
Currently DHCPv4 private options are not exposed in D-BUS.
This change is to include those private options into D-BUS
Lennart Poettering [Thu, 18 Jan 2024 08:16:40 +0000 (09:16 +0100)]
Merge pull request #30973 from mrc0mmand/gcc14
Reorder arguments for calloc()-like functions, part #2
Lennart Poettering [Mon, 4 Dec 2023 17:15:41 +0000 (18:15 +0100)]
dissect-image: introduce new get_common_dissect_directory() helper
So far, if some component mounts a DDI in some local mount namespace we
created a temporary mountpoint in /tmp/ for that. Let's instead use the
same directory inode in /run/ instead. This is safe, since if everything
runs in a local mount namespace (with propagation on /run/ off) then
they shouldn't fight for the inode. And it relieves us from having to
clean up the directory after use. Morever, it allows us to run without
/tmp/ mounted.
This only moves dissect-image.c and the dissec tool over. More stuff is
moved over later.
Luca Boccassi [Thu, 18 Jan 2024 00:01:09 +0000 (00:01 +0000)]
Merge pull request #30990 from poettering/more-mime
register mime types for some of our data files according to the shared mime spec
Lennart Poettering [Wed, 17 Jan 2024 22:41:14 +0000 (23:41 +0100)]
man: don't suggest using pam_unix.so's use_authtok switch
Our dumbed down example PAM stacks do not contain cracklib/pwq modules,
hence using use_authtok on the pam_unix.so password change stack won't
work, because it has the effect that pam_unix.so never asks for a
password on its own, expecting the cracklib/pwq modules to have
queried/validated them beforehand.
I noticed this issue because of #30969: Debian's PAM setup suffers by
the same issue – even though they don't actually use our suggested PAM
fragments at all.
See: #30969
Lennart Poettering [Mon, 15 Jan 2024 14:01:24 +0000 (15:01 +0100)]
mime: also add magic-based mime type rules for our other binary files
No immediate usecase, it's just nice that if you browser these files
with a graphical file manager you see them recognized as what they are.
Lennart Poettering [Mon, 15 Jan 2024 12:44:39 +0000 (13:44 +0100)]
mime: expose a mime type for encrypted credentials
Let's make things nice for desktops, and provide a mime type for
credential files.
This uses the 128bit header identifier that our credential files start
with. However, the files are always base64 encoded, hence we have to
match the base64 string, hence add a small test case that generates them
properly for us, and truncates them at the right place (since 128 is not
evently divisable by 6).
Lennart Poettering [Wed, 17 Jan 2024 15:31:16 +0000 (16:31 +0100)]
vmspawn: include qemu cmdline in debug output
It's just so useful for debugging to know what is going to be executed.
Lennart Poettering [Wed, 17 Jan 2024 18:08:12 +0000 (19:08 +0100)]
Merge pull request #30980 from poettering/varlink-call-full
varlink: some tweaks and fixes
Luca Boccassi [Wed, 17 Jan 2024 16:20:35 +0000 (16:20 +0000)]
Merge pull request #30661 from rpigott/resolved-https-record
resolved: support RFC 9460 SVCB and HTTPS records
Andres Beltran [Tue, 21 Nov 2023 22:29:14 +0000 (22:29 +0000)]
Restart the DHCPv4 client when max REQUEST attempts is reached
Luca Boccassi [Wed, 17 Jan 2024 14:55:05 +0000 (14:55 +0000)]
user-util: remove dead code
The branch explicitly checks that all of these ret_ variables are NULL,
so they will never be used.
Follow-up for
83e9b584dba1352493d8d2337bfe20d923d5163b
CID#
1533239
CID#
1533240
CID#
1533241
Mike Yuan [Wed, 17 Jan 2024 13:35:47 +0000 (21:35 +0800)]
run: strjoina is used, not sprintf
Follow-up for
43ead5e3d611e7d3a2e723f5a3cdbf1f8686cea0
Mike Yuan [Wed, 17 Jan 2024 11:52:40 +0000 (19:52 +0800)]
hibernate-util: log that we actually read /sys/power/resume* rather than cmdline
/sys/power/resume is always populated by the initrd, while
/sys/power/resume_offset might have been populated by
the kernel itself. Therefore, if the user is using an initrd
that doesn't include resume hook, the hibernation would fail,
which is expected. However, it was hard to track down the real
problem, since the previous log message suggested that resume=
is not set through kernel cmdline.
Lennart Poettering [Wed, 17 Jan 2024 10:09:05 +0000 (11:09 +0100)]
varlink: introduce varlink_call_and_log() which calls and then logs an error
As it turns out we do this in a similar way at various times (and
sometimes incorrectly), hence add a common implementation to share the
code and fix the incorrect behaviour.
Lennart Poettering [Wed, 17 Jan 2024 09:25:17 +0000 (10:25 +0100)]
varlink: drop "ret_flags" parameter from varlink_call()
The parameter returns the flags field of the reply message. This is only
relevant in very few cases, hence drop it from the call, but keep it in
a more generic varlink_call_full() call for those who need it.
Do something similar for varlink_callb().
Lennart Poettering [Wed, 17 Jan 2024 09:57:56 +0000 (10:57 +0100)]
varlink: if varlink_call() is called with ret_error_id=NULL propagate error via return value
It's OK if callers don't want to know the varlink error string. But in
that case return the fact the call failed via the return value, as a
negative errno as usual, to make sure it's not accidentally ignored.
Similar for varlink_observe()
Lennart Poettering [Wed, 17 Jan 2024 09:56:25 +0000 (10:56 +0100)]
varlink: in varlink_observe() correctly collect error parameters
In varlink errors can have parameters (and they regularly do, for
example the io.systemd.System error we generate carries the errno in its
parameter), hence it's essential that varlink_oberserve collects that
properly and returns it too.
Lennart Poettering [Tue, 19 Dec 2023 14:01:36 +0000 (15:01 +0100)]
varlink: add helper that turns varlink errors back to errnos, client-side
Mike Yuan [Wed, 17 Jan 2024 04:09:11 +0000 (12:09 +0800)]
logind-action: also check .target unit state when selecting sleep action
Lennart Poettering [Wed, 17 Jan 2024 12:36:47 +0000 (13:36 +0100)]
Merge pull request #30971 from ddstreet/tpm2_key_conversion
Fix tpm unsealing when using RSA public key signatures
Frantisek Sumsal [Wed, 17 Jan 2024 12:11:14 +0000 (13:11 +0100)]
macro: terminate the temporary VA_ARGS_FOREACH() array with a sentinel
So gcc-14 doesn't complain we're out of bounds on the last iteration:
[2092/2414] Compiling C object test-macro.p/src_test_test-macro.c.o
In file included from ../src/basic/list.h:209,
from ../src/basic/log.h:10,
from ../src/test/test-macro.c:5:
../src/test/test-macro.c: In function ‘test_FOREACH_VA_ARGS’:
../src/basic/macro.h:395:90: warning: array subscript 1 is outside array bounds of ‘uint8_t[1]’ {aka ‘unsigned char[1]’} [-Warray-bounds=]
395 | ((long)(_current_ - _entries_) < (long)ELEMENTSOF(_entries_)) && ({ entry = *_current_; true; }); \
../src/basic/macro.h:392:9: note: in expansion of macro ‘_VA_ARGS_FOREACH’
392 | _VA_ARGS_FOREACH(entry, UNIQ_T(_entries_, UNIQ), UNIQ_T(_current_, UNIQ), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~
../src/test/test-macro.c:322:9: note: in expansion of macro ‘VA_ARGS_FOREACH’
322 | VA_ARGS_FOREACH(u8, 0) {
| ^~~~~~~~~~~~~~~
../src/fundamental/macro-fundamental.h:163:37: note: at offset 1 into object ‘__unique_prefix__entries_181’ of size 1
163 | #define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
| ^~~~~~~~~~~~~~~~
../src/basic/macro.h:394:28: note: in definition of macro ‘_VA_ARGS_FOREACH’
394 | for (typeof(entry) _entries_[] = { __VA_ARGS__ }, *_current_ = _entries_; \
| ^~~~~~~~~
../src/fundamental/macro-fundamental.h:109:27: note: in expansion of macro ‘XCONCATENATE’
109 | #define CONCATENATE(x, y) XCONCATENATE(x, y)
| ^~~~~~~~~~~~
../src/fundamental/macro-fundamental.h:163:25: note: in expansion of macro ‘CONCATENATE’
163 | #define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
| ^~~~~~~~~~~
../src/basic/macro.h:392:33: note: in expansion of macro ‘UNIQ_T’
392 | _VA_ARGS_FOREACH(entry, UNIQ_T(_entries_, UNIQ), UNIQ_T(_current_, UNIQ), ##__VA_ARGS__)
| ^~~~~~
../src/test/test-macro.c:322:9: note: in expansion of macro ‘VA_ARGS_FOREACH’
322 | VA_ARGS_FOREACH(u8, 0) {
| ^~~~~~~~~~~~~~~
Lennart Poettering [Wed, 17 Jan 2024 12:13:30 +0000 (13:13 +0100)]
Merge pull request #30974 from poettering/strv-extend-many
strv: add new strv_extend_many() helper
Lennart Poettering [Wed, 17 Jan 2024 08:49:17 +0000 (09:49 +0100)]
ssh-generator: correct log level of one function
add_export_unix_socket() generally logs about errors, but we forgot one
case.
Mike Yuan [Wed, 17 Jan 2024 09:20:29 +0000 (17:20 +0800)]
core/unit: check for correct function in vtable
Prompted by https://github.com/systemd/systemd/pull/30974/commits/
61e44e01325eca50e88fc9cd400ee340081e9134
Luca Boccassi [Wed, 17 Jan 2024 11:46:45 +0000 (11:46 +0000)]
Merge pull request #30972 from mrc0mmand/ci-unit-tests-ukify
ci: install python3-pytest for ukify tests
Frantisek Sumsal [Tue, 16 Jan 2024 21:25:04 +0000 (22:25 +0100)]
meson: disable -Wnonnull-compare
This gets enabled by default in gcc-14 and complains everywhere where we
use assert() on an expression that is always true (i.e. using
`int x[static 2]` in function declaration, etc.):
[153/2414] Compiling C object src/basic/libbasic.a.p/fs-util.c.o
In file included from ../src/basic/macro.h:13,
from ../src/basic/alloc-util.h:10,
from ../src/basic/fs-util.c:11:
../src/basic/fd-util.h: In function ‘format_proc_fd_path’:
../src/fundamental/macro-fundamental.h:74:41: warning: ‘nonnull’ argument ‘buf’ compared to NULL [-Wnonnull-compare]
74 | #define _unlikely_(x) (__builtin_expect(!!(x), 0))
| ^~~~~
../src/basic/macro.h:150:21: note: in expansion of macro ‘_unlikely_’
150 | if (_unlikely_(!(expr))) \
| ^~~~~~~~~~
../src/basic/macro.h:167:22: note: in expansion of macro ‘assert_message_se’
167 | #define assert(expr) assert_message_se(expr, #expr)
| ^~~~~~~~~~~~~~~~~
../src/basic/fd-util.h:129:9: note: in expansion of macro ‘assert’
129 | assert(buf);
| ^~~~~~
Disabling this selectively only for asserts is a bit painful, since the
option is not available in all compilers, and it'd need to be handled in
the EFI stuff as well.
Yu Watanabe [Wed, 17 Jan 2024 02:57:21 +0000 (11:57 +0900)]
sd-netlink: fix rtnl_resolve_link_alternative_name()
Fixes a bug introduced by
afdf6c3b6040ef43b05428b834f0f302c8ce9a1b.
Lennart Poettering [Tue, 16 Jan 2024 22:24:04 +0000 (23:24 +0100)]
exec-credential: strv_extend() handles NULL strings gracefully
Lennart Poettering [Tue, 16 Jan 2024 22:22:43 +0000 (23:22 +0100)]
tree-wide: propagate the error we got from strv_extend_xyz() to the caller
It's a bit sloppy to return -ENOMEM rather than the actual error we
already returned in the first place (even though it's always going to be
ENOMEM)
Lennart Poettering [Tue, 16 Jan 2024 22:16:40 +0000 (23:16 +0100)]
dbus-unit: don't eat up error codes needlessly
Lennart Poettering [Tue, 16 Jan 2024 22:15:37 +0000 (23:15 +0100)]
tree-wide: port over various pieces of code to strv_extend_many()
Lennart Poettering [Tue, 16 Jan 2024 21:38:31 +0000 (22:38 +0100)]
strv: add strv_extend_many() helper
This is supposed to be a nicer, faster replacement for the often seen
pattern strv_extend_strv(l, STRV_MAKE(…), false)
Lennart Poettering [Tue, 16 Jan 2024 18:17:12 +0000 (19:17 +0100)]
strv: remove strv_extend_front()
It's entirely identical to strv_push_prepend() hence drop the duplicate
definition.
Lennart Poettering [Tue, 16 Jan 2024 18:15:34 +0000 (19:15 +0100)]
strv: modernize strv_insert()
Let's use memmove() to move the string contents, rather than manual
loops.
Fix the overflow extension.
Prefer reallocarray() over malloc()
Frantisek Sumsal [Tue, 16 Jan 2024 21:42:39 +0000 (22:42 +0100)]
Reorder arguments for calloc()-like functions, part #2
To appease gcc-14's -Wcalloc-transposed-args check.
Follow-up for
2a9ab0974bb290bc66dc84d909c33d23361b0752.
hfavisado [Wed, 17 Jan 2024 04:20:38 +0000 (13:20 +0900)]
hwdb: Correct display rotation on Chuwi Ubook X N4100 (#24248)
Lennart Poettering [Wed, 17 Jan 2024 08:21:46 +0000 (09:21 +0100)]
Merge pull request #30958 from YHNdnzj/loginctl-list-session-more-info
loginctl: show more info in list-sessions (ListSessionsEx())
Mike Yuan [Tue, 16 Jan 2024 11:38:17 +0000 (19:38 +0800)]
TEST-35-LOGIN: test changes to list-sessions
Mike Yuan [Tue, 16 Jan 2024 10:07:40 +0000 (18:07 +0800)]
loginctl: add --json= and -j, decouple list-* from --output=
--output= is documented to only affect journal output in *-status.
Let's use --json= and -j standard options for list-* instead.
Mike Yuan [Sun, 14 Jan 2024 14:16:32 +0000 (22:16 +0800)]
loginctl: show more info in list-sessions (ListSessionsEx())
At the same time,
8b6c039a1ac73da006bfe9d5735515bba12ef3c4 is reverted, i.e.
session state is removed from the output. It was added to workaround #26744,
and doesn't really make too much sense after the issue is properly fixed.
Mike Yuan [Sun, 14 Jan 2024 13:52:27 +0000 (21:52 +0800)]
logind-dbus: introduce ListSessionsEx() call
As per https://github.com/systemd/systemd/pull/30884#discussion_r1448938737
Mike Yuan [Sun, 14 Jan 2024 13:18:07 +0000 (21:18 +0800)]
man: don't use versioned standard-options
no-pager-255 was added in #29184, which I reviewed and agreed.
However, as #30887 came up, I reconsidered it a bit, and now
I actually think that this should be removed.
We add new tools that refer to these standard options. During
the process, some options are also promoted to be standard ones.
I think a more sane practice is to generally keep old tools in
the loop, rather than overloading the standard-options with versions.
Yu Watanabe [Tue, 16 Jan 2024 22:01:24 +0000 (07:01 +0900)]
Merge pull request #30967 from yuwata/network-can-required-operstate-for-online
network: several cleanups for required operstate for online, and change the default for CAN devices
Luca Boccassi [Tue, 16 Jan 2024 21:23:54 +0000 (21:23 +0000)]
Merge pull request #30962 from poettering/varlink-json-sensitive-rework
varlink/json: rework "sensitive" logic
Luca Boccassi [Tue, 16 Jan 2024 21:17:32 +0000 (21:17 +0000)]
Merge pull request #30955 from yuwata/network-queue-request_detach
network/queue: cleanups for detaching request
Luca Boccassi [Tue, 16 Jan 2024 21:16:09 +0000 (21:16 +0000)]
Merge pull request #30949 from yuwata/network-route-cosmetic-cleanups
network/route: several cosmetic cleanups
Dan Streetman [Tue, 16 Jan 2024 15:39:06 +0000 (10:39 -0500)]
tpm2: If unsealing results in policy hash mismatch when using RSA pubkey, possibly retry
The commit
e3acb4d24c68291376b11bea5787112978e2775f changed how we format a
TPM2B_PUBLIC object from an openssl PEM RSA key if it used the TPM-defined
"default" RSA exponent, to instead set the TPM2B_PUBLIC RSA exponent to the
special-case value of 0. This broke backwards compatibility with
previously-sealed data. The previous commit fixed our code to no longer use the
"special case" exponent value of 0, while this commit adds a fallback check for
any sealed data that used the exponent value of 0. Now unsealing should work
for sealed data that used either method (either 0 or the actual value).
Frantisek Sumsal [Tue, 16 Jan 2024 20:47:23 +0000 (21:47 +0100)]
ukify: use datetime.timezone.utc instead of datetime.UTC
For compat with older Python versions, since datetime.UTC is an alias
introduced in Python 3.11.
Frantisek Sumsal [Tue, 16 Jan 2024 20:36:05 +0000 (21:36 +0100)]
ci: install python3-pytest for ukify tests
Dan Streetman [Tue, 16 Jan 2024 18:49:45 +0000 (13:49 -0500)]
test: check TPM2B_PUBLIC "name" during PEM->TPM2B_PUBLIC conversion tests
Check the calculated TPM2B_PUBLIC key "name" to verify our PEM->TPM2B_PUBLIC
function remains consistent with previous code. This is important as the
TPM2B_PUBLIC "name" is used in the Authorize policy and so any change to a key
"name" would break unsealing for previously-sealed objects (see bug #30546).
Note that the tpm2_tpm2b_public_from_openssl_pkey() function results in a
TPM2B_PUBLIC with the same "name" as using the tpm2-tools program
tpm2_loadexternal, at least as of tpm2-tools version 5.6.18, with the test keys
from TEST(tpm2b_public_from_openssl_pkey) in src/test/test-tpm2.
Dan Streetman [Tue, 16 Jan 2024 17:26:45 +0000 (12:26 -0500)]
test: verify PEM->TPM2B_PUBLIC conversion for RSA key with non-default exponent
The tpm2 test currently verifies PEM->TPM2B_PUBLIC conversion for an RSA key
with the default exponent (0x10001); this adds verification for an RSA key with
a non-default exponent.
Dan Streetman [Tue, 16 Jan 2024 15:02:47 +0000 (10:02 -0500)]
tpm2: Do not use RSA exponent special-case default value in PEM->TPM2B_PUBLIC conversion
The openssl default value for an RSA key exponent value is 0x10001, and the TPM
specification defines a exponent value of 0 as representing this value. The
systemd code that converted an RSA PEM public key to a TPM2B_PUBLIC object
previously used the exponent value directly, but commit
e3acb4d24c68291376b11bea5787112978e2775f changed the conversion to use the
special case exponent value of 0 for any RSA key with an exponent value of
0x10001.
Because the entire TPM2B_PUBLIC object is used to calculate its "name", this
difference in exponent value (0x10001 vs 0) introduced a change in the key
"name". Since the Authorize policy uses the key "name" directly in its policy
session hash value, this change resulted in new systemd code being unable to
properly unseal any data (e.g. a LUKS volume) that was previously sealed.
This reverts the code to no longer override an RSA exponent value of 0x10001
with the special case value of 0.
Fixes a bug introduced by commit
e3acb4d24c68291376b11bea5787112978e2775f.
Fixes: #30546
Yu Watanabe [Tue, 16 Jan 2024 16:38:55 +0000 (01:38 +0900)]
test-network: test the default required operational state for CAN devices
Yu Watanabe [Tue, 16 Jan 2024 16:35:34 +0000 (01:35 +0900)]
network: make 'carrier' as the default required operational state for CAN device
As CAN devices do not support IP address, hence the state never goes to
higher than 'carrier'.
Prompted by https://github.com/linux-can/can-utils/issues/68#issuecomment-
1327987724.
Yu Watanabe [Tue, 16 Jan 2024 16:04:18 +0000 (01:04 +0900)]
wait-online: several cleanups for LinkOperationalState
- fix memleak in parser,
- fix missing return in parser on failure,
- drop unnecessary temporary argument in command line argument parser,
- use recently introduced macros and helper functions.
Yu Watanabe [Tue, 16 Jan 2024 16:01:32 +0000 (01:01 +0900)]
network: several cleanups for LinkOperationalState
- introduce link_required_operstate_for_online() helper function,
- use recently introduced macros and helper functions,
- unconditionally serialize the minimum and maximum of required
operational state.
Yu Watanabe [Tue, 16 Jan 2024 15:00:45 +0000 (00:00 +0900)]
network: drop unnecessary temporary variables
Yu Watanabe [Tue, 16 Jan 2024 14:54:39 +0000 (23:54 +0900)]
sd-network: modernize parse_operational_state_range()
- rename 'out' -> 'ret',
- introduce LINK_OPERSTATE_RANGE_INVALID,
- constify LINK_OPERSTATE_RANGE_DEFAULT,
- drop spurious const specifier for allocated string,
- etc,.
Yu Watanabe [Tue, 16 Jan 2024 15:54:34 +0000 (00:54 +0900)]
sd-network: introduce three helper functions for LinkOperationalState
A S Alam [Tue, 16 Jan 2024 14:35:41 +0000 (15:35 +0100)]
po: Translated using Weblate (Punjabi)
Currently translated at 32.1% (73 of 227 strings)
Co-authored-by: A S Alam <aalam@users.noreply.translate.fedoraproject.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pa/
Translation: systemd/main
Ronan Pigott [Sat, 6 Jan 2024 20:29:42 +0000 (13:29 -0700)]
test-resolve: add basic test for SVCB/HTTPS RRs
Ronan Pigott [Fri, 29 Dec 2023 18:30:38 +0000 (11:30 -0700)]
resolvectl: add SVCB and HTTPS json format
Ronan Pigott [Fri, 29 Dec 2023 18:30:18 +0000 (11:30 -0700)]
resolvectl: implement SVCB and HTTPS presentation format
Lennart Poettering [Tue, 16 Jan 2024 17:57:56 +0000 (18:57 +0100)]
Merge pull request #30944 from CodethinkLabs/vmspawn/fix_fedora_issues
vmspawn: fix more issues
Ronan Pigott [Thu, 4 Jan 2024 01:53:28 +0000 (18:53 -0700)]
escape: introduce decescape
This 3-digit decimal escape style is useful when presenting DNS RR
information in zone-file presentation format.
Ronan Pigott [Fri, 29 Dec 2023 18:29:13 +0000 (11:29 -0700)]
resolved: enable RFC9460 SVCB and HTTPS records
Ronan Pigott [Fri, 29 Dec 2023 18:28:08 +0000 (11:28 -0700)]
dns: add svcparam iana enum constants
Lennart Poettering [Tue, 16 Jan 2024 11:06:17 +0000 (12:06 +0100)]
varlink: restore debug output on incoming messages
Now that we can selectively suppress only sensitive fields in JSON
objects we can reenable debug logging for incoming messages, which was
removed in
2e3414660cb0c6a024661638d0b237d88b5a7cbc.
This makes Varlink fully debuggable again: we'll see both incoming and
outgoing messages, only the sensitive fields are suppressed.
See: #30578
Lennart Poettering [Tue, 16 Jan 2024 10:55:54 +0000 (11:55 +0100)]
json: replace JSON_FORMAT_REFUSE_SENSITIVE with JSON_FORMAT_CENSOR_SENSITIVE
Previously, the flag would completely refuse formatting a JSON object if
any field of it was marked sensitive. With this change we'll simply
replace the subobject with the string "<sensitive data>", and show
everything else.
This is tremendously useful when debugging, since it means that we can
again trace varlink calls through the stack: we can show all the message
metadata and just suppress the actually sensitive parameters.
The ability to debug this matters, and we should not hide more
information that we can get away with, to keep things debuggable and
maintainable.
Lennart Poettering [Tue, 16 Jan 2024 10:54:20 +0000 (11:54 +0100)]
json: export json_variant_is_sensitive_recursive()
Let's export this function, so that we can use it elsewhere. Also, while
at it, let's cache the result in a flag. This is only safe if the result
is positive, since we allow the flag to be enabled at any time down thre
tree somewhere, which we need to look at. (We never allow it to be
turned off however)
Lennart Poettering [Tue, 16 Jan 2024 10:27:40 +0000 (11:27 +0100)]
varlink: optionally, mark all incoming message's "parameters" field as sensitive
So far the varlink logic honoured the "sensitive" flag of output
messages. Let's add something similar for input messages. Since we don't
really know incoming messages, the flag simply controls whether the
"parmaeters" field of all incoming messages should be marked as
sensitive.
Then, turn this on in the credentials logic and in homed, since both
deal with credentials.
Yu Watanabe [Sat, 13 Jan 2024 04:16:10 +0000 (13:16 +0900)]
network/route: find/distinguish routes in the same way that the kernel uses
The kernel uses different logics to find or distinguish IPv4 and IPv6 routes.
Let's follow the same way that the kernel uses.
See comments in the code for more details.
Mike Yuan [Tue, 16 Jan 2024 14:47:11 +0000 (22:47 +0800)]
labeler: add bsod, hibernate-resume, nspawn and vmspawn
Lennart Poettering [Tue, 16 Jan 2024 16:12:00 +0000 (17:12 +0100)]
Merge pull request #30960 from poettering/get-user-creds-modernization
user-util: modernize get_user_creds() + get_group_creds()
Mike Yuan [Tue, 16 Jan 2024 13:27:23 +0000 (21:27 +0800)]
logind: allow Sleep() and CanSleep() dbus calls
Follow-up for
cd4dd90b99ac5617431ce4f0ca1e9089197c85fd
Luca Boccassi [Tue, 16 Jan 2024 15:25:08 +0000 (15:25 +0000)]
Merge pull request #30963 from poettering/creds-tweaks
two minor creds-util.c simplifications
Luca Boccassi [Tue, 16 Jan 2024 15:24:22 +0000 (15:24 +0000)]
Merge pull request #30961 from poettering/varlink-bus-polkit-fixes
varlink polkit client fixes
Luca Boccassi [Tue, 16 Jan 2024 15:18:36 +0000 (15:18 +0000)]
Merge pull request #30959 from poettering/varlink-debug-better
varlink tweaks for making debugging easier
Yu Watanabe [Tue, 16 Jan 2024 05:04:50 +0000 (14:04 +0900)]
network/queue: detach request from the queue only when the request is actually queued
No effective functionality is changed in this commit.
Refactoring and preparation for later commits.
Yu Watanabe [Tue, 16 Jan 2024 04:50:23 +0000 (13:50 +0900)]
network/queue: increase the reference counter of the request before processing it
To prevent the request freed in req->process().
This also makes a request that is not requested by a link detached on failure.
Otherwise, the request may periodically processed and failed forever.
Lennart Poettering [Tue, 16 Jan 2024 13:56:25 +0000 (14:56 +0100)]
user-util: honour PREFER_NSS flag in get_group_creds() the same way as we already do in get_user_creds()
let's onour the PREFER_NSS flag also in get_group_creds() the same
way we honour it in get_user_creds().
Simply to remove surprises.
Lennart Poettering [Mon, 15 Jan 2024 16:00:40 +0000 (17:00 +0100)]
user-util: modernize get_user_creds() + get_group_creds()
Let's rename return parameters to ret_xyz, and let's guarantee the usual
rule to initialize all return parameters on success, and not touch any
on failure.
Lennart Poettering [Mon, 15 Jan 2024 14:21:35 +0000 (15:21 +0100)]
creds-util: drop unnecessary include
Follow-up for:
e653a194e490fae7d166f40762c334006d592051
Lennart Poettering [Mon, 15 Jan 2024 16:33:59 +0000 (17:33 +0100)]
creds-util: simplify offset calculation a bit
Don't recalculate the overall offset entirely each time we process
another header. Instead, if we already validated an earlier offset, just
reuse the result, it's readily available in 'p'.
No change in behaviour, just a bit of code simplification.
Lennart Poettering [Tue, 16 Jan 2024 12:27:32 +0000 (13:27 +0100)]
bus-polkit: don't return positive in varlink_verify_polkit_async() just because we already sent an error reply
A positive return value means "access granted", hence if we already
reply to the method call don't accidentally return positive.
Follow-up for:
d04c1a1c8e7c95daa483d8d52d5fc4c25fbc67f2
Lennart Poettering [Tue, 16 Jan 2024 12:27:26 +0000 (13:27 +0100)]
bus-polkit: explicitly cast away return value we ignore
Lennart Poettering [Tue, 16 Jan 2024 11:53:39 +0000 (12:53 +0100)]
bus-polkit: treat various well-known PK errors as denied
Various recognizable errors from
https://www.freedesktop.org/software/polkit/docs/latest/eggdbus-interface-org.freedesktop.PolicyKit1.Authority.html#eggdbus-errordomain-org.freedesktop.PolicyKit1.Error.
should be considered access failures, hence treat them like that.
Lennart Poettering [Tue, 16 Jan 2024 10:01:28 +0000 (11:01 +0100)]
varlink: also honour new env var $SYSTEMD_VARLINK_LISTEN in varlink_server_listen_auto()
varlink_server_listen_auto() is supposed to be the one-stop solution for
turning simple command line tools into IPC services. They aren't easy to
test/debug however, since you have to invoke them through a service
manager.
Let's make this easier: if the SYSTEMD_VARLINK_LISTEN env var is set,
let's listen on the socket specified therein. This makes things easier
to gdb: just run the service from the cmdline.
Lennart Poettering [Tue, 16 Jan 2024 10:00:02 +0000 (11:00 +0100)]
varlink-idl: prefix all varlink IDL debug lines wit "Varlink-IDL:"
Let's improve debuggability of varlink IPC transactions, and separate
out log messages triggered by the IPC info from others, by prefixing
them with a specific prefix.
Luca Boccassi [Tue, 16 Jan 2024 12:39:46 +0000 (12:39 +0000)]
Merge pull request #30953 from yuwata/network-nexthop-silently-removed-by-kernel
network/nexthop: forget nexthops silently removed by kernel
Yu Watanabe [Sat, 13 Jan 2024 06:39:06 +0000 (15:39 +0900)]
network/route: introduce route_get_link() and use it in log_route_debug()
No functional change, just refactoring and preparation for later
commits.
Sam Leonard [Mon, 15 Jan 2024 17:02:35 +0000 (17:02 +0000)]
vmspawn: supply a serial TTY to the kernel by default