]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
22 months agovarious: don't use close_nointr if retval is not checked anyway 30649/head
Mike Yuan [Thu, 28 Dec 2023 10:13:37 +0000 (18:13 +0800)] 
various: don't use close_nointr if retval is not checked anyway

22 months agologind-session-device: use _cleanup_close_
Mike Yuan [Thu, 28 Dec 2023 12:43:12 +0000 (20:43 +0800)] 
logind-session-device: use _cleanup_close_

22 months agoshared/async: use safe_close where appropriate
Mike Yuan [Thu, 28 Dec 2023 10:05:33 +0000 (18:05 +0800)] 
shared/async: use safe_close where appropriate

22 months agofdset: use FOREACH_ARRAY at one more place
Mike Yuan [Thu, 28 Dec 2023 10:07:12 +0000 (18:07 +0800)] 
fdset: use FOREACH_ARRAY at one more place

22 months agofd-util: modernization
Mike Yuan [Thu, 28 Dec 2023 10:17:52 +0000 (18:17 +0800)] 
fd-util: modernization

22 months agomachinectl: add `restart` convenience alias (#30625)
Chris Simons [Wed, 27 Dec 2023 22:09:42 +0000 (14:09 -0800)] 
machinectl: add `restart` convenience alias (#30625)

22 months agonetwork/address: unconditionally check if address is ready
Yu Watanabe [Tue, 26 Dec 2023 02:04:20 +0000 (11:04 +0900)] 
network/address: unconditionally check if address is ready

Previously, we checked if the address is ready only when it is an IPv6
address. But, IPv4 address never enter tentative state, hence the check
for an IPv4 address is effectively equivalent to the one for IPv6.
So, let's unify the check. This does not change any effective behavior.

22 months agoMerge pull request #30643 from bluca/completion
Yu Watanabe [Wed, 27 Dec 2023 19:10:20 +0000 (04:10 +0900)] 
Merge pull request #30643 from bluca/completion

bash completion additions for systemctl/systemd-analyze

22 months agoMerge pull request #30641 from YHNdnzj/hibernation-device
Yu Watanabe [Wed, 27 Dec 2023 19:09:55 +0000 (04:09 +0900)] 
Merge pull request #30641 from YHNdnzj/hibernation-device

Follow-ups for hibernate-util

22 months agoMerge pull request #30634 from dtardon/docbook-valid-3
Yu Watanabe [Wed, 27 Dec 2023 19:06:57 +0000 (04:06 +0900)] 
Merge pull request #30634 from dtardon/docbook-valid-3

DocBook validation fixes (part 3)

22 months agobash completion: add systemd-analyze architectures 30643/head
Luca Boccassi [Wed, 27 Dec 2023 16:50:36 +0000 (17:50 +0100)] 
bash completion: add systemd-analyze architectures

Follow-up for fb8cc599ed863502d67

22 months agoanalyze: allow --no-legend with architectures verb
Luca Boccassi [Wed, 27 Dec 2023 16:49:17 +0000 (17:49 +0100)] 
analyze: allow --no-legend with architectures verb

It prints a table with a header, allow omitting it

Follow-up for fb8cc599ed863502d67

22 months agobash completion: make systemctl mount-image/bind autocomplete on active services
Luca Boccassi [Wed, 27 Dec 2023 16:48:05 +0000 (17:48 +0100)] 
bash completion: make systemctl mount-image/bind autocomplete on active services

The verb works only on running service units, so complete on that as the first
parameter, and a local file as the second. The other parameters are inside the
service namespace so we can't autocomplete from the outside, return early.

22 months agobash completion: add systemctl service-log-level/target
Luca Boccassi [Wed, 27 Dec 2023 15:59:03 +0000 (16:59 +0100)] 
bash completion: add systemctl service-log-level/target

22 months agosleep: don't log duplicate error 30641/head
Mike Yuan [Wed, 27 Dec 2023 14:31:57 +0000 (22:31 +0800)] 
sleep: don't log duplicate error

write_resume_config() logs error on its own.

22 months agohibernate-util: remove unused code
Mike Yuan [Wed, 27 Dec 2023 14:22:21 +0000 (22:22 +0800)] 
hibernate-util: remove unused code

All callers of write_resume_config() pass non-NULL device.

22 months agohibernate-util: make sure we use blockdev path for HibernationDevice.path
Mike Yuan [Wed, 27 Dec 2023 14:19:07 +0000 (22:19 +0800)] 
hibernate-util: make sure we use blockdev path for HibernationDevice.path

Before this commit, this field could spuriously contain the path of the
swapfile.

22 months agoMerge pull request #30639 from mrc0mmand/more-cocci-shenanigans
Yu Watanabe [Wed, 27 Dec 2023 11:33:46 +0000 (20:33 +0900)] 
Merge pull request #30639 from mrc0mmand/more-cocci-shenanigans

Another batch of Coccinelle tweaks

22 months agotpm2-util: declare the cleanup attribute first 30639/head
Frantisek Sumsal [Tue, 26 Dec 2023 20:24:14 +0000 (21:24 +0100)] 
tpm2-util: declare the cleanup attribute first

As we do everywhere else (apart from it being incosistent, the switched
order also makes Coccinelle unhappy).

22 months agobootctl: add a missing space
Frantisek Sumsal [Tue, 26 Dec 2023 20:23:55 +0000 (21:23 +0100)] 
bootctl: add a missing space

22 months agotest: use timestamp_is_set()
Frantisek Sumsal [Tue, 26 Dec 2023 19:23:19 +0000 (20:23 +0100)] 
test: use timestamp_is_set()

22 months agotest: use set_isempty() in one more place
Frantisek Sumsal [Tue, 26 Dec 2023 19:22:53 +0000 (20:22 +0100)] 
test: use set_isempty() in one more place

22 months agotest: use IN_SET()/ERRNO_IS_NEG_*() more
Frantisek Sumsal [Tue, 26 Dec 2023 19:21:48 +0000 (20:21 +0100)] 
test: use IN_SET()/ERRNO_IS_NEG_*() more

22 months agotree-wide: use IN_SET() more
Frantisek Sumsal [Tue, 26 Dec 2023 19:20:51 +0000 (20:20 +0100)] 
tree-wide: use IN_SET() more

22 months agococcinelle: dial back warnings about performance
Frantisek Sumsal [Tue, 26 Dec 2023 18:39:12 +0000 (19:39 +0100)] 
coccinelle: dial back warnings about performance

Turns out I _really_ underestimated the impact of
--include-headers-for-types, as it significantly reduces both runtime
and storage penalties. For example, on my machine the runtime of
uncached run goes down from ~15 minutes to ~2 minutes, and similarly the
total storage needed by the cache goes from ~15 GiB down to ~3 GiB.

22 months agococcinelle: help Coccinelle with some more complex macros
Frantisek Sumsal [Tue, 26 Dec 2023 17:55:31 +0000 (18:55 +0100)] 
coccinelle: help Coccinelle with some more complex macros

Drop the original macro file, since it's not needed anymore thanks to
resolving includes properly, but introduce a similar file -
parsing_hacks.h - that helps Coccinelle in some specific corner cases.

This eliminates most of the outstanding parsing errors in source files.
The remaining ones are limitations of the parsing engine (see the FIXMEs
in pasing_hacks.h) and need further investigation.

22 months agococcinelle: search the system include path for header files as well
Frantisek Sumsal [Tue, 26 Dec 2023 17:44:21 +0000 (18:44 +0100)] 
coccinelle: search the system include path for header files as well

Since Coccinelle is originally a kernel tool, it doesn't search the
system include path by default for header files. Without this we're
missing a lot of types provides by stdlib (and other libraries we make
use of).

22 months agoMerge pull request #30631 from yuwata/network-address-free
Luca Boccassi [Tue, 26 Dec 2023 18:21:15 +0000 (19:21 +0100)] 
Merge pull request #30631 from yuwata/network-address-free

network/address: tiny cleanups for address_free()

22 months agosleep: connect to correct bus when locking homed-managed homes
Mike Yuan [Tue, 26 Dec 2023 12:38:47 +0000 (20:38 +0800)] 
sleep: connect to correct bus when locking homed-managed homes

Partially reverts 122f6f1eaa4447449c7054793f6497eb9e4d03c6

Fixes https://github.com/systemd/systemd/issues/29938#issuecomment-1869508708

22 months agoman: rewrite as <group> 30634/head
David Tardon [Mon, 25 Dec 2023 16:41:18 +0000 (17:41 +0100)] 
man: rewrite as <group>

22 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>.

22 months agoman: move </variablelist> to the right place
David Tardon [Mon, 25 Dec 2023 16:43:09 +0000 (17:43 +0100)] 
man: move </variablelist> to the right place

22 months agoman: fix <cmdsynopsis> content
David Tardon [Mon, 25 Dec 2023 15:49:11 +0000 (16:49 +0100)] 
man: fix <cmdsynopsis> content

Inline text is not allowed.

22 months agoman: fix markup
David Tardon [Mon, 25 Dec 2023 15:38:08 +0000 (16:38 +0100)] 
man: fix markup

<option> is not allowed in <cmdsynopsis>.

22 months agoman: restrict <command> to the actual command
David Tardon [Mon, 25 Dec 2023 14:42:34 +0000 (15:42 +0100)] 
man: restrict <command> to the actual command

22 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.

22 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 <term>.

22 months agococcinelle: explicitly undefine SD_BOOT
Frantisek Sumsal [Mon, 25 Dec 2023 23:41:40 +0000 (00:41 +0100)] 
coccinelle: explicitly undefine SD_BOOT

So Coccinelle doesn't pull in includes guarded by #if SD_BOOT.

For example:

$ head -n5 main.c
 #if FOO
 #include "foo.h"
 #else
 #include "bar.h"
 #endif

$ spatch --verbose-includes --recursive-includes --sp-file zz-drop-braces.cocci main.c
init_defs_builtins: /usr/lib64/coccinelle/standard.h
HANDLING: main.c
including ./foo.h
including ./bar.h

$ spatch --verbose-includes --recursive-includes --sp-file zz-drop-braces.cocci main.c --undefined FOO
init_defs_builtins: /usr/lib64/coccinelle/standard.h
HANDLING: main.c
including ./bar.h

22 months agoman: fix indentation
David Tardon [Tue, 26 Dec 2023 07:59:53 +0000 (08:59 +0100)] 
man: fix indentation

22 months agococcinelle: fix typo
Yu Watanabe [Tue, 26 Dec 2023 00:43:21 +0000 (09:43 +0900)] 
coccinelle: fix typo

22 months agohwdb: Add override for headset form-factor for the Corsair Void Elite
Stuart Hayhurst [Mon, 25 Dec 2023 20:39:00 +0000 (20:39 +0000)] 
hwdb: Add override for headset form-factor for the Corsair Void Elite

Earlier versions of the headset had 'Headset' in the product name.
This version uses 'Dongle' instead, so it doesn't get given a form-factor.

22 months agoMerge pull request #30633 from mrc0mmand/cocci-shenanigans
Yu Watanabe [Mon, 25 Dec 2023 20:45:58 +0000 (05:45 +0900)] 
Merge pull request #30633 from mrc0mmand/cocci-shenanigans

coccinelle: rework how we run the Coccinelle transformations

22 months agosystemctl: use SYNTHETIC_ERRNO() 30633/head
Frantisek Sumsal [Mon, 25 Dec 2023 18:51:43 +0000 (19:51 +0100)] 
systemctl: use SYNTHETIC_ERRNO()

22 months agomodules-load: simplify OOM check
Frantisek Sumsal [Mon, 25 Dec 2023 17:12:59 +0000 (18:12 +0100)] 
modules-load: simplify OOM check

22 months agosd-bus: drop unnecessary braces
Frantisek Sumsal [Mon, 25 Dec 2023 12:32:16 +0000 (13:32 +0100)] 
sd-bus: drop unnecessary braces

22 months agonetwork: use timestamp_is_set() in one more place
Frantisek Sumsal [Mon, 25 Dec 2023 12:27:27 +0000 (13:27 +0100)] 
network: use timestamp_is_set() in one more place

22 months agotree-wide: use strndupa_safe() in a couple more cases
Frantisek Sumsal [Mon, 25 Dec 2023 12:13:17 +0000 (13:13 +0100)] 
tree-wide: use strndupa_safe() in a couple more cases

22 months agonspawn: log & return in a single statement
Frantisek Sumsal [Mon, 25 Dec 2023 11:57:22 +0000 (12:57 +0100)] 
nspawn: log & return in a single statement

22 months agotree-wide: use IOVEC_MAKE() in a couple more places
Frantisek Sumsal [Mon, 25 Dec 2023 11:54:35 +0000 (12:54 +0100)] 
tree-wide: use IOVEC_MAKE() in a couple more places

22 months agotest: use FLAGS_SET() in one more place
Frantisek Sumsal [Mon, 25 Dec 2023 11:46:27 +0000 (12:46 +0100)] 
test: use FLAGS_SET() in one more place

22 months agotest: use ERRNO_IS_NEG_NOT_SUPPORTED() in one more place
Frantisek Sumsal [Mon, 25 Dec 2023 11:40:06 +0000 (12:40 +0100)] 
test: use ERRNO_IS_NEG_NOT_SUPPORTED() in one more place

22 months agokillall: fix errno check
Frantisek Sumsal [Mon, 25 Dec 2023 11:18:02 +0000 (12:18 +0100)] 
killall: fix errno check

22 months agonetwork: ENOTSUP -> EOPNOTSUPP
Frantisek Sumsal [Mon, 25 Dec 2023 11:14:20 +0000 (12:14 +0100)] 
network: ENOTSUP -> EOPNOTSUPP

22 months agotree-wide: shorten a couple of ternary expressions
Frantisek Sumsal [Mon, 25 Dec 2023 10:52:39 +0000 (11:52 +0100)] 
tree-wide: shorten a couple of ternary expressions

22 months agotree-wide: drop !! casts to booleans
Frantisek Sumsal [Mon, 25 Dec 2023 10:46:28 +0000 (11:46 +0100)] 
tree-wide: drop !! casts to booleans

22 months agoman: add required <title>
David Tardon [Mon, 25 Dec 2023 16:45:00 +0000 (17:45 +0100)] 
man: add required <title>

22 months agoman: match doctype and root element
David Tardon [Mon, 25 Dec 2023 10:06:42 +0000 (11:06 +0100)] 
man: match doctype and root element

22 months agoman: use same version in public and system ident.
David Tardon [Mon, 25 Dec 2023 14:48:33 +0000 (15:48 +0100)] 
man: use same version in public and system ident.

22 months agocore/unit: don't log 0 values in unit_log_resources
Mike Yuan [Mon, 25 Dec 2023 11:21:07 +0000 (19:21 +0800)] 
core/unit: don't log 0 values in unit_log_resources

Prompted by #30573

22 months agonetwork: use RET_GATHER() macro
Yu Watanabe [Mon, 25 Dec 2023 11:18:34 +0000 (20:18 +0900)] 
network: use RET_GATHER() macro

22 months agococcinelle: properly drop braces around single-statement if()s
Frantisek Sumsal [Mon, 25 Dec 2023 10:43:27 +0000 (11:43 +0100)] 
coccinelle: properly drop braces around single-statement if()s

22 months agococcinelle: fix the log-json rule
Frantisek Sumsal [Mon, 25 Dec 2023 10:43:02 +0000 (11:43 +0100)] 
coccinelle: fix the log-json rule

As it generated very questionable results.

22 months agococcinelle: rework how we run the Coccinelle transformations
Frantisek Sumsal [Mon, 25 Dec 2023 10:28:26 +0000 (11:28 +0100)] 
coccinelle: rework how we run the Coccinelle transformations

Turns out that the original way we did things was quite broken, as it
skipped a _lot_ of code. This was because we just threw everything into
one pile and tried to spatch it, but this made Coccinelle sad, like when
man page examples redefined some of our macros, causing typedef
conflicts.

For example, with a minimal reproducer that defines a cleanup macro in
two source files, Coccinelle has no issues when spatch-ing each one
separately:

$ spatch --verbose-parsing --sp-file zz-drop-braces.cocci main.c
init_defs_builtins: /usr/lib64/coccinelle/standard.h
HANDLING: main.c
SPECIAL NAMES: adding _cleanup_ as a attribute with arguments
SPECIAL NAMES: adding _cleanup_free_ as a attribute

$ spatch --verbose-parsing --sp-file zz-drop-braces.cocci
logcontrol-example.c
init_defs_builtins: /usr/lib64/coccinelle/standard.h
HANDLING: logcontrol-example.c
SPECIAL NAMES: adding _cleanup_ as a attribute with arguments

But when you try to spatch both of them at once, Coccinelle starts
complaining and skipping the "bad" code:

$ spatch --verbose-parsing --sp-file zz-drop-braces.cocci main.c logcontrol-example.c
init_defs_builtins: /usr/lib64/coccinelle/standard.h
HANDLING: main.c logcontrol-example.c
SPECIAL NAMES: adding _cleanup_ as a attribute with arguments
SPECIAL NAMES: adding _cleanup_free_ as a attribute
remapping: _cleanup_ to an ident in macro name
ERROR-RECOV: found sync end of #define, line 44
parsing pass2: try again
ERROR-RECOV: found sync end of #define, line 44
parse error
 = File "logcontrol-example.c", line 44, column 21, charpos = 1719
  around = '__attribute__',
  whole content = #define _cleanup_(f) __attribute__((cleanup(f)))
badcount: 2
bad: #include <systemd/sd-journal.h>
bad:
BAD:!!!!! #define _cleanup_(f) __attribute__((cleanup(f)))

This was, unfortunately, hidden as it is visible only with
--verbose-parsing (or --parse-error-msg).

Another issue was how we handled includes. The original way of throwing
them into the pile of source files doesn't really work, leading up to
similar issues as above. The better way is to let Coccinelle properly
resolve all includes by telling it where to find our own include files
(basically the same thing we already do during compilation).

After fixing all this, Coccinelle now has a chance to process much more
of our code (there are still some issues in more complex macros, but
that requires further investigation). However, there's a huge downside
from all of this - doing a _proper_ code analysis is surprisingly time
and resource heavy; meaning that processing just one Coccinelle rule now
takes 15 - 30 minutes.

To make this slightly less painful, Coccinelle supports caching the
generated ASTs, which actually helps a lot - it gets the runtime of one
rule from 15 - 30 minutes down to ~1 minute. It, of course, has its own
downside - the cache is _really_ big (ATTOW the cache takes ~15 GiB).

However, even with the aggressive AST caching you're still looking at
~1 hour for one full Coccinelle run, which is a bit annoying, but I
guess that's the price of doing things _properly_ (but I'll definitely
look into ways of further optimizing this).

22 months agonetwork/address: move post-processes on address removal to address_drop() 30631/head
Yu Watanabe [Fri, 22 Dec 2023 16:32:44 +0000 (01:32 +0900)] 
network/address: move post-processes on address removal to address_drop()

For consistency with other follow-up processes after address removal.

No functional change, just refactoring and preparation for later
commits.

22 months agonetwork/address: also drop reference for DHCP server address
Yu Watanabe [Fri, 22 Dec 2023 16:21:22 +0000 (01:21 +0900)] 
network/address: also drop reference for DHCP server address

The Address object should never freed after it is referenced.
So, this should not change any behavior. Just for safety.

22 months agovarious: use FOREACH_ARRAY more
Mike Yuan [Mon, 25 Dec 2023 09:57:01 +0000 (17:57 +0800)] 
various: use FOREACH_ARRAY more

Prompted by #30622

22 months agoMerge pull request #30628 from YHNdnzj/format-table-improvement
Yu Watanabe [Mon, 25 Dec 2023 11:01:32 +0000 (20:01 +0900)] 
Merge pull request #30628 from YHNdnzj/format-table-improvement

Some improvements for format-table

22 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)

22 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

22 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

22 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.

22 months agocore,format-table: use strna/ersatz for formatting fdstore dump 30628/head
Mike Yuan [Sun, 24 Dec 2023 01:11:48 +0000 (09:11 +0800)] 
core,format-table: use strna/ersatz for formatting fdstore dump

Currently, the code doesn't handle anonymous inodes correctly.

22 months agoformat-table: introduce table_isempty and use it where appropriate
Mike Yuan [Mon, 25 Dec 2023 09:34:57 +0000 (17:34 +0800)] 
format-table: introduce table_isempty and use it where appropriate

22 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 .

22 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.

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

22 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>.

22 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>.

22 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.

22 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.

22 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...

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

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

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

22 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

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

22 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

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

22 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.

22 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

22 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

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

22 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.

22 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

22 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

22 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

22 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.

22 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.

22 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

22 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.