1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
Commit Graph

75942 Commits

Author SHA1 Message Date
Yu Watanabe
cdf006973d resolve: fix typo
Follow-up for 67d0ce8843.
2024-09-03 14:00:18 +09:00
Lennart Poettering
7fd18c93d8 resolved: include Varlink error on inconsistent DNS-SD services in introspection data
Let's also rename the error slightly, since what happens here is that a
a valid service RR name is CNAME'd onto an invalid one. That's an
inconsistency on the server side, which we really should report as such.

Follow-up for: b48ab08732
2024-09-03 10:42:14 +09:00
Yu Watanabe
a833dc9b35
Merge pull request #34140 from yuwata/conf-parser-log-message
conf-parser: introduce log_syntax_parse_error() and use it
2024-09-03 08:20:07 +09:00
Adrian Vovk
9b0647358f
Merge pull request #34202 from AdrianVovk/sysupdated-fixups
sysupdated: Bugfixes & improvements
2024-09-02 16:35:02 -04:00
Frantisek Sumsal
bd7a06dc31 test: don't install Python scripts from systemd-test RPM
The original regex didn't cover the `run-unit-tests.py` script that
made the old framework pull in Python into the test image, which in turn
allowed the new TEST-69-SHUTDOWN Python script to get executed in the
old framework's image, causing unexpected fails with latest Python on
Rawhide.
2024-09-02 19:26:57 +01:00
Adrian Vovk
bb36e70e92
sysupdated: Improve logging about jobs
If someone runs `updatectl update`, sysupdate will be running multiple
update jobs at the same time, which can make reasoning about the output
in the journal quite difficult. Especially if things go wrong: the error
messages didn't mention which job failed. Nor was there any link between
job ID and the PID of the worker process logging to the journal. This
is all fixed here!
2024-09-02 11:02:32 -04:00
Adrian Vovk
a841ad2945
sysupdated: Cleanup handling of notifications
Cuts out some `strdup`s, and also avoids a rather weird case of donating
memory to a function. Basically just duplicates the solution I just
implemented for sysupdate's callout handler.
2024-09-02 11:02:31 -04:00
Adrian Vovk
2e03c0befb
sysupdate: Don't ignore callout binary failure
Previously, if the callout binary (i.e. sd-pull, sd-import) failed
gracefully, we'd return its exit status from the event loop and thus
from run_callout(). Of course, exit status is a positive number in the
event of failure. Which means that we completely ignore the callout
binary failing, and instead continue using whatever it managed to
download before failing.

This is bad for obvious reasons, not the least of which is installing
a half-downloaded OS. This also means that we would completely ignore
failed signature checks 😬
2024-09-02 11:02:29 -04:00
Luca Boccassi
1e2d1a7202 portable: ensure PORTABLE_FORCE_ATTACH works even when there is a leftover unit
Force means force, we skip checks with PID1 for existing units, but
then bail out with EEXIST if the files are actually there. Overwrite
everything instead.
2024-09-02 15:33:29 +01:00
Yu Watanabe
6f12cb91bc conf-parser: use log_syntax_parse_error() and friends more
This also makes all conf parsers defined in conf-parser.c return 1
on success, 0 on non-critical error.
Also, use free_and_strdup_warn() where applicable.
2024-09-02 06:17:05 +09:00
Yu Watanabe
3c8dc3a3e0 conf-parser: several cleanups for DEFINE_CONFIG_PARSE_ENUMV() macro
- use GREEDY_REALLOC() and FOREACH_ARRAY(),
- do not set an array with only terminating 'invalid' value.

Note, this macro is only used by parsing NamePolicy= and AlternativeNamesPolicy=
in .link files. and udevd correctly handles both an empty array and an
array with only 'invalid'. Hence, this does not change any behavior.
2024-09-02 06:11:50 +09:00
Yu Watanabe
42efe5be1d tree-wide: drop msg argument for DEFINE_CONFIG_PARSE() macro and friends
This makes the macros use log_syntax_parse_error(), hopefully which provides
more informative log message in general, and reduces binary size.
2024-09-02 05:45:09 +09:00
Yu Watanabe
382886fe11 log: protect errno from log_syntax_invalid_utf8_internal()
Potentially, utf8_escape_invalid() called by
log_syntax_invalid_utf8_internal() may update errno.
2024-09-02 05:45:09 +09:00
Yu Watanabe
1e04eb00f7 log: introduce log_syntax_parse_error()
This provides generic error message for failures in conf parsers.
Currently this is not used, but will be used later.
2024-09-02 05:45:04 +09:00
Yu Watanabe
b043f651c8 test: modernize test-networkd-conf 2024-09-02 05:41:55 +09:00
Yu Watanabe
7094e6d9e4 test: modernize test-conf-parser.c 2024-09-02 05:41:55 +09:00
Yu Watanabe
c33aacdcb4 conf-parser: make config_parse_strv() stricter and optionally drop duplicated entries 2024-09-02 05:41:55 +09:00
Yu Watanabe
8b4ef777fd conf-parser: fix memleak in config_parse_calendar()
Fixes a bug introduced by 0e10c3d872 (#25049).
2024-09-02 05:41:55 +09:00
Yu Watanabe
9afb4aea00 network/route: fix typo
Follow-up for c8dbf9acc1.
2024-09-01 22:03:12 +09:00
Luca Boccassi
a12db1e7c4
Merge pull request #34213 from yuwata/network-route-fix-weight
network/route: fix adjustment of nexthop weight
2024-09-01 11:54:05 +01:00
Yu Watanabe
c8dbf9acc1 network/route: fix adjustment of nexthop weight
Fixes #34167.
2024-09-01 11:54:32 +09:00
Yu Watanabe
db8dc7c1dd network/route: also update source, status, and so on EEXIST
Otherwise, an existing route may be labeled as foreign even after we
reconfigure it.
2024-09-01 11:54:32 +09:00
Yu Watanabe
0074a7d8c0 network/route: also show weight of gateway in debugging logs 2024-09-01 11:54:32 +09:00
Mike Yuan
9517c81747 basic/raw-clone: refuse CLONE_PIDFD too 2024-09-01 10:44:39 +09:00
Zbigniew Jędrzejewski-Szmek
229607bca8 docs/UIDS-GIDS: drop obsolete comment about Fedora
https://fedoraproject.org/wiki/Changes/RenameNobodyUser, 2018:
> Use "nobody:nobody" as the names for the kernel overflow UID:GID pair, and
> retire the old "nfsnobody" name and the old "nobody:nobody" pair with 99:99
> numbers.
2024-08-31 13:36:09 +02:00
Yu Watanabe
7876f3d63a test-network: use the same MTU bytes for veth interfaces
Hopefully fixes #34204.
2024-08-31 11:24:56 +01:00
Yu Watanabe
94c80f3ef5 labeler: set network label when tests for networkd or friends are updated 2024-08-31 11:54:13 +02:00
Yu Watanabe
6434d0bbf7
Merge pull request #34198 from AdrianVovk/updatectl-bugfixes
updatectl: Bugfixes
2024-08-31 15:20:15 +09:00
Christoph Anton Mitterer
3e98472223 man: fix typos
Closes #34199.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2024-08-31 13:59:02 +09:00
Adrian Vovk
5f9dd9c64d
progress-bar: Add unbuffered variant
The progress_bar functions do their own buffering: they reconfigure
stderr, then print, then flush and disable buffering on their own. In
situations where multiple progress bars are being drawn at a time (for
example, in updatectl), it's even more efficient to hoist the buffering
and flushing to the call site, and avoid drawing each progress bar
individually.

To that end, new _unbuffered variants of the progress_bar functions. And
we use them in updatectl.
2024-08-30 22:50:24 -04:00
Adrian Vovk
ca7490c5ad
updatectl: Improve behavior of progress logging
This applies a couple of aesthetic changes to the way updatectl renders
progress information

1. We invert from "ICON TARGET MESSAGE" to "TARGET: ICON MESSAGE" to
   better fit in with the systemd progress bars, which look like
   "TARGET [==========---------] XX%". The original version of the
   sysupdated PR implemented its own progress bars that were oriented
   differently: "[==========---------] TARGET XX%". When we swapped
   the progress bar we didn't swap the status messages

2. When a target finishes updating, instead of leaving a 100% progress
   bar on screen for potentially extended periods of time (which implies
   to the user that the update isn't actually done...), we show a status
   message saying the target is done updating.

3. Fixed a minor bug where an extra newline would be printed after the
   total progress bar. At the top of the rendering function, we scroll
   the terminal's scroll-back just enough to fit a line for each target,
   and one for the total. This means that we should not print an
   additional line after the total, or else it'll scroll the terminal's
   buffer by an additional character. This bug was introduced at some
   point during review

4. Clears the Total progress bar before quitting. By the time we're
   quitting, that progress bar will be showing no useful status for the
   user. Also, the fix in point 3 will cause the shell's prompt to
   appear on the same line as the Total progress bar, partially
   overwriting it and leaving the shell in a glitchy state.
2024-08-30 22:50:23 -04:00
Yu Watanabe
3722db214b man: fix typo
Follow-up for 1ff0164be5.
2024-08-31 11:19:15 +09:00
Adrian Vovk
2aff6efe67
updatectl: Ensure we clear the progress bar
Otherwise we end up half-overwriting the progress bar, which looks buggy
2024-08-30 21:53:14 -04:00
Adrian Vovk
aa2e664e18
sysupdated: Register known error types
This fixes a bug introduced during review of sysupdated. Originally,
we just returned EALREADY verbatim to signify that the target is
already up-to-date. Then we switched this to a proper error
(org.freedesktop.sysupdate1.NoCandidate) during review. But that now
maps to EIO, not EALREADY. Thus, whenever there's nothing to update,
updatectl would report I/O errors to the user, even though nothing
actually went wrong.
2024-08-30 21:43:44 -04:00
Adrian Vovk
6e1992166f
progress-bar: Put a space after the prefix
We always want a space there. So let's just put one in the drawing
routine, and adjust the call cites to avoid adding a second one.
2024-08-30 21:25:37 -04:00
Yu Watanabe
7571cb42a8
Merge pull request #34189 from poettering/cryptenroll-slot-fix
cryptenroll: don't return slot 0 when we have no policy to search for
2024-08-31 04:26:02 +09:00
Daan De Meyer
d850a544bc repart: Keep existing directory timestamps intact when copying
Otherwise, when merging multiple directory trees, the output becomes
unreproducible as the directory timestamps will be changed to the current
time when copying identical directories from the second tree.

We introduce a new copy flag to achieve this behavior.
2024-08-30 15:20:40 +01:00
PavlNekrasov
bd7b6c213b
Use correct error code in log message in pkcs11_token_find_x509_certificate (#34187) 2024-08-30 15:18:56 +01:00
Lennart Poettering
379e088f6f test: when refusing to run slow tests, mention how to run them
Let's be helpful and provide an actionable hint.
2024-08-30 14:17:36 +02:00
Lennart Poettering
43b93a8a26 crypenroll: make slot wiping on pin change a bit more explicit 2024-08-30 14:17:36 +02:00
Lennart Poettering
41bcb93087 cryptenroll: don't return slot 0 when we have no policy to search for
If the policy hash is empty we shouldn't return "0" from
search_policy_hash(), because that is understood as slot index 0, but
that's unlikely to match the policy.

Hence, return -ENOENT instead, indicating that we can't find a matching
slot.
2024-08-30 14:16:39 +02:00
Lennart Poettering
549c1a99d4 cryptenroll: iovec'ify a few more things 2024-08-30 14:15:33 +02:00
Luca Boccassi
c08ffe5b12 mkosi: update debian commit reference
* bb6db3edfe Install new sd-sysupdated files in systemd-container
2024-08-30 11:54:13 +01:00
Lennart Poettering
9407fe6c3d treewide: use sd_json_variant_un{hex|base64}() pervasively
Use these helpers whenever appropriate. Drop separate string checks,
since these helpers already do them anyway.

No actual code change, just a rework to make use of a nice helper we
have already.
2024-08-30 10:35:44 +02:00
Lennart Poettering
38c0086361 update TODO 2024-08-30 10:21:31 +02:00
Yu Watanabe
16d70515e1 hwdb: add entry for Dell AlpsPS/2 ALPS DualPoint TouchPad
Closes #34133.
2024-08-30 09:37:52 +02:00
Daan De Meyer
c5730846fe mkosi: Don't fetch remote if the commit to check out already exists
If the commit we're about to check out already exists in the local
repository, don't fetch from the remote repository.
2024-08-29 19:16:19 +01:00
Filip Lewiński
8c7b140164 hwdb.d/60-keyboard.hwdb: add Clevo mic mute quirk for V5x dGPU
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
2024-08-29 16:32:14 +01:00
Göran Uddeborg
66ccda6cab po: Translated using Weblate (Swedish)
Currently translated at 100.0% (253 of 253 strings)

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/sv/
Translation: systemd/main
2024-08-29 15:16:19 +01:00
Yu Watanabe
c5d5d76988 test: add test for GetUnitByPID() D-Bus method
For issue #34104.
2024-08-29 14:16:43 +01:00