Commit Graph
60939 Commits
Author SHA1 Message Date
Jan Janssen 98ac5192d5 boot: Silence driver reconnect errors 2022-11-13 16:15:34 +01:00
Yu Watanabe d6c817358c Merge pull request #25338 from DaanDeMeyer/at-fixes
Followups for #24813
2022-11-13 22:59:40 +09:00
Yu Watanabe b3d98761c8 Merge pull request #25339 from dtardon/vertical-tables
Port more tools to vertical table
2022-11-13 22:39:36 +09:00
David Tardon c62ca82656 localectl: port to vertical table 2022-11-13 20:22:34 +09:00
David Tardon fa09e36423 hostnamectl: port to vertical table 2022-11-13 20:22:34 +09:00
David Tardon 9c1b0927d3 analyze-inspect-elf: port to vertical table 2022-11-13 20:22:34 +09:00
David Tardon 9e1344850f analyze-timespan: port to vertical table 2022-11-13 20:21:54 +09:00
David Tardon 1ba1348182 analyze-timestamp: port to vertical table 2022-11-13 20:21:08 +09:00
David Tardon f607ebcac2 analyze-calendar: port to vertical table 2022-11-13 20:21:03 +09:00
David Tardon 9c7a5ff6cc analyze-calendar: avoid unnecessary abbreviation 2022-11-13 20:19:05 +09:00
Yu Watanabe 87172c3df6 Merge pull request #25360 from poettering/strv-fixes
nulstr fixes
2022-11-13 20:17:10 +09:00
Yu Watanabe 8ce056c171 Merge pull request #25355 from poettering/chase-symlinks-no-symlink
chase_symlinks(): add CHASE_PROHIBIT_SYMLINKS
2022-11-13 20:16:34 +09:00
Yu Watanabe ee0f19cfbe Merge pull request #25349 from poettering/table-header-rework-only
format-table: add TABLE_HEADER cell table
2022-11-13 20:16:09 +09:00
Lennart Poettering b353d5eee9 bootctl,bootspec: make use of CHASE_PROHIBIT_SYMLINKS whenever we access the ESP/XBOOTLDR
Let's make use of the new flag whenever we access the ESP or XBOOTLDR.
The resources we make use of in these partitions can't possibly use
symlinks (because UEFI knows no symlink concept), and they are untrusted
territory, hence under no circumstances we should be tricked into
following symlinks that shouldn't be there in the first place.

Of course, you might argue thta ESP/XBOOTLDR are VFAT and thus don#t
know symlinks. But the thing is, they don#t have to be. Firmware can
support other file systems too, and people can use efifs to gain access
to arbitrary Linux file systems from EFI. Hence, let's better be safe
than sorry.
2022-11-13 17:46:34 +09:00
Lennart Poettering d43e78b643 chase-symlinks: add new flag for prohibiting any following of symlinks
This is useful when operating in the ESP, which is untrusted territory,
and where under no circumstances we should be tricked by symlinks into
doing anything we don't want to.
2022-11-13 17:46:30 +09:00
Lennart Poettering a5a318b664 tests: add tests for various corner cases of nulstr 2022-11-13 17:41:04 +09:00
Lennart Poettering 76078ad850 nulstr-util: fix corner cases of strv_make_nulstr()
Let's change the return semantics of strv_make_nulstr() so that we can
properly distuingish the case where we have a no entries in the nulstr
from the case where we have a single empty string in a nulstr.

Previously we couldn't distuingish those, we'd in both cases return a
size of zero, and a buffer with two NUL bytes.

With this change, we'll still return a buffer with two NULL bytes, but
for the case where no entries are defined we'll return a size of zero,
and where we have two a size of one.

This is a good idea, as it makes sure we can properly handle all corner
cases.

Nowadays the function is used by one place only: ask-password-api.c. The
corner case never mattered there, since it was used to serialize
passwords, and it was known that there was exactly one password, not
less. But let's clean this up. This means the subtraction of the final
NUL byte now happens in ask-password-api.c instead.
2022-11-13 17:40:59 +09:00
Lennart Poettering db645f936f nulstr-util: don't use 'r' for anything but integer return values 2022-11-13 17:39:08 +09:00
Lennart Poettering 1ef9703774 nulstr-util: use memdup_suffix0() where appropriate
if the nulstr is not nul-terminated, we shouldn't use strndup() but
memdup_suffix0(), to not trip up static analyzers which imply we are
duping a string here.
2022-11-13 17:39:08 +09:00
Lennart Poettering eecac5053b nulstr-util: use _cleanup_strv_free_() where appropriate 2022-11-13 17:39:08 +09:00
Lennart Poettering 8ba17a319b nulstr-util: rebreak comments 2022-11-13 17:39:08 +09:00
Lennart Poettering 7f0f540500 nulstr-util: modernize strv_from_nulstr() a bit 2022-11-13 17:39:08 +09:00
Lennart Poettering 08af3cc5a5 strv: move nulstr utilities to nulstr-util.[ch]
Let's move them out of the generic, already very long strv.[ch] module
into the more specific nulst-util.[ch]

No code changes.
2022-11-13 17:39:08 +09:00
Lennart Poettering d3a3a0fae3 format-table: teach table_add_cell_stringf_full() to generate TABLE_FIELD/TABLE_HEADER cells, too 2022-11-13 17:36:22 +09:00
Lennart Poettering 8f6469cbf9 format-table: introduce TABLE_HEADER cell type
This rework the logic for handling the "header" cells a bit. Instead of
special casing the first row in regards to uppercasing/coloring let's
just intrduce a proper cell type TABLE_HEADER which is in most ways
identical to TABLE_STRING except that it defaults to uppercase output
and underlined coloring.

This is mostly refactoring, but I think it makes a ton of sense as it
makes the first row less special and you could in fact insert
TABLE_HEADER (and in fact TABLE_FIELD) cells wherever you like and
something sensible would happen (i.e. a string cell is displayed with
a specific formatting).
2022-11-13 17:36:22 +09:00
Yu Watanabe 1c03f7f4ba ac-power: check battery existence and status
If a battery is not present or its status is not discharging, then
the battery should not be used as a power source.
Let's count batteries currently discharging.

Fixes #25316.
2022-11-13 17:35:27 +09:00
Luca Boccassi 0d217f6349 Merge pull request #25268 from PeterCxy/fido2-preflight
libfido2-util: Perform pre-flight check for credentials in token
2022-11-12 15:51:47 +01:00
Carlo Teubner e48237358f man/systemd-dissect.xml: fix trivial error 2022-11-12 01:41:59 +01:00
Luca Boccassi dcd75079ce Merge pull request #25351 from crrodriguez/Wenum-int-mismatch
Fix gcc 13 -Wenum-int-mismatch warnings
2022-11-12 01:40:57 +01:00
Cristian Rodríguez 9264db1a0a shared|install: Use InstallChangeType consistently
gcc 13 -Wenum-int-mismatch, enabled by default, reminds us enum ! = int
2022-11-12 00:40:16 +00:00
Cristian Rodríguez e14afe31c3 resolve: dns_server_feature_level_*_string type is DnsServerFeatureLevel
gcc 13 -Wenum-int-mismatch reminds us that enum != int
2022-11-12 00:40:16 +00:00
Cristian Rodríguez aa70dd624b journal-remote: code is of type enum MHD_RequestTerminationCode
Fixes gcc 13 -Wenum-int-mismatch which are enabled by default.
2022-11-12 00:40:16 +00:00
MkfsSion 32f57b0986 libfido2-util: Perform pre-flight check for credentials in token
Do not attempt to decrypt using a key slot unless its corresponding
credential is found on an available FIDO2 token. Avoids multiple touches
/ confirmations when unlocking a LUKS2 device with multiple FIDO2 tokens
enrolled.

Partially fixes #19208 (when the libcryptsetup plugin is in use).
2022-11-11 18:51:07 -05:00
MkfsSion 15203f77a9 libfido2-util: Extract error handling logic from fido2_use_hmac_hash_specific_token 2022-11-11 18:51:07 -05:00
MkfsSion 098f72ceee libfido2-util: Commonize FIDO2 basic property settings
These properties are repeatedly set across multiple functions.
2022-11-11 18:51:07 -05:00
Lennart Poettering 7f77b40011 repart: fix build
Follow-up for: 12e2b70f9b
2022-11-11 19:01:59 +01:00
Daan De Meyer 12e2b70f9b nulstr-util: Declare NULSTR_FOREACH() iterator inline 2022-11-11 16:31:32 +01:00
Daan De Meyer 5ea173a91b strv: Make sure strv_make_nulstr() always returns a valid nulstr
strv_make_nulstr() is documented to always return a valid nulstr,
but if the input is `NULL` we return a string terminated with only
a single NUL terminator, so let's fix that and always terminate the
resulting string with two NUL bytes.
2022-11-11 16:31:20 +01:00
Daan De Meyer 0f3c342903 sd-bus: Use goto finish instead of return in bus_add_match_full
Fixes #25340
2022-11-11 15:57:41 +01:00
Cristian Rodríguez 1af427632f resolve: Use only C99 flex arrays (#25335) 2022-11-11 15:22:49 +01:00
Daan De Meyer 46fddd8eb6 Merge pull request #24803 from DaanDeMeyer/repart-copy-deny-list
repart: Don't descend into directories assigned to other partitions
2022-11-11 13:19:58 +01:00
Daan De Meyer cc085ec65f Revert "rm-rf: Add rm_rf_physical_and_close()"
This reverts commit 56e2bceddc.

Doing destructive cleanup operations via unreliable /proc path
lookups is unsafe and should be avoided so let's remove this function.
2022-11-11 10:19:18 +01:00
Daan De Meyer c9a1202ecb test-copy: Stop using rm_rf_physical_and_close
This cleanup function depends on resolving fd's to paths via /proc
which is unreliable so we shouldn't depend on it for destructive
operations. Use regular path based cleanup instead.
2022-11-11 10:19:18 +01:00
Daan De Meyer 7d000133c2 fs-util: Add missing assert to chmod_and_chown_at() 2022-11-11 10:19:18 +01:00
Daan De Meyer c2fc5890e3 chase-symlinks: Drop unnecessary if 2022-11-11 09:52:12 +01:00
Daan De Meyer 8c39e28191 path-util: Drop path_make_relative_cwd()
Function is unused
2022-11-11 09:50:50 +01:00
Daan De Meyer 8b9c56ba3e tmpfile-util: Add missing assert 2022-11-11 09:50:19 +01:00
Yu Watanabe b27c803601 Merge pull request #25328 from poettering/vertical-tables
format-table: add concept of "vertical" table
2022-11-11 15:18:12 +09:00
Luca Boccassi 021397f776 Merge pull request #25325 from yuwata/resolve-cap-per-link-setting-by-global
resolve: provide effective mDNS or LLMNR settings
2022-11-10 23:20:40 +01:00
Lennart Poettering 31a19acf82 timedatectl: port to new 'vertical' table type 2022-11-10 23:11:17 +01:00