Commit graph

69666 commits

Author SHA1 Message Date
Mike Yuan 38617c516a various: use FOREACH_ARRAY more
Prompted by #30622
2023-12-25 20:17:48 +09:00
Yu Watanabe 287a5f1cff
Merge pull request #30628 from YHNdnzj/format-table-improvement
Some improvements for format-table
2023-12-25 20:01:32 +09:00
Yu Watanabe f73509d90f
Merge pull request #30616 from dtardon/docbook-valid-2
DocBook validation fixes (part 2)
2023-12-25 20:00:23 +09:00
Yu Watanabe c6f7c8acd9
Merge pull request #30607 from dtardon/docbook-improvements
Minor improvements to man pages
2023-12-25 19:34:55 +09:00
Mike Yuan 0a0f49556f
Merge pull request #30622 from yuwata/space
tree-wide: drop unnecessary space or insert missing space
2023-12-25 17:52:48 +08:00
David Tardon bc6fdcbf5d 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.
2023-12-25 10:50:13 +01:00
Mike Yuan 8ba111463d
core,format-table: use strna/ersatz for formatting fdstore dump
Currently, the code doesn't handle anonymous inodes correctly.
2023-12-25 17:47:18 +08:00
Mike Yuan 2413a0fab4
format-table: introduce table_isempty and use it where appropriate 2023-12-25 17:47:18 +08:00
David Tardon cfcdee7c16 man: drop an extra <member>
Follow-up for 13a69c120b .
2023-12-25 10:43:18 +01:00
David Tardon 9e25422299 man: move macro decls. out of <funcsynopsis>
<funcsynopsis> doesn't allow block content.
2023-12-25 10:40:40 +01:00
David Tardon e353998eb6 man: fix markup 2023-12-25 10:40:40 +01:00
David Tardon eb066221e9 man: fix markup
<arg> is not allowed inside <title>.
2023-12-25 10:40:40 +01:00
David Tardon 1ab6ecd109 man: fix markup
<arg> is not allowed inside <title>.
2023-12-25 10:40:40 +01:00
David Tardon c101b65619 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.
2023-12-25 10:40:40 +01:00
David Tardon d2c0c05f51 man: add an extra <refsect2>
DocBook's document model doesn't allow block content after a section.
2023-12-25 10:39:36 +01:00
David Tardon df93996fd6 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...
2023-12-25 10:36:07 +01:00
David Tardon 8f39acd005 man: fix xpointer expression 2023-12-25 10:00:43 +01:00
David Tardon 617b85d10e man: use <warning> for warnings 2023-12-25 10:00:43 +01:00
David Tardon f37841c0b7 man: add a missing space 2023-12-25 10:00:43 +01:00
David Tardon ee5bf48f7d man: sprinkle some more markup around 2023-12-25 10:00:43 +01:00
David Tardon 28ed1ba9bd man: use better-fitting markup 2023-12-25 10:00:43 +01:00
David Tardon 2dfeb64bcd man: use <simplelist> at one more place 2023-12-25 10:00:43 +01:00
David Tardon afc7ad8cd5 man: fix plural 2023-12-25 09:15:53 +01:00
Yu Watanabe c01a5c0527 siphash24: introduce siphash24_compress_typesafe() macro
To prevent copy-and-paste mistake.

This also introduce in_addr_hash_func().

No functional change, just refactoring.
2023-12-25 15:38:59 +09:00
Frantisek Sumsal ac1b7b9e19 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
2023-12-25 15:38:26 +09:00
Yu Watanabe 11c36161fa
Merge pull request #30621 from yuwata/coccinelle
coccinelle: convert hashmap_size() == 0 and friends
2023-12-25 02:38:42 +09:00
Yu Watanabe ab84005cb2 github: bump version in template 2023-12-25 02:23:14 +09:00
djantti 43ee987a1f 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.
2023-12-25 02:16:44 +09:00
Yu Watanabe 07e8c3055d tree-wide: drop several doubled space 2023-12-25 02:13:49 +09:00
Yu Watanabe b3a9d980f3 tree-wide: drop space between variable and an increment/decrement 2023-12-25 01:56:40 +09:00
Yu Watanabe 1d03d970a1 tree-wide: insert space after for and switch 2023-12-25 01:29:38 +09:00
Yu Watanabe 6ae5d4b52f coccinelle: convert hashmap_size() == 0 or friends
Addresses https://github.com/systemd/systemd/pull/30567#issuecomment-1866631816.
2023-12-25 00:47:42 +09:00
Yu Watanabe 54cbad304c sd-device: shorten code a big
Suggested by coccinelle.
2023-12-25 00:47:42 +09:00
Yu Watanabe 902279f0e4
Merge pull request #30620 from mrc0mmand/more-test-tweaks
test: a couple of fixes for failing tests
2023-12-25 00:19:14 +09:00
Frantisek Sumsal b4a21d5148 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.
2023-12-24 15:04:28 +01:00
Frantisek Sumsal 4ddf27c57b 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 1eeaa93de3 and 28a2d27650.
2023-12-24 13:00:56 +01:00
Yu Watanabe 891e81edf4
Merge pull request #30615 from dtardon/docbook-valid-1
DocBook validation fixes (part 1)
2023-12-24 19:27:26 +09:00
David Tardon 7e59b569a1 man: adjust indentation 2023-12-24 10:46:55 +01:00
David Tardon 74512bbc38 man: use the right element for untitled example 2023-12-24 09:43:22 +01:00
David Tardon 74cd284ad0 man: fix markup 2023-12-24 09:43:22 +01:00
David Tardon b2e6aae674 man: fix option value 2023-12-24 09:43:22 +01:00
David Tardon 1eb07e6ffa man: fix markup 2023-12-24 09:43:22 +01:00
David Tardon 5b297dcec8 man: drop stray empty paragraph 2023-12-24 09:32:29 +01:00
David Tardon 3c2b711f4a man: wrap sentinel in <parameter> 2023-12-24 09:32:28 +01:00
David Tardon 08b96745dd man: use just one <listitem> for the description
<varlistentry> allows one or more <term>s, but exactly one <listitem>.
2023-12-24 09:32:28 +01:00
David Tardon 7a0f2298b8 man: wrap the whole description in <listitem>
Unfortunately, version-info includes and standard-options includes are
not composable...
2023-12-24 09:32:28 +01:00
David Tardon 35fcba4a8c man: move misplaced </varlistentry> 2023-12-24 09:32:28 +01:00
David Tardon d9655d11bc man: move </listitem> to the right position 2023-12-24 09:32:28 +01:00
David Tardon a5fcbfea45 man: add missing <listitem> 2023-12-24 09:32:28 +01:00
David Tardon 35fc10756b man: add missing <cmdsynopsis> wrapper 2023-12-24 09:32:28 +01:00