Frantisek Sumsal [Mon, 24 Oct 2022 17:12:55 +0000 (19:12 +0200)]
udev: fix the errno check if a couple of places
Follow-up to
691a596da15.
Luca Boccassi [Mon, 24 Oct 2022 18:19:17 +0000 (19:19 +0100)]
mkosi: libbpf0 -> libbpf1
Yu Watanabe [Mon, 24 Oct 2022 16:57:41 +0000 (01:57 +0900)]
Merge pull request #25080 from keszybz/search-paths
Refusing linking files underneath our hierarchy, improve error messages
Luca BRUNO [Mon, 24 Oct 2022 12:49:32 +0000 (12:49 +0000)]
test-string-util: remove several strdupa() calls
This performs the same semantic transformation as the Coccinelle
script 'strdupa.cocci'.
Somehow the existing semantic patch is not properly triggering on
this 'string_replace_char' test.
Edson Juliano Drosdeck [Mon, 24 Oct 2022 16:03:52 +0000 (13:03 -0300)]
hwdb: fix key toggle and programmable button for Positivo K142 (#25111)
H A [Mon, 24 Oct 2022 15:23:38 +0000 (17:23 +0200)]
po: Translated using Weblate (Estonian)
Currently translated at 71.5% (138 of 193 strings)
Co-authored-by: H A <contact+fedora@hen.ee>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/et/
Translation: systemd/main
Lennart Poettering [Mon, 24 Oct 2022 10:22:46 +0000 (12:22 +0200)]
homed: properly initialize all return params
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 10:27:29 +0000 (12:27 +0200)]
man: fix count mismatch
We said "search path" and "search paths" in the same sentence…
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 09:32:25 +0000 (11:32 +0200)]
systemctl,manager: refuse linking unit files underneath the search paths
We treat symlinks to unit files outside of the search path differently from
symlinks to unit files *in* the search path. The former are "linked" unit
files, while the latter are enablement symlinks and such and will be removed
when disabling the unit.
The history of the check for in_search_path() is interesting: this condition
was added already in the first version of the code in
830964834f330836b9d33752e83de09d4f38da87. Since the beginning, matching
arguments would simply be ignored. I think this is dubious. The man page says:
> Link a unit file that is *not* in the unit file search paths
> into the unit file search path
But for backwards-compat, let's continue to silently do nothing for files
*in* the search path.
The case of symlinks to unit files underneath the search path, but in some
subdirectory, is less clear. We didn't check for this case, so it was
implicitly allowed. But that's just an oversight, we don't want to allow people
to create additional subhierarchies under our hierarchy. Let's check for this
case and refuse.
Closes #24605.
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 10:07:10 +0000 (12:07 +0200)]
shared/install: check that install_changes_add() didn't fail on success
This adds a check for an allocation error for the calls to install_changes_add()
where we're plannig to return success from the call. In cases where we're
returning failure, it doesn't matter as much: the operation will fail anyway,
and if the allocation fails, we'll just get a less descriptive error message.
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 09:31:41 +0000 (11:31 +0200)]
shared/install: add forgotten calls to install_changes_add()
The machinery to report a good error message only works if the
error was registered with install_changes_add() and a file name. Otherwise
we only get a generic "Op failed: %m" message.
In some places -EINVAL is replaced by -EUCLEAN, so that we get the proper
error message.
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 09:41:53 +0000 (11:41 +0200)]
shared/install: make install_changes_add propagate passed-in errno value
The function was written to only return an error from internal allocation
failures, because when using it to create a bus message, we want to distinguish
a failed operation from an allocation error when sending the reply. But it
turns out that the only caller that makes this distinction checks that the
passed-in errno value ('type') is not negative beforehand. So we can make the
function pass 'type' value through, which makes most of the callers nicer.
No functional change.
Frantisek Sumsal [Sat, 22 Oct 2022 19:01:06 +0000 (19:01 +0000)]
Merge pull request #25100 from weblate/weblate-systemd-master
Translations update from Fedora Weblate
Jan Kuparinen [Sat, 22 Oct 2022 17:19:52 +0000 (19:19 +0200)]
po: Translated using Weblate (Finnish)
Currently translated at 100.0% (193 of 193 strings)
Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fi/
Translation: systemd/main
Yuri Chornoivan [Sat, 22 Oct 2022 17:19:52 +0000 (19:19 +0200)]
po: Translated using Weblate (Ukrainian)
Currently translated at 100.0% (193 of 193 strings)
Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/uk/
Translation: systemd/main
Oğuz Ersen [Sat, 22 Oct 2022 17:19:51 +0000 (19:19 +0200)]
po: Translated using Weblate (Turkish)
Currently translated at 100.0% (193 of 193 strings)
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/tr/
Translation: systemd/main
김인수 [Sat, 22 Oct 2022 17:19:51 +0000 (19:19 +0200)]
po: Translated using Weblate (Korean)
Currently translated at 100.0% (193 of 193 strings)
Co-authored-by: 김인수 <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
Daniel Rusek [Sat, 22 Oct 2022 17:19:51 +0000 (19:19 +0200)]
po: Translated using Weblate (Czech)
Currently translated at 100.0% (193 of 193 strings)
Co-authored-by: Daniel Rusek <mail@asciiwolf.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/cs/
Translation: systemd/main
Zbigniew Jędrzejewski-Szmek [Wed, 19 Oct 2022 14:23:41 +0000 (16:23 +0200)]
meson: always use libatomic if found
Semi-quoting https://github.com/systemd/systemd/issues/25057:
clang-16 has made the choice to turn on -Werror=implicit-function-declaration,implicit-int.
(See Gentoo's tracker bug https://bugs.gentoo.org/870412).
Added in commit
132c73b57ad1d363e97e1f4720f0e920826f34e1, systemd now does a
check to see if libatomic is needed with some compile/link tests with e.g.
__atomic_exchange_1, but the tests don't provide a prototype for
__atomic_exchange_1 so with clang-16 the test fails, breaking the build.
Let's simplify things by linking to libatomic unconditionally if it is found
and seems to work. If actually unneeded, it might be dropped via --as-needed.
This seems to work with gcc and clang.
declare_dependency() is used instead of cc.find_library(), because the latter
picks up a symlink in gcc private directory (e.g.
/usr/lib/gcc/x86_64-redhat-linux/12/libatomic.so), and we don't want that.
Fixes #25057.
Jonathan Kang [Fri, 21 Oct 2022 09:58:37 +0000 (17:58 +0800)]
hwdb: Add support for Elgato Stream Deck XL (gen 2)
Add support for the following Elgato Stream Deck Device:
ID 0fd9:008f Elgato Systems GmbH Stream Deck XL
Michael Biebl [Thu, 20 Oct 2022 17:58:10 +0000 (19:58 +0200)]
Merge pull request #25083 from bluca/revert_timer
Revert "Fix issue with system time set back (#24131)"
Frantisek Sumsal [Thu, 20 Oct 2022 16:45:22 +0000 (16:45 +0000)]
Merge pull request #25084 from mrc0mmand/scorecard-tweaks
ci: run the Scorecards action in PRs only on config update
Lennart Poettering [Thu, 20 Oct 2022 16:28:49 +0000 (18:28 +0200)]
update TODO
Luca Boccassi [Thu, 20 Oct 2022 15:47:14 +0000 (17:47 +0200)]
Merge pull request #25081 from keszybz/test-local-addresses-fail
Fix racy check in test-local-addresses
Frantisek Sumsal [Thu, 20 Oct 2022 15:06:26 +0000 (17:06 +0200)]
ci: run the Scorecards action in PRs only on config update
Also, unify the string quotation a bit and drop one unnecessary
expression syntax (as everything in `if` statements is automatically
evaluated as an expression).
Frantisek Sumsal [Thu, 20 Oct 2022 15:03:37 +0000 (17:03 +0200)]
ci: add a missing SPDX line
Luca Boccassi [Thu, 20 Oct 2022 13:57:46 +0000 (15:57 +0200)]
Merge pull request #25077 from keszybz/completions-optional-components
Fix completions when machinectl is not installed and other fixes
Luca Boccassi [Thu, 20 Oct 2022 13:01:09 +0000 (14:01 +0100)]
Revert "Fix issue with system time set back (#24131)"
This fix unfortunately introduced a much worse regression that
is affecting many users, so let's revert it for now and rework
it in the next release.
This reverts commit
5ded3917a161d87984d74d70b5eb2a254e54b44e.
Fixes https://github.com/systemd/systemd/issues/24984
Luca Boccassi [Wed, 19 Oct 2022 22:52:58 +0000 (23:52 +0100)]
service: do fine-grained validation of CPUSchedulingPriority= at execution time
The precise bounds of the scheduling priority depend on the scheduling policy,
so depending on the order in which the two settings are specified the
validation might pass or fail.
When checking the setting only validate the outer range (valid values in general are 0 to 99),
and let the execution fail later if the priority does not match the
specified policy (1 to 99 for RR/FIFO, 0 for the rest).
Fixes https://github.com/systemd/systemd/issues/20320
Weblate [Thu, 20 Oct 2022 11:44:25 +0000 (13:44 +0200)]
po: Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/
Translation: systemd/main
Frantisek Sumsal [Thu, 20 Oct 2022 11:43:54 +0000 (11:43 +0000)]
Merge pull request #25078 from mrc0mmand/update-pot
po: regenerate the translation files
Luca Boccassi [Wed, 19 Oct 2022 23:37:08 +0000 (00:37 +0100)]
core: allow-list char-rtc with ProtectClock=yes only if needed
Allow-listing a device implicitly blocks everything else, so this
has the opposite of the intended effect when PrivateDevices= is
not used.
Allow-list char-rtc only if there is a device policy set.
Fixes https://github.com/systemd/systemd/issues/18142
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 10:54:44 +0000 (12:54 +0200)]
test-local-addresses: drop racy check
The test would fail when addresses were being removed in parallel. In general,
the check is only valid when the machine configuration is static, which in
general isn't true.
CentOS CI (Arch Linux) fails in TEST-02-UNITTESTS test-local-addresses:
10:38:05 (gdb) #0 0x00007f86260a164c in ?? () from /usr/lib/libc.so.6
10:38:05 No symbol table info available.
10:38:05 #1 0x00007f8626051958 in raise () from /usr/lib/libc.so.6
10:38:05 No symbol table info available.
10:38:05 #2 0x00007f862603b53d in abort () from /usr/lib/libc.so.6
10:38:05 No symbol table info available.
10:38:05 #3 0x00007f862639a755 in log_assert_failed (
10:38:05 text=text@entry=0x56180e56c03b "n == n_ipv4 + n_ipv6",
10:38:05 file=file@entry=0x56180e56c0d1 "src/test/test-local-addresses.c",
10:38:05 line=line@entry=45,
10:38:05 func=func@entry=0x56180e56c360 <__PRETTY_FUNCTION__.6> "test_local_addresses") at ../build/src/basic/log.c:853
10:38:05 No locals.
10:38:05 #4 0x000056180e56b77e in test_local_addresses ()
10:38:05 at ../build/src/test/test-local-addresses.c:45
10:38:05 a = 0x0
10:38:05 n = 234
10:38:05 n_ipv4 = 236
10:38:05 n_ipv6 = 7
10:38:05 __PRETTY_FUNCTION__ = "test_local_addresses"
10:38:05 __func__ = "test_local_addresses"
10:38:05 #5 0x000056180e56ba67 in run_test_table () at ../build/src/shared/tests.h:106
10:38:05 r = 0
10:38:05 t = 0x56180e56e010 <__unique_prefix_static_test_table_entry10>
10:38:05 __PRETTY_FUNCTION__ = <optimized out>
10:38:05 __func__ = "run_test_table"
10:38:05 #6 0x000056180e56bb2f in main (argc=1, argv=0x7ffc3a814808)
10:38:05 at ../build/src/test/test-local-addresses.c:81
10:38:05 _intro = 0x0
10:38:05 _outro = 0x0
10:38:05 _r = 0
10:38:05 _q = 0
10:38:05 (gdb)
The logs show that there's a huge number of private addresses, probably from
some other test running in parallel.
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 10:43:35 +0000 (12:43 +0200)]
test-local-addresses: inline iterator variable
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 10:39:07 +0000 (12:39 +0200)]
resolved: drop unnecessary empty lines
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 10:38:41 +0000 (12:38 +0200)]
tree-wide: inline declarations of sd_netlink_message iterators
Most places were already converted, but a few weren't for some reason.
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 08:32:46 +0000 (10:32 +0200)]
Make comment about coordinating offline and online installation symmetric
https://github.com/systemd/systemd/pull/24728#issuecomment-
1260966910
Frantisek Sumsal [Thu, 20 Oct 2022 08:28:41 +0000 (10:28 +0200)]
docs: update translation strings before new release
Frantisek Sumsal [Thu, 20 Oct 2022 08:19:16 +0000 (10:19 +0200)]
po: regenerate the translation files
See: https://mesonbuild.com/Localisation.html#generate-pot-file
Resolves: #25071
Leon M. George [Wed, 19 Oct 2022 15:22:48 +0000 (17:22 +0200)]
man: document effect of --user on --unit with journalctl
Relates to #25061.
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 08:02:04 +0000 (10:02 +0200)]
Merge pull request #25073 from mrc0mmand/parse-hwdb-tweaks
test: make parse-hwdb compatible with older pyparsing versions
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 07:45:24 +0000 (09:45 +0200)]
shell-completion/zsh: rename helper for clarity
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 05:48:02 +0000 (07:48 +0200)]
shell-completion/zsh: silence error when machinectl is not installed
This fixes a few unrelated issues:
- when ENABLE_MACHINED is false, machinectl is not installed, but _sd_machines
is still used in a few places that want to complete -M and such.
Also, bash completion calls machinectl in various places.
Make missing machinectl mean "no machines" in this case, so
that no error is generated in the callers.
- machinectl list --full would print multiple lines of output per machine,
breaking grep, issue introduced in
e2268fa43742ece4a5cdc2e93f731b2bb2fcc883.
Using --max-addresses=1 would fix the issue, but let's use
--max-addresses=0 because we now can.
- the lists used in various places were slightly different for no good reason.
- don't use a subshell if not necessary.
The code for bash still uses the same combined list of images and running
machines for various commands. The zsh code uses images for start/clone, and
running machines for the rest. Maybe something to fix in the future.
Replaces #25048.
Zbigniew Jędrzejewski-Szmek [Thu, 20 Oct 2022 07:38:59 +0000 (09:38 +0200)]
machinectl: allow --max-addresses=0
Sometimes the addresses are not important, so allow skipping them in output.
Frantisek Sumsal [Wed, 19 Oct 2022 20:43:49 +0000 (22:43 +0200)]
test: make pylint happy
Frantisek Sumsal [Wed, 19 Oct 2022 19:16:04 +0000 (21:16 +0200)]
test: make parse-hwdb compatible with older pyparsing versions
Follow-up to
e77fed207a41a77f88853a89a8408fbfa9a17ddd.
Lennart Poettering [Wed, 19 Oct 2022 14:21:51 +0000 (16:21 +0200)]
update TODO
Luca Boccassi [Wed, 19 Oct 2022 15:30:55 +0000 (17:30 +0200)]
Merge pull request #25068 from aafeijoo-suse/bash-completion-dissect
dissect: add missing help option and bash-completion support
Frantisek Sumsal [Wed, 19 Oct 2022 12:49:31 +0000 (12:49 +0000)]
Merge pull request #25059 from keszybz/fopen-re
Use "re" or "r" as appropriate for various calls
Antonio Alvarez Feijoo [Wed, 19 Oct 2022 12:43:50 +0000 (14:43 +0200)]
bash-completion: add systemd-dissect support
Antonio Alvarez Feijoo [Wed, 19 Oct 2022 12:42:42 +0000 (14:42 +0200)]
dissect: add missing --umount to the help output
Luca Boccassi [Wed, 19 Oct 2022 12:21:33 +0000 (14:21 +0200)]
Merge pull request #25055 from keszybz/coredump-deadlock
Fix coredump deadlock with overly long backtraces
Zbigniew Jędrzejewski-Szmek [Wed, 19 Oct 2022 07:56:56 +0000 (09:56 +0200)]
TEST-15: add daemon-reload in one place
Quoting https://github.com/systemd/systemd/pull/25050#discussion_r998721845:
This part seems to be quite racy, at least in the C8S job:
[ 1767.520856] H testsuite-15.sh[35]: *** test transient slice drop-ins
[ 1767.520856] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/slice.d
[ 1767.522480] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-.slice.d
[ 1767.524992] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-b-.slice.d
[ 1767.526799] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-b-c.slice.d
[ 1767.528302] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop1'
[ 1767.528434] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop2'
[ 1767.528519] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop3'
[ 1767.528595] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop4'
[ 1767.528676] H testsuite-15.sh[35]: + systemctl cat a-b-c.slice
[ 1767.541321] H systemctl[1042]: No files found for a-b-c.slice.
[ 1767.542854] H systemd[1]: testsuite-15.service: Main process exited, code=exited, status=1/FAILURE
[ 1767.542995] H systemd[1]: testsuite-15.service: Failed with result 'exit-code'.
[ 1767.543360] H systemd[1]: Failed to start testsuite-15.service.
[ 1767.543542] H systemd[1]: testsuite-15.service: Consumed 1.586s CPU time.
[ 1767.543938] H systemd[1]: Reached target testsuite.target.
[ 1767.545737] H systemd[1]: Starting end.service...
Lennart Poettering [Wed, 19 Oct 2022 09:38:11 +0000 (11:38 +0200)]
man: document restrictions on naming interfaces
Let's document that "." is a bad choice of character when naming
interfaces. Let's also document the hard restrictions we make when
naming interfaces.
Result of the mess that is #25052.
Luca Boccassi [Wed, 19 Oct 2022 11:04:17 +0000 (13:04 +0200)]
Merge pull request #25056 from yuwata/sd-device-monitor-set-description
tree-wide: set description for device monitor
Frantisek Sumsal [Wed, 19 Oct 2022 09:17:33 +0000 (11:17 +0200)]
README.md: add a missing line break
Follow-up to
b7a279f9ef.
Joyce [Wed, 19 Oct 2022 09:05:39 +0000 (06:05 -0300)]
ci: Enable Scorecard Github Action and Badge (#25054)
* chore: enable scorecard action
* chore: add badge to the README file
* chore: enable on config file update
* chore: update scorecard to 2.0.4
* chore: run scorecard on PR at main branch
* chore: add condition to publish_result key
* chore: skip upload to code scanning if PR
* chore: only runs scorecard in the main repo
Resolves: #25042
Zbigniew Jędrzejewski-Szmek [Wed, 19 Oct 2022 07:49:59 +0000 (09:49 +0200)]
tree-wide: do not use "re" with fmemopen
The man page says nothing about "e". Glibc clearly accepts it without fuss, but
it is meaningless for a memory object (and probably doesn't work). This use is
not portable, so let's avoid it.
Zbigniew Jędrzejewski-Szmek [Wed, 19 Oct 2022 07:30:47 +0000 (09:30 +0200)]
shared/tpm2-util: wrap comments
Zbigniew Jędrzejewski-Szmek [Wed, 19 Oct 2022 07:30:30 +0000 (09:30 +0200)]
resolved,test-fileio: use "re" when opening files
This doesn't matter too much, because neither of those programs forks, but
let's dot he generally correct thing anyway.
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 16:23:53 +0000 (18:23 +0200)]
coredump: avoid deadlock when passing processed backtrace data
We would deadlock when passing the data back from the forked-off process that
was doing backtrace generation back to the coredump parent. This is because we
fork the child and wait for it to exit. The child tries to write too much data
to the output pipe, and and after the first 64k blocks on the parent because
the pipe is full. The bug surfaced in Fedora because of a combination of four
factors:
-
87707784c70dc9894ec613df0a6e75e732a362a3 was backported to v251.5, which
allowed coredump processing to be successful.
-
1a0281a3ebf4f8c16d40aa9e63103f16cd23bb2a was NOT backported, so the output
was very verbose.
- Fedora has the ELF package metadata available, so a lot of output can be
generated. Most other distros just don't have the information.
- gnome-calendar crashes and has a bazillion modules and 69596 bytes of output
are generated for it.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=
2135778.
The code is changed to try to write data opportunistically. If we get partial
information, that is still logged. In is generally better to log partial
backtrace information than nothing at all.
Zbigniew Jędrzejewski-Szmek [Wed, 19 Oct 2022 06:41:13 +0000 (08:41 +0200)]
shared/json: use different return code for empty input
It is useful to distinguish if json_parse_file() got no input or invalid input.
Use different return codes for the two cases.
Yu Watanabe [Tue, 18 Oct 2022 12:23:26 +0000 (21:23 +0900)]
test: skip one test for iszero_safe() on i386 without SSE2
We do not provide any numerical libraries, and iszero_safe() is only
used in parsing or formatting JSON. Hence, it is not necessary for us to
request that the function provides the same result on different systems.
Fixes #25044.
Yu Watanabe [Tue, 18 Oct 2022 19:46:24 +0000 (04:46 +0900)]
tree-wide: set description for device manager
Yu Watanabe [Tue, 18 Oct 2022 19:45:10 +0000 (04:45 +0900)]
udev: drop redundant description setting
Follow-up for
f714ecd450828e45a6f04e6277011d67a10c323f.
Luca Boccassi [Tue, 18 Oct 2022 17:32:36 +0000 (19:32 +0200)]
Merge pull request #25050 from keszybz/transient-drop-ins-2
TEST-15: add one more variant of the test for drop-ins on transient services
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 16:09:06 +0000 (18:09 +0200)]
shared/json: allow json_variant_dump() to return an error
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 12:30:54 +0000 (14:30 +0200)]
NEWS: add entries after 252-rc1, update contrib list
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 10:29:09 +0000 (12:29 +0200)]
TODO: drop entry
This was resolved by
028a981c005e90c36c269e28709bf25032c2e8ca. We don't do
the reload in the normal path.
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 10:01:38 +0000 (12:01 +0200)]
TEST-15: add test that shows slice dropin issue
This should be fixed by single-unit reloads. We already have a TODO
entry for this.
Lennart Poettering [Tue, 18 Oct 2022 10:08:53 +0000 (12:08 +0200)]
update TODO
Luca Boccassi [Tue, 18 Oct 2022 09:49:29 +0000 (11:49 +0200)]
Merge pull request #25004 from keszybz/transient-drop-ins
Allow drop-ins for transient units
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 09:34:16 +0000 (11:34 +0200)]
Merge pull request #25007 from keszybz/rename-dbus-dump
manager: rename dbus method
Ted X. Toth [Thu, 13 Oct 2022 19:58:26 +0000 (12:58 -0700)]
manager: use target process context to set socket context
Use target process context to set socket context when using SELinuxContextFromNet
not systemd's context. Currently when using the SELinuxContextFromNet option for
a socket activated services, systemd calls getcon_raw which returns init_t and
uses the resulting context to compute the context to be passed to the
setsockcreatecon call. A socket of type init_t is created and listened on and
this means that SELinux policy cannot be written to control which processes
(SELinux types) can connect to the socket since the ref policy allows all
'types' to connect to sockets of the type init_t. When security accessors see
that any process can connect to a socket this raises serious concerns. I have
spoken with SELinux contributors in person and on the mailing list and the
consensus is that the best solution is to use the target executables context
when computing the sockets context in all cases.
[zjs review/comment:
This removes the branch that was added in
16115b0a7b7cdf08fb38084d857d572d8a9088dc.
16115b0a7b7cdf08fb38084d857d572d8a9088dc did two things: it had the branch here
in 'socket_determine_selinux_label()' and a code in 'exec_child()' to call
'label_get_child_mls_label(socket_fd, command->path, &label)'.
Before this patch, the flow was:
'''
mac_selinux_get_child_mls_label:
peercon = getpeercon_raw(socket_fd);
if (!exec_label)
exec_label = getfilecon_raw(exe);
socket_open_fds:
if (params->selinux_context_net) #
label = mac_selinux_get_our_label(); # this part is removed
else #
label = mac_selinux_get_create_label_from_exe(path);
socket_address_listen_in_cgroup(s, &p->address, label);
exec_child():
exec_context = mac_selinux_get_child_mls_label(fd, executable, context->selinux_context);
setexeccon(exec_context);
'''
]
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 13:03:16 +0000 (15:03 +0200)]
analyze: use DumpUnitsMatchingPatternsByFileDescriptor
Similarly to DumpByFileDescriptor vs Dump,
DumpUnitsMatchingPatternsByFileDescriptor is used in preference. Dissimilarly,
a fallback to DumpUnitsMatchingPatterns is not done on error, because there is
no need for backwards compatibility.
The code is still more verbose than I'd like, but there are four different code
paths with slightly different rules in each case, so it's hard to make this all
very brief. Since we have a separate file dedicated to making those calls, the
verbose-but-easy-to-follow implementation should be OK.
Closes #24989.
I only did a quick test that all both variants works locally and over ssh.
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 05:36:20 +0000 (07:36 +0200)]
Merge pull request #24777 from medhefgo/stub
stub: Use LoadImage/StartImage
Luca Boccassi [Mon, 17 Oct 2022 21:11:13 +0000 (23:11 +0200)]
Merge pull request #25035 from keszybz/manager-method-names
Manager method names
Frantisek Sumsal [Mon, 17 Oct 2022 16:11:21 +0000 (18:11 +0200)]
test: call sync() before checking the test logs
Otherwise we might hit a race where we read the test log just before
it's fully written to the disk:
```
======================================================================
FAIL: test_interleaved (__main__.ExecutionResumeTest.test_interleaved)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/systemd/test/test-exec-deserialization.py", line 170, in test_interleaved
self.check_output(expected_output)
File "/root/systemd/test/test-exec-deserialization.py", line 111, in check_output
self.assertEqual(output, expected_output)
AssertionError: 'foo\n' != 'foo\nbar\n'
foo
+ bar
```
With some debug:
```
test_interleaved (__main__.ExecutionResumeTest.test_interleaved) ...
Assertion failed; file contents just after the assertion:
b'foo\n'
File contents 5 seconds later:
b'foo\nbar\n'
FAIL
```
Seen quite often in CentOS CI on the fast baremetal machines.
Luca Boccassi [Mon, 17 Oct 2022 19:52:00 +0000 (21:52 +0200)]
Merge pull request #25039 from mrc0mmand/test-tewaks
A couple of minor tweaks for recent CI fails
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 18:49:18 +0000 (20:49 +0200)]
Merge pull request #24992 from yuwata/sd-device-monitor-receive-buffer
sd-device-monitor: dynamically allocate receive buffer
Lennart Poettering [Mon, 17 Oct 2022 13:21:49 +0000 (15:21 +0200)]
man: add missing reference to systemd-pcrphase-sysinit.service
Luca Boccassi [Mon, 17 Oct 2022 15:12:16 +0000 (17:12 +0200)]
Merge pull request #25036 from keszybz/plurals
Remove usage of "noun(s)" in messages and docs
David Edmundson [Tue, 11 Oct 2022 10:18:13 +0000 (11:18 +0100)]
xdg-autostart-service: Add comments to tilde expansion, use path_join()
Follow-ups for https://github.com/systemd/systemd/pull/24658
Daan De Meyer [Mon, 17 Oct 2022 14:06:39 +0000 (16:06 +0200)]
Update TODO
Daan De Meyer [Mon, 17 Oct 2022 12:53:16 +0000 (14:53 +0200)]
mkosi: Switch to Fedora 37
Official release date is close so let's switch mkosi CI to it already.
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 12:01:16 +0000 (14:01 +0200)]
meson: drop repeated output in error message
Zbigniew Jędrzejewski-Szmek [Sat, 15 Oct 2022 14:06:20 +0000 (16:06 +0200)]
tree-wide: replace "plural(s)" by "plurals"
(s) is just ugly with a vibe of DOS. In most cases just using the normal plural
form is more natural and gramatically correct.
There are some log_debug() statements left, and texts in foreign licenses or
headers. Those are not touched on purpose.
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 12:23:04 +0000 (14:23 +0200)]
manager: add DumpUnitsMatchingPatternsByFileDescriptor()
Frantisek Sumsal [Mon, 17 Oct 2022 13:00:12 +0000 (15:00 +0200)]
test: use SIGKILL to kill the container if necessary
TEST-69 uses a Python wrapper around the systemd-nspawn call, which on
error calls the `spawn.terminate()` method. However, with no arguments
it will only use SIGHUP and SIGINT signals - this might leave a stuck
container around, causing fails if the test is run again. With `force=True`
SIGKILL is used as well (if necessary).
Yu Watanabe [Mon, 17 Oct 2022 12:48:27 +0000 (21:48 +0900)]
test: add test for large uevent message
Jan Janssen [Fri, 14 Oct 2022 09:09:12 +0000 (11:09 +0200)]
boot: Rework shim image verification
This moves the shim security arch override to the new
ReinstallProtocolInterface based interface. This also has the benefit to
reduce the time window in which we have this override active and also
actually removes it, which was not previously done.
The shim hooks themselves are also modernized too. The upcalls should
really not be neccessary if shim is happy with the provided binary.
Yu Watanabe [Thu, 13 Oct 2022 16:18:47 +0000 (01:18 +0900)]
sd-device-monitor: dynamically allocate receive buffer
If udevd broadcasts a processed device with huge amount of properties,
then clients cannot receive the device.
Fixes #24987.
Jan Janssen [Wed, 21 Sep 2022 10:56:20 +0000 (12:56 +0200)]
stub: Allow loading unsigned kernel images
Jan Janssen [Wed, 21 Sep 2022 10:39:46 +0000 (12:39 +0200)]
boot: Use proper security arch protocol names
This is how the Platform Intregration Specification defines these.
Jan Janssen [Wed, 21 Sep 2022 10:23:36 +0000 (12:23 +0200)]
boot: Remove unused parameters from pe_kernel_info
Only the compat entry address is used now. This also now only returns
the compat entry address. If the image is native we do not need to try
calling into the entry address again as we would already have done so
from StartImage (and failed).
Jan Janssen [Wed, 21 Sep 2022 09:07:53 +0000 (11:07 +0200)]
stub: Use LoadImage/StartImage to start the kernel
This is the proper way to start any EFI binary. The fact this even ever
worked was because the kernel does not have any PE relocations.
The only downside is that the embedded kernel image has to be signed and
trusted by the firmware under secure boot. A future commit will try to
deal with that.
Jan Janssen [Wed, 21 Sep 2022 08:42:40 +0000 (10:42 +0200)]
stub: Rename image parameter
This is really the parent image for the kernel that is to be run.
Renaming it as such prevents confusion with any image handles that are
about to be created.
Frantisek Sumsal [Mon, 17 Oct 2022 12:38:00 +0000 (14:38 +0200)]
test: drop one layer of escaping
Frantisek Sumsal [Mon, 17 Oct 2022 12:31:25 +0000 (14:31 +0200)]
test: ignore gcov errors in TEST-34
TEST-34 complains in `test_check_writable` when running with gcov, as
the build directory tree is not writable with DynamicUser=true. As I had
no luck with $GCOV_PREFIX and other runtime gcov configuration, let's
just ignore the gcov errors for this test.
Lennart Poettering [Sun, 16 Oct 2022 22:14:21 +0000 (00:14 +0200)]
cryptsetup: drop redundant parens/drop ternary op
A ternary op is a bit weird to use if we end up assigning a variable to
itself in one of the branches. Hence use a plain if check.