]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 months agoMerge pull request #30616 from dtardon/docbook-valid-2
Yu Watanabe [Mon, 25 Dec 2023 11:00:23 +0000 (20:00 +0900)] 
Merge pull request #30616 from dtardon/docbook-valid-2

DocBook validation fixes (part 2)

5 months agoMerge pull request #30607 from dtardon/docbook-improvements
Yu Watanabe [Mon, 25 Dec 2023 10:34:55 +0000 (19:34 +0900)] 
Merge pull request #30607 from dtardon/docbook-improvements

Minor improvements to man pages

5 months agoMerge pull request #30622 from yuwata/space
Mike Yuan [Mon, 25 Dec 2023 09:52:48 +0000 (17:52 +0800)] 
Merge pull request #30622 from yuwata/space

tree-wide: drop unnecessary space or insert missing space

5 months agoman: use <refsect1> instead of <refsection> 30616/head
David Tardon [Mon, 25 Dec 2023 09:50:13 +0000 (10:50 +0100)] 
man: use <refsect1> instead of <refsection>

DocBook document model doesn't allow mixing of <refsection> with the
numbered variants (<refsect1> etc.). Therefore, any document that
included something from standard-conf.xml was invalid. Fortunately, all
the includes are at the 1st level, hence let's just change
standard-conf.xml to use <refsect1> to fix that.

5 months agoman: drop an extra <member>
David Tardon [Mon, 25 Dec 2023 09:42:55 +0000 (10:42 +0100)] 
man: drop an extra <member>

Follow-up for 13a69c120bc584e90f863f821710b3b5294cd206 .

5 months agoman: move macro decls. out of <funcsynopsis>
David Tardon [Sun, 24 Dec 2023 10:08:40 +0000 (11:08 +0100)] 
man: move macro decls. out of <funcsynopsis>

<funcsynopsis> doesn't allow block content.

5 months agoman: fix markup
David Tardon [Sun, 24 Dec 2023 09:39:08 +0000 (10:39 +0100)] 
man: fix markup

5 months agoman: fix markup
David Tardon [Sat, 23 Dec 2023 16:34:30 +0000 (17:34 +0100)] 
man: fix markup

<arg> is not allowed inside <title>.

5 months agoman: fix markup
David Tardon [Sat, 23 Dec 2023 16:34:30 +0000 (17:34 +0100)] 
man: fix markup

<arg> is not allowed inside <title>.

5 months agoman: make ID valid
David Tardon [Sat, 23 Dec 2023 16:22:04 +0000 (17:22 +0100)] 
man: make ID valid

The id attribute is of type ID, defined at
https://www.w3.org/TR/1998/REC-xml-19980210#id . It may contain only
selected non-alphanumeric characters; '@' is not among them.

5 months agoman: add an extra <refsect2>
David Tardon [Sat, 23 Dec 2023 15:33:53 +0000 (16:33 +0100)] 
man: add an extra <refsect2>

DocBook's document model doesn't allow block content after a section.

5 months agoman: drop output redir. from cmd. synopsis
David Tardon [Sat, 23 Dec 2023 14:09:50 +0000 (15:09 +0100)] 
man: drop output redir. from cmd. synopsis

<cmdsynopsis> doesn't allow inline content, like the redir. operator
here. And std. output is not an argument anyway...

5 months agoman: fix xpointer expression 30607/head
David Tardon [Mon, 25 Dec 2023 08:17:17 +0000 (09:17 +0100)] 
man: fix xpointer expression

5 months agoman: use <warning> for warnings
David Tardon [Sat, 23 Dec 2023 17:40:15 +0000 (18:40 +0100)] 
man: use <warning> for warnings

5 months agoman: add a missing space
David Tardon [Sat, 23 Dec 2023 17:33:36 +0000 (18:33 +0100)] 
man: add a missing space

5 months agoman: sprinkle some more markup around
David Tardon [Sat, 23 Dec 2023 17:33:12 +0000 (18:33 +0100)] 
man: sprinkle some more markup around

5 months agoman: use better-fitting markup
David Tardon [Sat, 23 Dec 2023 17:26:34 +0000 (18:26 +0100)] 
man: use better-fitting markup

5 months agoman: use <simplelist> at one more place
David Tardon [Sat, 23 Dec 2023 15:54:07 +0000 (16:54 +0100)] 
man: use <simplelist> at one more place

5 months agoman: fix plural
David Tardon [Sat, 23 Dec 2023 08:59:23 +0000 (09:59 +0100)] 
man: fix plural

5 months agosiphash24: introduce siphash24_compress_typesafe() macro
Yu Watanabe [Sun, 24 Dec 2023 08:51:30 +0000 (17:51 +0900)] 
siphash24: introduce siphash24_compress_typesafe() macro

To prevent copy-and-paste mistake.

This also introduce in_addr_hash_func().

No functional change, just refactoring.

5 months agoresolve: don't add sockets to the graveyard on shutdown
Frantisek Sumsal [Sun, 24 Dec 2023 17:26:47 +0000 (18:26 +0100)] 
resolve: don't add sockets to the graveyard on shutdown

Since in that case the event loop is already finished and we'd hit an
assertion:

[ 1295.993300] testsuite-75.sh[50]: + systemctl stop systemd-resolved.service
[ 1296.005152] systemd-resolved[298]: Assertion 'e->state != SD_EVENT_FINISHED' failed at src/libsystemd/sd-event/sd-event.c:1252, function sd_event_add_io(). Aborting.

Thread 1 (Thread 0x7f17d25e2940 (LWP 298)):
 #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
 #1  0x00007f17d16ac8a3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
 #2  0x00007f17d165c668 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
 #3  0x00007f17d16444b8 in __GI_abort () at abort.c:79
 #4  0x00007f17d2402d2d in log_assert_failed (text=<optimized out>, file=<optimized out>, line=<optimized out>, func=<optimized out>) at ../build/src/basic/log.c:968
 #5  0x00007f17d240401c in log_assert_failed_return (text=text@entry=0x7f17d2533f13 "e->state != SD_EVENT_FINISHED", file=file@entry=0x7f17d25195d9 "src/libsystemd/sd-event/sd-event.c", line=line@entry=1252, func=func@entry=0x7f17d2567260 <__func__.140> "sd_event_add_io") at ../build/src/basic/log.c:987
 #6  0x00007f17d24d011a in sd_event_add_io (e=0x55e5cb497270, ret=0x55e5cb4a5120, fd=fd@entry=26, events=events@entry=1, callback=callback@entry=0x55e5caff5466 <on_io_event>, userdata=0x55e5cb4a5110) at ../build/src/libsystemd/sd-event/sd-event.c:1252
 #7  0x000055e5caff571c in manager_add_socket_to_graveyard (m=0x55e5cb43cf00, fd=26) at ../build/src/resolve/resolved-socket-graveyard.c:117
 #8  0x000055e5cafd4253 in dns_transaction_close_connection (t=t@entry=0x55e5cb57c7d0, use_graveyard=use_graveyard@entry=true) at ../build/src/resolve/resolved-dns-transaction.c:78
 #9  0x000055e5cafd8444 in dns_transaction_complete (t=t@entry=0x55e5cb57c7d0, state=state@entry=DNS_TRANSACTION_ABORTED) at ../build/src/resolve/resolved-dns-transaction.c:427
 #10 0x000055e5cafc4969 in dns_scope_abort_transactions (s=s@entry=0x55e5cb4b1a70) at ../build/src/resolve/resolved-dns-scope.c:91
 #11 0x000055e5cafc6aee in dns_scope_free (s=0x55e5cb4b1a70) at ../build/src/resolve/resolved-dns-scope.c:106
 #12 0x000055e5cafe72d1 in link_free (l=0x55e5cb4a5160) at ../build/src/resolve/resolved-link.c:94
 #13 0x000055e5cafedefc in manager_free (m=0x55e5cb43cf00) at ../build/src/resolve/resolved-manager.c:697
 #14 0x000055e5caff99b6 in manager_freep (p=p@entry=0x7ffd71fab8f8) at ../build/src/resolve/resolved-manager.h:198
 #15 0x000055e5caff9d66 in run (argc=argc@entry=1, argv=argv@entry=0x7ffd71faba78) at ../build/src/resolve/resolved.c:25
 #16 0x000055e5caff9fe3 in main (argc=1, argv=0x7ffd71faba78) at ../build/src/resolve/resolved.c:99

Resolves: #30618

5 months agoMerge pull request #30621 from yuwata/coccinelle
Yu Watanabe [Sun, 24 Dec 2023 17:38:42 +0000 (02:38 +0900)] 
Merge pull request #30621 from yuwata/coccinelle

coccinelle: convert hashmap_size() == 0 and friends

5 months agogithub: bump version in template
Yu Watanabe [Sun, 24 Dec 2023 17:23:14 +0000 (02:23 +0900)] 
github: bump version in template

5 months agoudev: add hwdb execution for hidraw subsystem devices
djantti [Sat, 23 Dec 2023 21:08:41 +0000 (23:08 +0200)] 
udev: add hwdb execution for hidraw subsystem devices

Hwdb call for hidraw subsystem is missing and AV controller devices defined in hwdb.d/70-av-production.hwdb never get the proper permissions for /dev/hidraw*. This patch implements hwdb execution also for hidraw devices.

5 months agotree-wide: drop several doubled space 30622/head
Yu Watanabe [Sun, 24 Dec 2023 17:13:49 +0000 (02:13 +0900)] 
tree-wide: drop several doubled space

5 months agotree-wide: drop space between variable and an increment/decrement
Yu Watanabe [Sun, 24 Dec 2023 16:41:11 +0000 (01:41 +0900)] 
tree-wide: drop space between variable and an increment/decrement

5 months agotree-wide: insert space after for and switch
Yu Watanabe [Sun, 24 Dec 2023 16:19:25 +0000 (01:19 +0900)] 
tree-wide: insert space after for and switch

5 months agococcinelle: convert hashmap_size() == 0 or friends 30621/head
Yu Watanabe [Sun, 24 Dec 2023 15:44:56 +0000 (00:44 +0900)] 
coccinelle: convert hashmap_size() == 0 or friends

Addresses https://github.com/systemd/systemd/pull/30567#issuecomment-1866631816.

5 months agosd-device: shorten code a big
Yu Watanabe [Sun, 24 Dec 2023 15:30:40 +0000 (00:30 +0900)] 
sd-device: shorten code a big

Suggested by coccinelle.

5 months agoMerge pull request #30620 from mrc0mmand/more-test-tweaks
Yu Watanabe [Sun, 24 Dec 2023 15:19:14 +0000 (00:19 +0900)] 
Merge pull request #30620 from mrc0mmand/more-test-tweaks

test: a couple of fixes for failing tests

5 months agobusctl: avoid asserting on NULL message 30620/head
Frantisek Sumsal [Sun, 24 Dec 2023 13:49:23 +0000 (14:49 +0100)] 
busctl: avoid asserting on NULL message

Avoid passing a NULL message to sd_bus_message_is_signal(), to not trip
over an assertion:

[  132.869436] H testsuite-82.sh[614]: + systemctl --no-block --check-inhibitors=yes soft-reboot
[  132.967386] H systemd[1]: Created slice system-systemd\x2dcoredump.slice.
[  133.018292] H systemd[1]: Starting inhibit.service...
[  133.122610] H systemd[1]: Started systemd-coredump@0-665-0.service.
[  133.163643] H systemd[1]: Started inhibit.service.
[  133.206836] H testsuite-82.sh[614]: + exec sleep infinity
[  133.236762] H systemd-logind[611]: The system will reboot now!
[  135.891607] H systemd-coredump[667]: [🡕] Process 663 (busctl) of user 0 dumped core.

                                        Stack trace of thread 663:
                                        #0  0x00007f2ec45e6acf raise (libc.so.6 + 0x4eacf)
                                        #1  0x00007f2ec45b9ea5 abort (libc.so.6 + 0x21ea5)
                                        #2  0x00007f2ec4b5c9a6 log_assert_failed (libsystemd-shared-255.so + 0x1ff9a6)
                                        #3  0x00007f2ec4b5dca5 log_assert_failed_return (libsystemd-shared-255.so + 0x200ca5)
                                        #4  0x00007f2ec4bb3df6 sd_bus_message_is_signal (libsystemd-shared-255.so + 0x256df6)
                                        #5  0x000000000040e478 monitor (busctl + 0xe478)
                                        #6  0x000000000040e82f verb_monitor (busctl + 0xe82f)
                                        #7  0x00007f2ec4b202cb dispatch_verb (libsystemd-shared-255.so + 0x1c32cb)
                                        #8  0x00000000004074fa busctl_main (busctl + 0x74fa)
                                        #9  0x0000000000407525 run (busctl + 0x7525)
                                        #10 0x000000000040ff67 main (busctl + 0xff67)
                                        #11 0x00007f2ec45d2d85 __libc_start_main (libc.so.6 + 0x3ad85)
                                        #12 0x00000000004044be _start (busctl + 0x44be)
                                        ELF object binary architecture: AMD x86-64
[  136.141152] H dbus-daemon[634]: [system] Monitoring connection :1.2 closed.
[  136.152233] H systemd[1]: busctl.service: Main process exited, code=dumped, status=6/ABRT
[  136.153996] H systemd[1]: busctl.service: Failed with result 'core-dump'.

The asertion in question:

Assertion 'm' failed at src/libsystemd/sd-bus/bus-message.c:1015, function sd_bus_message_is_signal(). Aborting.

We can get a NULL message here through sd_bus_process() ->
bus_process_internal() -> process_running(), so let's handle this case
appropriately.

5 months agotest: flush the socket once the triggered unit exits
Frantisek Sumsal [Sun, 24 Dec 2023 11:53:53 +0000 (12:53 +0100)] 
test: flush the socket once the triggered unit exits

Since the triggered unit intentionally fails without consuming any data
from the socket, we'd try to trigger it again and again, and we might
try to check the unit state in one of the "in-between" states, failing
the test:

[  165.271698] H testsuite-07.sh[1032]: + systemctl start badbin_assert.socket
[  165.977637] H testsuite-07.sh[1032]: + socat - ABSTRACT-CONNECT:badbin_assert.socket
[  165.983787] H systemd[1]: Cannot find unit for notify message of PID 1039, ignoring.
[  166.817187] H testsuite-07.sh[1032]: + timeout 10 sh -c 'while systemctl is-active badbin_assert.service; do sleep .5; done'
[  167.049218] H testsuite-07.sh[1065]: active
[  167.146854] H systemd[1]: Listening on badbin_assert.socket.
[  167.163473] H systemd[1]: badbin_assert.socket: Incoming traffic
[  167.542626] H systemd[1]: Cannot find unit for notify message of PID 1065, ignoring.
[  167.543437] H (badbin)[1062]: badbin_assert.service: Failed to execute /tmp/badbin: Exec format error
[  167.548346] H systemd[1]: badbin_assert.service: Main process exited, code=exited, status=203/EXEC
[  167.549482] H systemd[1]: badbin_assert.service: Failed with result 'exit-code'.
[  167.561537] H systemd[1]: badbin_assert.socket: Incoming traffic
[  167.933390] H systemd[1]: Started badbin_assert.service.
[  167.950489] H (badbin)[1070]: badbin_assert.service: Failed to execute /tmp/badbin: Exec format error
[  167.956318] H systemd[1]: badbin_assert.service: Main process exited, code=exited, status=203/EXEC
[  167.957173] H systemd[1]: badbin_assert.service: Failed with result 'exit-code'.
[  167.974609] H systemd[1]: badbin_assert.socket: Incoming traffic
[  168.042838] H testsuite-07.sh[1072]: failed
[  168.094431] H testsuite-07.sh[1075]: ++ systemctl show -P ExecMainStatus badbin_assert.service
[  168.704022] H systemd[1]: Started badbin_assert.service.
[  168.778680] H (badbin)[1074]: badbin_assert.service: Failed to execute /tmp/badbin: Exec format error
[  168.826881] H systemd[1]: badbin_assert.service: Main process exited, code=exited, status=203/EXEC
[  168.833825] H systemd[1]: badbin_assert.service: Failed with result 'exit-code'.
[  168.923931] H testsuite-07.sh[1032]: + [[ 0 == 203 ]]
[  168.951492] H systemd[1]: Cannot find unit for notify message of PID 1075, ignoring.
[  168.999862] H testsuite-07.sh[615]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/testsuite-07.issue-30412.sh failed'
[  168.999862] H testsuite-07.sh[615]: Subtest /usr/lib/systemd/tests/testdata/units/testsuite-07.issue-30412.sh failed

Follow-up for 1eeaa93de36 and 28a2d27650c.

5 months agoMerge pull request #30615 from dtardon/docbook-valid-1
Yu Watanabe [Sun, 24 Dec 2023 10:27:26 +0000 (19:27 +0900)] 
Merge pull request #30615 from dtardon/docbook-valid-1

DocBook validation fixes (part 1)

5 months agoman: adjust indentation 30615/head
David Tardon [Sun, 24 Dec 2023 09:46:55 +0000 (10:46 +0100)] 
man: adjust indentation

5 months agoman: use the right element for untitled example
David Tardon [Sat, 23 Dec 2023 15:39:37 +0000 (16:39 +0100)] 
man: use the right element for untitled example

5 months agoman: fix markup
David Tardon [Sat, 23 Dec 2023 15:04:11 +0000 (16:04 +0100)] 
man: fix markup

5 months agoman: fix option value
David Tardon [Sat, 23 Dec 2023 14:40:42 +0000 (15:40 +0100)] 
man: fix option value

5 months agoman: fix markup
David Tardon [Sat, 23 Dec 2023 14:21:58 +0000 (15:21 +0100)] 
man: fix markup

5 months agoman: drop stray empty paragraph
David Tardon [Sat, 23 Dec 2023 17:08:34 +0000 (18:08 +0100)] 
man: drop stray empty paragraph

5 months agoman: wrap sentinel in <parameter>
David Tardon [Sat, 23 Dec 2023 13:58:45 +0000 (14:58 +0100)] 
man: wrap sentinel in <parameter>

5 months agoman: use just one <listitem> for the description
David Tardon [Sat, 23 Dec 2023 13:01:02 +0000 (14:01 +0100)] 
man: use just one <listitem> for the description

<varlistentry> allows one or more <term>s, but exactly one <listitem>.

5 months agoman: wrap the whole description in <listitem>
David Tardon [Sat, 23 Dec 2023 12:46:39 +0000 (13:46 +0100)] 
man: wrap the whole description in <listitem>

Unfortunately, version-info includes and standard-options includes are
not composable...

5 months agoman: move misplaced </varlistentry>
David Tardon [Sat, 23 Dec 2023 12:38:40 +0000 (13:38 +0100)] 
man: move misplaced </varlistentry>

5 months agoman: move </listitem> to the right position
David Tardon [Sat, 23 Dec 2023 12:25:57 +0000 (13:25 +0100)] 
man: move </listitem> to the right position

5 months agoman: add missing <listitem>
David Tardon [Sat, 23 Dec 2023 11:25:06 +0000 (12:25 +0100)] 
man: add missing <listitem>

5 months agoman: add missing <cmdsynopsis> wrapper
David Tardon [Sat, 23 Dec 2023 10:19:52 +0000 (11:19 +0100)] 
man: add missing <cmdsynopsis> wrapper

5 months agoman: add required <title>
David Tardon [Sat, 23 Dec 2023 09:05:38 +0000 (10:05 +0100)] 
man: add required <title>

5 months agoman: match doctype and root element
David Tardon [Sat, 23 Dec 2023 08:57:43 +0000 (09:57 +0100)] 
man: match doctype and root element

5 months agoMerge pull request #30594 from yuwata/udev-timeout-cleanups
Luca Boccassi [Sat, 23 Dec 2023 23:26:13 +0000 (00:26 +0100)] 
Merge pull request #30594 from yuwata/udev-timeout-cleanups

udev: several cleanups for timeout settings

5 months agoMerge pull request #30596 from yuwata/sd-device-db-cleanups
Luca Boccassi [Sat, 23 Dec 2023 23:23:35 +0000 (00:23 +0100)] 
Merge pull request #30596 from yuwata/sd-device-db-cleanups

sd-device: several cleanups for udev database related functions

5 months agomeson: check for pefile dependency before enabling ukify
Luca Boccassi [Sat, 23 Dec 2023 08:56:31 +0000 (09:56 +0100)] 
meson: check for pefile dependency before enabling ukify

ukify (and all the tests, including the autogenerated check-version-ukify)
does not work unless pefile is available, so track it as a dependency
in meson to avoid unit test failures later

5 months agoMerge pull request #30609 from YHNdnzj/analyze-fdstore
Yu Watanabe [Sat, 23 Dec 2023 21:44:31 +0000 (06:44 +0900)] 
Merge pull request #30609 from YHNdnzj/analyze-fdstore

analyze-fdstore: minor fixups

5 months agocore/executor: use log level specified in LogLevelMax=
Yu Watanabe [Sat, 23 Dec 2023 18:29:07 +0000 (03:29 +0900)] 
core/executor: use log level specified in LogLevelMax=

Follow-up for cc9f4cad8cd759ab55048dc7a3eaa2c2fb0344da.

Otherwise, still unexpected lines may be logged by executor.

5 months agoanalyze-fdstore: don't log duplicate error 30609/head
Mike Yuan [Sat, 23 Dec 2023 20:25:03 +0000 (04:25 +0800)] 
analyze-fdstore: don't log duplicate error

table_print_with_pager() logs print error internally.

5 months agoanalyze-fdstore: ignore table header when checking stored fd count
Mike Yuan [Sat, 23 Dec 2023 20:26:16 +0000 (04:26 +0800)] 
analyze-fdstore: ignore table header when checking stored fd count

5 months agosystemctl: swap cached_id_map and cached_name_map at one more place
Yu Watanabe [Sat, 23 Dec 2023 16:32:29 +0000 (01:32 +0900)] 
systemctl: swap cached_id_map and cached_name_map at one more place

Follow-up for 2962a508508564ec35f231bd4246846d6d057115.
Fortunately, this does not change any behavior.

Replaces #30601.
Fixes CID#1532831.

5 months agoMerge pull request #30604 from mrc0mmand/test-journal-shenanigans
Yu Watanabe [Sat, 23 Dec 2023 18:40:50 +0000 (03:40 +0900)] 
Merge pull request #30604 from mrc0mmand/test-journal-shenanigans

test: redirect stdout/stderr of TEST-04-JOURNAL to console as well

5 months agoMerge pull request #30587 from mrc0mmand/test-stuff
Yu Watanabe [Sat, 23 Dec 2023 18:40:22 +0000 (03:40 +0900)] 
Merge pull request #30587 from mrc0mmand/test-stuff

test: slightly extend uid0's coverage

5 months agonetworkd: support `proxy_arp_pvlan` sysctl
Raito Bezarius [Thu, 21 Dec 2023 18:48:04 +0000 (19:48 +0100)] 
networkd: support `proxy_arp_pvlan` sysctl

The proxy ARP private VLAN sysctl is useful for VLAN aggregation, see
https://sysctl-explorer.net/net/ipv4/proxy_arp_pvlan/ for details.

5 months agoMerge pull request #30049 from yuwata/assert-return-critical
Yu Watanabe [Sat, 23 Dec 2023 18:39:18 +0000 (03:39 +0900)] 
Merge pull request #30049 from yuwata/assert-return-critical

test: make assert_return() critical by default

5 months agonetwork: use json_variant_append_arrayb()
Yu Watanabe [Mon, 20 Nov 2023 03:22:08 +0000 (12:22 +0900)] 
network: use json_variant_append_arrayb()

No functional change, just refactoring and shortening code.

5 months agolog: make assert_return() critical when -Dmode=developer 30049/head
Yu Watanabe [Fri, 17 Nov 2023 19:18:44 +0000 (04:18 +0900)] 
log: make assert_return() critical when -Dmode=developer

Triggering assert_return() should be a bug in general, and we should
really fix that.  But, previously, it is hard to notice such bug, as
it was not critical.
This is for making CI or our testing environment fail if we unexpectedly
trigger assert_return(). So, hopefully we can easily find such bugs.

5 months agotest: make assert_return() critical by default on fuzzer and unit tests
Yu Watanabe [Sat, 23 Dec 2023 16:49:57 +0000 (01:49 +0900)] 
test: make assert_return() critical by default on fuzzer and unit tests

Several test cases intentionally trigger assert_return(). So, to avoid
the entire test fails, this introduces several macros that tentatively
make assert_return() not critical.

5 months agolog: introduce a knob to make assert_return() critical
Yu Watanabe [Thu, 16 Nov 2023 01:48:37 +0000 (10:48 +0900)] 
log: introduce a knob to make assert_return() critical

These can be used to check if we trigger assert_return()
unexpectedly.

Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
5 months agotest: make the variable names slightly more descriptive 30587/head
Frantisek Sumsal [Fri, 22 Dec 2023 13:16:56 +0000 (14:16 +0100)] 
test: make the variable names slightly more descriptive

Follow-up for 5ca8d2474ca8b8b3f42999fb2f6e5e1498b22aa9.

5 months agotest: slightly extend uid0's coverage
Frantisek Sumsal [Fri, 22 Dec 2023 13:09:58 +0000 (14:09 +0100)] 
test: slightly extend uid0's coverage

5 months agotest: make the test actually test
Frantisek Sumsal [Fri, 22 Dec 2023 12:16:06 +0000 (13:16 +0100)] 
test: make the test actually test

Follow-up for dd25a95763e6ee52d40f4012ffeb2ce719f26b8d.

5 months agoMerge pull request #30603 from mrc0mmand/openssl-shenanigans
Yu Watanabe [Sat, 23 Dec 2023 15:27:20 +0000 (00:27 +0900)] 
Merge pull request #30603 from mrc0mmand/openssl-shenanigans

test/ukify: make the tests happy with OpenSSL 3.2.0+

5 months agotest: redirect stdout/stderr of TEST-04-JOURNAL to console as well 30604/head
Frantisek Sumsal [Sat, 23 Dec 2023 14:35:26 +0000 (15:35 +0100)] 
test: redirect stdout/stderr of TEST-04-JOURNAL to console as well

This effectively reverts fa6f37c043 just for TEST-04, as we nuke the
journal repeatedly in this test which makes it particularly hard to
debug. Let's hope the issue behind fa6f37c043 won't bite us back in this
case.

Follow-up for: fa6f37c043
Reverts: 8f7c876bdc

5 months agotest: don't truncate the final journal
Frantisek Sumsal [Sat, 23 Dec 2023 14:11:11 +0000 (15:11 +0100)] 
test: don't truncate the final journal

This is no longer necessary, as the test for which this was introduced
in the first place has this handled explicitly (testsuite-04.journal.sh).

Follow-up to 9457dd8bae.

5 months agotest: make sure the dummy CA certificate is marked as such 30603/head
Frantisek Sumsal [Sat, 23 Dec 2023 12:33:11 +0000 (13:33 +0100)] 
test: make sure the dummy CA certificate is marked as such

With OpenSSL 3.2.0+ this is necessary, otherwise the verification
of such CA certificate fails badly:

$ openssl s_client -CAfile /run/systemd/remote-pki/ca.crt -connect localhost:19532
...
Connecting to ::1
CONNECTED(00000003)
Can't use SSL_get_servername
depth=1 C=CZ, L=Brno, O=Foo, OU=Bar, CN=Test CA
verify error:num=79:invalid CA certificate
verify return:1
depth=1 C=CZ, L=Brno, O=Foo, OU=Bar, CN=Test CA
verify error:num=26:unsuitable certificate purpose
verify return:1
...
---
SSL handshake has read 1566 bytes and written 409 bytes
Verification error: unsuitable certificate purpose
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 2048 bit
This TLS version forbids renegotiation.
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 26 (unsuitable certificate purpose)

5 months agoukify: make the test happy with the latest OpenSSL
Frantisek Sumsal [Sat, 23 Dec 2023 11:20:03 +0000 (12:20 +0100)] 
ukify: make the test happy with the latest OpenSSL

Which dropped some whitespaces in the output:

$ openssl version
OpenSSL 3.2.0 23 Nov 2023 (Library: OpenSSL 3.2.0 23 Nov 2023)
$ openssl x509 -in cert.pem -text -noout | grep Issuer
        Issuer: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd

$ openssl version
OpenSSL 3.0.9 30 May 2023 (Library: OpenSSL 3.0.9 30 May 2023)
$ openssl x509 -in cert.pem -text -noout | grep Issuer
        Issuer: C = XX, L = Default City, O = Default Company Ltd

Making test-ukify unhappy:

>       assert 'Issuer: CN = SecureBoot signing key on host' in out
E       AssertionError: assert 'Issuer: CN = SecureBoot signing key on host' in '<...snip...>Issuer: CN=SecureBoot signing key on host archlinux2\n...'

5 months agoMerge pull request #30600 from dtardon/see-also-simplelist
Yu Watanabe [Sat, 23 Dec 2023 10:08:31 +0000 (19:08 +0900)] 
Merge pull request #30600 from dtardon/see-also-simplelist

man: use `<simplelist>` for 'See also' sections

5 months agoman: conditionalize sd-pcrlock and sd-measure on the same variable as their binaries
Luca Boccassi [Fri, 22 Dec 2023 20:58:04 +0000 (21:58 +0100)] 
man: conditionalize sd-pcrlock and sd-measure on the same variable as their binaries

The binaries are built and installed if HAVE_TPM2 is set, and ignore ENABLE_BOOTLOADER,
so do the same for the manpages.

For the sd-pcrlock case this also installs the manpage aliases for the units, which
are not installed with -Dbootloader=disabled, but there's no way to conditionalize
the aliases, so on balance it's better to have too much documentation rather than
too little.

Fixes https://github.com/systemd/systemd/issues/30588

5 months agoman: capitalize "also" for consistency 30600/head
David Tardon [Fri, 22 Dec 2023 20:04:12 +0000 (21:04 +0100)] 
man: capitalize "also" for consistency

Almost all our man pages write it that way.

5 months agoman: use <simplelist> for 'See also' sections
David Tardon [Fri, 22 Dec 2023 18:09:32 +0000 (19:09 +0100)] 
man: use <simplelist> for 'See also' sections

This is just a slight markup improvement; there should be no difference
in rendering.

5 months agoudev: use SD_EVENT_SIGNAL_PROCMASK
Yu Watanabe [Tue, 19 Dec 2023 05:15:07 +0000 (14:15 +0900)] 
udev: use SD_EVENT_SIGNAL_PROCMASK

5 months agoMerge pull request #30590 from yuwata/backlight-cleanups
Luca Boccassi [Fri, 22 Dec 2023 22:35:27 +0000 (23:35 +0100)] 
Merge pull request #30590 from yuwata/backlight-cleanups

backlight: several cleanups and use dispatch_verb()

5 months agoTODO: fix typo
Yu Watanabe [Fri, 22 Dec 2023 19:49:26 +0000 (04:49 +0900)] 
TODO: fix typo

5 months agosd-device: introduce device_has_db() helper function 30596/head
Yu Watanabe [Wed, 22 Nov 2023 04:05:26 +0000 (13:05 +0900)] 
sd-device: introduce device_has_db() helper function

5 months agosd-device: modernize device_update_db() and friends
Yu Watanabe [Wed, 22 Nov 2023 03:57:45 +0000 (12:57 +0900)] 
sd-device: modernize device_update_db() and friends

- introduce device_should_have_db(),
- split out device_get_db_path(),
- update log messages, especially clarify which stage is failed,
- use _cleanup_(unlink_and_freep) attribute,
- clear existing database file also when failed to create database directory
  and when failed to create temporary file.

5 months agoudev-spawn: slightly adjust logs about timed out commands 30594/head
Yu Watanabe [Tue, 19 Dec 2023 04:58:35 +0000 (13:58 +0900)] 
udev-spawn: slightly adjust logs about timed out commands

- Add full stop to the messages.
- Do not kill commands before logging "killing", but do after.

5 months agoudev: refuse too short timeout value
Yu Watanabe [Tue, 19 Dec 2023 03:15:25 +0000 (12:15 +0900)] 
udev: refuse too short timeout value

Setting zero or too short timeout for each uevent is meaningless, and
causes the system fails to boot. Let's refuse such values.

Also, delaying execution of RUN= commands too long also makes many
uevents enter the failed state. So, let's refuse such misconfiguration.

5 months agoudev: handle event_timeout=infinity correctly
Yu Watanabe [Tue, 19 Dec 2023 03:28:53 +0000 (12:28 +0900)] 
udev: handle event_timeout=infinity correctly

This is a paranoia, as even USEC_INFINITY / 3 is finite, it is still so large
in general.

5 months agoudev-manager: use ASSERT_PTR()
Yu Watanabe [Tue, 19 Dec 2023 03:27:53 +0000 (12:27 +0900)] 
udev-manager: use ASSERT_PTR()

5 months agonetwork: use varlink for networkctl check_netns_match()
Matt Layher [Thu, 30 Nov 2023 15:01:28 +0000 (10:01 -0500)] 
network: use varlink for networkctl check_netns_match()

Use varlink to detect networkd's network namespace when executing
networkctl rather than the D-Bus interface.

Signed-off-by: Matt Layher <mdlayher@gmail.com>
5 months agobacklight: split out verb_load() and verb_save(), then use dispatch_verb() 30590/head
Yu Watanabe [Thu, 21 Dec 2023 19:36:34 +0000 (04:36 +0900)] 
backlight: split out verb_load() and verb_save(), then use dispatch_verb()

No functional change, just refactoring.

5 months agobacklight: use WRITE_STRING_FILE_MKDIR_0755 flag on save
Yu Watanabe [Fri, 22 Dec 2023 00:42:45 +0000 (09:42 +0900)] 
backlight: use WRITE_STRING_FILE_MKDIR_0755 flag on save

No functional change, just refactoring.

5 months agobacklight: split out read_saved_brightness()
Yu Watanabe [Thu, 21 Dec 2023 19:29:54 +0000 (04:29 +0900)] 
backlight: split out read_saved_brightness()

No functional change, just refactoring.

5 months agobacklight: split out device_new_from_arg()
Yu Watanabe [Thu, 21 Dec 2023 19:24:31 +0000 (04:24 +0900)] 
backlight: split out device_new_from_arg()

While at it, this replaces strndupa_safe() with strndup(), as the input
is a user-controlled string.

No functional change, just refactoring.

5 months agobacklight: split out build_save_file_path()
Yu Watanabe [Thu, 21 Dec 2023 19:21:25 +0000 (04:21 +0900)] 
backlight: split out build_save_file_path()

No functional change, just refactoring.

5 months agobacklight: move validity check of max_brightness to get_max_brightness()
Yu Watanabe [Thu, 21 Dec 2023 19:17:06 +0000 (04:17 +0900)] 
backlight: move validity check of max_brightness to get_max_brightness()

Also rename get_max_brightness() -> read_max_brightness() for
consistency with read_brightness().

5 months agoMerge pull request #30585 from YHNdnzj/isatty-handling
Yu Watanabe [Fri, 22 Dec 2023 18:19:19 +0000 (03:19 +0900)] 
Merge pull request #30585 from YHNdnzj/isatty-handling

various: clean up isatty() handling

5 months agovarious: clean up isatty() handling 30585/head
Mike Yuan [Fri, 22 Dec 2023 10:28:55 +0000 (18:28 +0800)] 
various: clean up isatty() handling

As per https://github.com/systemd/systemd/pull/30547#discussion_r1434371627

5 months agoterminal-util: introduce isatty_safe that rejects EBADF
Mike Yuan [Fri, 22 Dec 2023 09:59:39 +0000 (17:59 +0800)] 
terminal-util: introduce isatty_safe that rejects EBADF

5 months agoterminal-util: use RET_GATHER more
Mike Yuan [Fri, 22 Dec 2023 10:32:24 +0000 (18:32 +0800)] 
terminal-util: use RET_GATHER more

5 months agotest: fix check for device in test-execute
Luca Boccassi [Fri, 22 Dec 2023 12:28:51 +0000 (13:28 +0100)] 
test: fix check for device in test-execute

The unit actually uses /dev/kmsg, not /dev/kvm

Follow-up for ae7482b994e6a9bc8e

5 months agoMerge pull request #30550 from yuwata/network-nexthop-cleanups-3
Luca Boccassi [Fri, 22 Dec 2023 09:44:39 +0000 (10:44 +0100)] 
Merge pull request #30550 from yuwata/network-nexthop-cleanups-3

network: several cleanups for nexthop (part3)

5 months agosystemctl: swap cached_id_map and cached_name_map
Yu Watanabe [Thu, 21 Dec 2023 21:52:46 +0000 (06:52 +0900)] 
systemctl: swap cached_id_map and cached_name_map

These are unused or used in the same order. So, this patch does not
change any behavior, just for naming consistency with the function
prototype.

Closes #30570.

5 months agonetworkd: add basic Varlink interface
Lennart Poettering [Mon, 20 Nov 2023 11:07:13 +0000 (12:07 +0100)] 
networkd: add basic Varlink interface

Let's get networkd onto Varlink. This only adds the most basic of
operations.

I'd love to see networkd do Varlink for all its basic operations so that
networkctl can use that, and work correctly before D-Bus is up. Right
now, many of networkctls calls simply don't work before D-Bus, and I'd
like to see that improved.