]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 months agobasic: Move various macros from assert-util.h to assert-fundamental.h
Daan De Meyer [Sun, 20 Apr 2025 19:20:42 +0000 (21:20 +0200)] 
basic: Move various macros from assert-util.h to assert-fundamental.h

ASSERT_PTR() and friends in assert-fundamental.h make use of assert()
and assert_se() which when not building for sd-boot are defined in
assert-util.h. Because assert() from glibc is only overridden in
assert-util.h, the macros in assert-fundamental.h still end up using
the glibc assert.

Let's fix this by moving the required macros and related logic to
assert-fundamental.h.

7 months agotree-wide: Use assert_se() instead of assert() in various places
Daan De Meyer [Wed, 23 Apr 2025 09:45:59 +0000 (11:45 +0200)] 
tree-wide: Use assert_se() instead of assert() in various places

assert() is compiled away if NDEBUG is set which causes an unused
variable warning in various places when the next commit is applied
so let's use assert_se() to avoid these warnings.

7 months agojournal: Always compile journal authentication related files
Daan De Meyer [Sun, 20 Apr 2025 10:26:53 +0000 (12:26 +0200)] 
journal: Always compile journal authentication related files

Tooling such as clang-tidy is bad at dealing with condition
compilation on the build system level instead of at the source file
level. What happens? It still tries to analyze the file and fails
horribly if the required headers aren't available. Let's work around
the issue and make things more consistent at the same time by doing
the necessary HAVE_GCRYPT checks inside of the source files instead
of doing them at the build system level.

We also add some typedefs to allow getting rid of various HAVE_GCRYPT
checks.

7 months agolibsystemd: Skip _sd-common.h include check when __clang_analyzer__ is defined
Daan De Meyer [Sun, 20 Apr 2025 10:25:42 +0000 (12:25 +0200)] 
libsystemd: Skip _sd-common.h include check when __clang_analyzer__ is defined

This check doesn't work properly when tools such as clang-tidy are
analyzing headers. Since we don't care about the check in that case,
skip it if __clang_analyzer__ is defined similar to how we skip it as
well if __COVERITY__ is defined.

7 months agoboot: Make free() a non inline function
Daan De Meyer [Sun, 20 Apr 2025 10:24:09 +0000 (12:24 +0200)] 
boot: Make free() a non inline function

The static inline declaration in iovec-fundamental.h causes static
analyze tooling warnings (clang-tidy). Let's get around it by making
free() non-inline. LTO will make sure it's still inlined properly.

7 months agoRemove more circular header dependencies (#37185)
Daan De Meyer [Wed, 23 Apr 2025 09:24:02 +0000 (11:24 +0200)] 
Remove more circular header dependencies (#37185)

Continuation of https://github.com/systemd/systemd/pull/37112

7 months agotree-wide: Make sure all headers are standalone 37185/head
Daan De Meyer [Sat, 19 Apr 2025 21:21:55 +0000 (23:21 +0200)] 
tree-wide: Make sure all headers are standalone

Let's make sure all of our headers include everything they require.

7 months agobasic: Use _Static_assert() in missing_audit.h instead of assert_cc()
Daan De Meyer [Wed, 23 Apr 2025 08:19:59 +0000 (10:19 +0200)] 
basic: Use _Static_assert() in missing_audit.h instead of assert_cc()

We want to make the header standalone so it includes all the stuff it
needs. However, including macro.h for assert_cc() doesn't work because
of generate-audit_type-list.sh which would have to become more complex
to handle the extra include directories.

Instead, let's just use _Static_assert() directly which is a builtin and
doesn't need any extra includes.

7 months agotimesync: Remove circular header dependencies
Daan De Meyer [Sat, 19 Apr 2025 21:18:44 +0000 (23:18 +0200)] 
timesync: Remove circular header dependencies

7 months agosysupdate: Remove circular header includes
Daan De Meyer [Sat, 19 Apr 2025 21:12:18 +0000 (23:12 +0200)] 
sysupdate: Remove circular header includes

7 months agoresolved: Remove circular header dependencies
Daan De Meyer [Sat, 19 Apr 2025 20:41:49 +0000 (22:41 +0200)] 
resolved: Remove circular header dependencies

7 months agoresolve: Move implementations of some functions to resolved-dns-packet.c
Daan De Meyer [Sat, 19 Apr 2025 12:07:09 +0000 (14:07 +0200)] 
resolve: Move implementations of some functions to resolved-dns-packet.c

These depend on a full definition of DnsResourceRecord which we want
to forward declare in the next commit, so let's move the implementation
of these functions to the implementation file and make them lowercase.

7 months agoresolve: Move two functions from resolved-conf.h to resolved-dns-server.h
Daan De Meyer [Sat, 19 Apr 2025 11:12:00 +0000 (13:12 +0200)] 
resolve: Move two functions from resolved-conf.h to resolved-dns-server.h

Preparation for getting rid of circular header dependencies.

7 months agoportable: Remove circular header dependencies
Daan De Meyer [Sat, 19 Apr 2025 10:36:37 +0000 (12:36 +0200)] 
portable: Remove circular header dependencies

7 months agonetwork: Remove circular header dependencies in network/netdev
Daan De Meyer [Sat, 19 Apr 2025 10:24:47 +0000 (12:24 +0200)] 
network: Remove circular header dependencies in network/netdev

7 months agonetwork: Remove circular header dependencies in network/tc
Daan De Meyer [Sat, 19 Apr 2025 10:12:20 +0000 (12:12 +0200)] 
network: Remove circular header dependencies in network/tc

Include the headers in the implementation file (and the gperf file)
instead of in the qdisc.h header. I opted to keep them separate from
the other headers since they're slightly different than regular headers.

7 months agonetwork: Move networkd-manager.h include to implementation file
Daan De Meyer [Sat, 19 Apr 2025 10:11:50 +0000 (12:11 +0200)] 
network: Move networkd-manager.h include to implementation file

7 months agomachine: Remove circular header dependencies
Daan De Meyer [Fri, 18 Apr 2025 22:13:45 +0000 (00:13 +0200)] 
machine: Remove circular header dependencies

7 months agologin: Remove circular header dependencies
Daan De Meyer [Fri, 18 Apr 2025 21:53:19 +0000 (23:53 +0200)] 
login: Remove circular header dependencies

7 months agojournal: Remove circular header dependencies
Daan De Meyer [Fri, 18 Apr 2025 20:08:04 +0000 (22:08 +0200)] 
journal: Remove circular header dependencies

7 months agoimport: Remove circular header dependencies
Daan De Meyer [Fri, 18 Apr 2025 19:48:08 +0000 (21:48 +0200)] 
import: Remove circular header dependencies

7 months agohome: Remove circular header dependencies
Daan De Meyer [Fri, 18 Apr 2025 19:37:13 +0000 (21:37 +0200)] 
home: Remove circular header dependencies

7 months agocore: Remove circular dependencies between headers
Daan De Meyer [Fri, 18 Apr 2025 18:53:51 +0000 (20:53 +0200)] 
core: Remove circular dependencies between headers

Currently there are various circular dependencies between headers
in core/. Let's get rid of these by making judicious use of forward
declarations and moving includes into implementation files instead of
having them in header files.

Getting rid of circular header includes simplifies the code and makes
various clang based tooling such as iwyu work much better on our code.

The most important change is getting rid of the manager.h include in
unit.h which is possible thanks to the previous commits. We also move
the OOMPolicy and StatusType enums to unit.h to remove the need for
other unit headers to include manager.h to get access to these enums.

7 months agocore: Turn manager unit log fields into unit functions
Daan De Meyer [Fri, 18 Apr 2025 14:37:50 +0000 (16:37 +0200)] 
core: Turn manager unit log fields into unit functions

There's no need for these to be fields inside the manager struct,
let's turn them into functions in unit.h instead, again to allow
forward declaring the Manager struct in a later commit.

7 months agoshared: Remove circular dependency between image-policy.h and dissect-image.h
Daan De Meyer [Fri, 18 Apr 2025 19:19:07 +0000 (21:19 +0200)] 
shared: Remove circular dependency between image-policy.h and dissect-image.h

ImagePolicy can just be a forward declaration in dissect-image.h.

7 months agosd-bus: Get rid of circular dependency between sd-bus.h and sd-bus-vtable.h
Daan De Meyer [Fri, 18 Apr 2025 14:45:55 +0000 (16:45 +0200)] 
sd-bus: Get rid of circular dependency between sd-bus.h and sd-bus-vtable.h

Let's move more types to sd-bus-protocol.h so we can get rid of the
circular include between sd-bus-vtable.h and sd-bus.h.

7 months agoman,network: fix typo
Yu Watanabe [Wed, 23 Apr 2025 04:42:09 +0000 (13:42 +0900)] 
man,network: fix typo

Follow-up for a06e88426444ac50fde712e426ec9a4234ae5576.

7 months agocore/manager: assume availability of all RT signals
Mike Yuan [Tue, 22 Apr 2025 22:26:49 +0000 (00:26 +0200)] 
core/manager: assume availability of all RT signals

Our kernel baseline is v5.4 now.

7 months agonetwork: enable ARP when IPv4LL and/or IPv4ACD is enabled (#37190)
Yu Watanabe [Tue, 22 Apr 2025 23:53:49 +0000 (08:53 +0900)] 
network: enable ARP when IPv4LL and/or IPv4ACD is enabled (#37190)

7 months agosd-device: fix sysname check in sd_device_new_from_subsystem_sysname()
Yu Watanabe [Tue, 22 Apr 2025 15:13:51 +0000 (00:13 +0900)] 
sd-device: fix sysname check in sd_device_new_from_subsystem_sysname()

For example, consider the following device:
- syspath: /sys/bus/mdio_bus/drivers/Qualcomm Atheros AR8031!AR8033
- subsystem: "drivers"
- driver subsystem: "mdio_bus"
- sysname: "Qualcomm Atheros AR8031/AR8033"  <-- '!' is replaced with '/'

When sd_device_new_from_subsystem_sysname() is called to get the device,
the arguments to sd_device_new_from_subsystem_sysname() should be
- subsystem: "drivers"
- sysname (concatenated with driver subsystem): "mdio_bus:Qualcomm Atheros AR8031/AR8033"

In that case, we need to pass to device_new_from_path_join() the following:
- subsystem: "drivers"
- driver subsystem: "mdio_bus"
- sysname: "Qualcomm Atheros AR8031/AR8033"
- a: "/sys/bus"
- b: "drivers"
- c: "mdio_bus"
- d: "Qualcomm Atheros AR8031!AR8033"
Here, the important point is that the `sysname` argument and the
last argument `d` are differnt: the `sysname` argument needs to match
the sysname obtained by `sd_device_get_sysname()`, but `d` must be
the last path component of the syspath.

Previously, we passed a wrong sysname to device_new_from_path_join().
This fixes the issue.

Fixes a bug in cd7c71154cd62d3f50c07ce387edd9c20aebd7bc (v257).

7 months agomkosi: Add extra packages to the tools tree (#37218)
Yu Watanabe [Tue, 22 Apr 2025 23:51:44 +0000 (08:51 +0900)] 
mkosi: Add extra packages to the tools tree (#37218)

7 months agocore: add concurrency limits to slice units (#36831)
Lennart Poettering [Tue, 22 Apr 2025 18:44:04 +0000 (20:44 +0200)] 
core: add concurrency limits to slice units (#36831)

I needed something to hack on "offline", during a long transatlantic
flight. I decided to implement #35862, since I could do that without
checking any online docs nor needing GitHub.

7 months agoupdate TODO 36831/head
Lennart Poettering [Sat, 22 Mar 2025 12:10:04 +0000 (13:10 +0100)] 
update TODO

7 months agotest: add integration test for concurrency limits
Lennart Poettering [Tue, 1 Apr 2025 10:53:32 +0000 (12:53 +0200)] 
test: add integration test for concurrency limits

7 months agopid1: add a concurrency limit to slice units
Lennart Poettering [Fri, 21 Mar 2025 17:01:16 +0000 (18:01 +0100)] 
pid1: add a concurrency limit to slice units

Fixes: #35862
7 months agoman: explain coredump handling in context of containers better
Lennart Poettering [Wed, 16 Apr 2025 13:32:45 +0000 (15:32 +0200)] 
man: explain coredump handling in context of containers better

We have two different mechanisms, let's discuss them explicitly,
comparing their effect and intended usecase.

7 months agoudev: serialize queued events on exit (#37047)
Daan De Meyer [Tue, 22 Apr 2025 08:54:25 +0000 (10:54 +0200)] 
udev: serialize queued events on exit (#37047)

Previously, all queued events were discarded on exit, hence several
events might not be processed by udevd when it is restarted. Such
situation especially easily happens on switching root.

This makes queued events serialized on exit, and deserialized in the
next invocation. Hence, no events should be lost during restarting
udevd.

This is important with the several aspects. Basically
systemd-udev-trigger.service (re)triggers all devices anyway after
switching root, But the service may be disabled or modified by admin.
Moreover, the service produces only 'add' events, and thus the service
cannot cover events with other actions generated by the kernel during
switching root. Also, the userspace triggered events may not contain
some parameters compared with events triggered by the kernel.

7 months agoSeveral preparation for killing SysV compat (#37207)
Daan De Meyer [Tue, 22 Apr 2025 08:13:44 +0000 (10:13 +0200)] 
Several preparation for killing SysV compat (#37207)

7 months agomeson: use deprecated tag for dns-over-tls and cryptolib meson options
Yu Watanabe [Mon, 21 Apr 2025 04:26:27 +0000 (13:26 +0900)] 
meson: use deprecated tag for dns-over-tls and cryptolib meson options

Follow-up for #36937.

7 months agotest-specifier: replace /dev/initctl with /dev/fd 37207/head
Yu Watanabe [Tue, 22 Apr 2025 00:24:39 +0000 (09:24 +0900)] 
test-specifier: replace /dev/initctl with /dev/fd

To make the test work even when systemd is built without SysV compat.

7 months agotest: drop nonexistent units from test-unit-name
Yu Watanabe [Mon, 21 Apr 2025 01:04:51 +0000 (10:04 +0900)] 
test: drop nonexistent units from test-unit-name

The test does not request each unit file exists, but keeping legacy unit
names in test sounds spurious. Let's remove them. Hopefully we still
have enough test cases.

7 months agoman/systemd: drop explanation about SysV compatibilities
Yu Watanabe [Mon, 21 Apr 2025 01:51:36 +0000 (10:51 +0900)] 
man/systemd: drop explanation about SysV compatibilities

Sooner or later, we will drop the explained SysV compatibilities.
Let's remove them from the man page now to make not people rely on that.

7 months agoman/systemd: fix mapping from SysV runlevel to actual target name
Yu Watanabe [Mon, 21 Apr 2025 01:50:57 +0000 (10:50 +0900)] 
man/systemd: fix mapping from SysV runlevel to actual target name

See runlevel_to_target() in src/shared/unit-file.c.

7 months agounit-file: use STRV_FOREACH_PAIR() macro at one more place
Yu Watanabe [Mon, 21 Apr 2025 02:02:13 +0000 (11:02 +0900)] 
unit-file: use STRV_FOREACH_PAIR() macro at one more place

7 months agoman/systemctl: list-sockets command sorts the result
Yu Watanabe [Sun, 20 Apr 2025 20:30:09 +0000 (05:30 +0900)] 
man/systemctl: list-sockets command sorts the result

This updates the example output of list-sockets command.

7 months agocore: kill StartAuxiliaryScope() DBus method (#37184)
Yu Watanabe [Tue, 22 Apr 2025 01:18:06 +0000 (10:18 +0900)] 
core: kill StartAuxiliaryScope() DBus method (#37184)

This removes StartAuxiliaryScope() DBus method as already planned and
announced.
This effectively reverts #28836.

7 months agoNEWS: mention org.freedesktop.systemd1.StartAuxiliaryScope() has been removed 37184/head
Yu Watanabe [Fri, 18 Apr 2025 21:37:20 +0000 (06:37 +0900)] 
NEWS: mention org.freedesktop.systemd1.StartAuxiliaryScope() has been removed

7 months agocore: remove deprecated StartAuxiliaryScope() DBus method
Yu Watanabe [Fri, 18 Apr 2025 20:03:41 +0000 (05:03 +0900)] 
core: remove deprecated StartAuxiliaryScope() DBus method

The method is deprecated since 64f173324ec98dc74a3057b6b36c1f24e882182e
(v257) and announced that it will be removed in v258.
Let's remove it now.

This effectively reverts 84c01612de805d88875d4d91cfcf73cf10f99447.

7 months agoRevert "tests: add test for StartAuxiliaryScope()"
Yu Watanabe [Fri, 18 Apr 2025 21:35:08 +0000 (06:35 +0900)] 
Revert "tests: add test for StartAuxiliaryScope()"

This reverts commit fd7fd59b6dc81a0a0e3f5e40e085c51c16fa7eec.

The DBus method StartAuxiliaryScope() will be removed in the next
commit.

7 months agocgroup-util: drop cg_freezer_supported() and cg_ns_supported() (#37201)
Yu Watanabe [Mon, 21 Apr 2025 23:58:52 +0000 (08:58 +0900)] 
cgroup-util: drop cg_freezer_supported() and cg_ns_supported() (#37201)

7 months agocore/cgroup: actually apply BPF everywhere
Mike Yuan [Mon, 21 Apr 2025 14:55:34 +0000 (16:55 +0200)] 
core/cgroup: actually apply BPF everywhere

Follow-up for f1c5534eb61a1abcac62d67d57ef2f0715073819

The previous logic was an OR, i.e. as long as we're running
in unified mode BPF is applied. The offending commit
spuriously excluded local root.

While at it, remove check for cgv1 CGROUP_MASK_DEVICES controller.

7 months agocgroup-util: drop now unused cg_ns_supported() 37201/head
Mike Yuan [Fri, 18 Apr 2025 19:57:13 +0000 (21:57 +0200)] 
cgroup-util: drop now unused cg_ns_supported()

7 months agonspawn: use namespace_type_supported()
Mike Yuan [Fri, 18 Apr 2025 19:56:26 +0000 (21:56 +0200)] 
nspawn: use namespace_type_supported()

7 months agonamespace-util: generalize namespace_type_supported()
Mike Yuan [Fri, 18 Apr 2025 19:55:27 +0000 (21:55 +0200)] 
namespace-util: generalize namespace_type_supported()

7 months agocgroup-util: drop cg_freezer_supported(), assume supported
Mike Yuan [Wed, 15 Jan 2025 21:05:56 +0000 (22:05 +0100)] 
cgroup-util: drop cg_freezer_supported(), assume supported

7 months agoman/sd-bus: Add at least one reference per sd-bus function man page
igo95862 [Sun, 20 Apr 2025 16:02:01 +0000 (17:02 +0100)] 
man/sd-bus: Add at least one reference per sd-bus function man page

Some sd-bus man pages did not have any references on the main
 sd-bus man page. Unless you accidentally stumbled on them from
other pages  it was difficult to discover them.

7 months agoman/sd_bus_emit_signal: Fix extra const for strv functions
igo95862 [Sun, 20 Apr 2025 15:14:23 +0000 (16:14 +0100)] 
man/sd_bus_emit_signal: Fix extra const for strv functions

The functions `sd_bus_emit_interfaces_added_strv`, `sd_bus_emit_interfaces_removed_strv`
and `sd_bus_emit_properties_changed_strv` take an `char **` not
`const char **` as last argument.

See `src/systemd/sd-bus.h` for the function definition.

7 months agossh-proxy: use % as an alternative separator
Yu Watanabe [Sun, 20 Apr 2025 02:11:07 +0000 (11:11 +0900)] 
ssh-proxy: use % as an alternative separator

Since OpenSSH 10.0p1, specifically
https://anongit.mindrot.org/openssh.git/commit/?id=487cf4c18c123b66c1f3f733398cd37e6b2ab6ab
ssh refuses comma in hostname by default.

Let's use % as an alternative separator.

Follow-up for defd5060d69ba31c1815e7d5427bde93a3db88c0.

7 months agodocs/MEMORY_PRESSURE: Replace incorrect "packages" with correct "pages"
Alexander Kurtz [Sun, 20 Apr 2025 08:31:22 +0000 (10:31 +0200)] 
docs/MEMORY_PRESSURE: Replace incorrect "packages" with correct "pages"

7 months agonetwork: enable ARP= when IPv4LL/IPv4ACD is enabled 37190/head
Yu Watanabe [Sun, 20 Apr 2025 01:23:32 +0000 (10:23 +0900)] 
network: enable ARP= when IPv4LL/IPv4ACD is enabled

We can run sd-ipv4ll/sd-ipv4acd also on an interface with IFF_NOARP
flag, but that may cause address conflict with other hosts.
Let's enable ARPing when sd-ipv4ll/sd-ipv4acd are enabled unless ARP= is
explicitly disabled.

7 months agonetwork/ipv4ll: introduce ipv4ll_start() helper function
Yu Watanabe [Sun, 20 Apr 2025 01:46:36 +0000 (10:46 +0900)] 
network/ipv4ll: introduce ipv4ll_start() helper function

No effective functional change. Just refactoring.

7 months agonetwork/link: move logging
Yu Watanabe [Sun, 20 Apr 2025 00:31:32 +0000 (09:31 +0900)] 
network/link: move logging

7 months agoAdd two new paragraphs to coding style about header files (#37188)
Yu Watanabe [Sat, 19 Apr 2025 11:46:02 +0000 (20:46 +0900)] 
Add two new paragraphs to coding style about header files (#37188)

7 months agodocs: Add note to keep header files as lean as possible to CODING_STYLE.md 37188/head
Daan De Meyer [Sat, 19 Apr 2025 08:22:37 +0000 (10:22 +0200)] 
docs: Add note to keep header files as lean as possible to CODING_STYLE.md

7 months agodocs: Add paragraph about circular includes to CODING_STYLE.md
Daan De Meyer [Sat, 19 Apr 2025 08:11:12 +0000 (10:11 +0200)] 
docs: Add paragraph about circular includes to CODING_STYLE.md

7 months agomkosi: Add clang tools and iwyu to tools tree 37218/head
Daan De Meyer [Fri, 18 Apr 2025 14:03:09 +0000 (16:03 +0200)] 
mkosi: Add clang tools and iwyu to tools tree

7 months agomkosi: Replace base-devel with base in arch tools packages
Daan De Meyer [Fri, 18 Apr 2025 13:59:41 +0000 (15:59 +0200)] 
mkosi: Replace base-devel with base in arch tools packages

base-devel pulls in a bit too much, especially for NO_BUILD builds
so let's use base instead.

7 months agoNEWS: mention that F20 and friends has been replaced with micmute and so on
Yu Watanabe [Fri, 18 Apr 2025 20:30:28 +0000 (05:30 +0900)] 
NEWS: mention that F20 and friends has been replaced with micmute and so on

Follow-up for #34325.

7 months agobootctl: fix typo
Yu Watanabe [Fri, 18 Apr 2025 19:49:11 +0000 (04:49 +0900)] 
bootctl: fix typo

Follow-up for bbeeea43625d22d2ab92b26ed93378acbad8ca66.

7 months agologind: drop session fifo logic, rely solely on pidfd for exit notification
Mike Yuan [Wed, 8 Jan 2025 12:50:35 +0000 (13:50 +0100)] 
logind: drop session fifo logic, rely solely on pidfd for exit notification

Traditionally, logind installed a fifo in the PAM session and
used EOF on the fd as signal for session close. With the addition of
pidfd (76f2191d8eb54d7b9e39ab230c9c62b8a8c42265) however,
logind tracks the leader process and the session is terminated
as soon as that exits. I think the new behavior generally makes
more sense, and the behavior got changed *in the mentioned commit
already* without anyone ever showing up to complain. It hence
feels safe to kill the concept now (also before the varlink interface
gets rolled out).

Note that the 'PID' field in CreateSession() Varlink method
is now marked as strict, i.e. failure to acquire pidfd
is immediately treated as fatal.

7 months agologin: replace tabs with spaces in example polkit rule
Mike Yuan [Fri, 18 Apr 2025 17:21:24 +0000 (19:21 +0200)] 
login: replace tabs with spaces in example polkit rule

7 months agoTEST-17-UDEV: add test case for queued events serialization/deserialization 37047/head
Yu Watanabe [Mon, 7 Apr 2025 10:19:47 +0000 (19:19 +0900)] 
TEST-17-UDEV: add test case for queued events serialization/deserialization

7 months agoudev: serialize queued events on exit, and deserialize them in the next invocation
Yu Watanabe [Sat, 5 Apr 2025 13:42:26 +0000 (22:42 +0900)] 
udev: serialize queued events on exit, and deserialize them in the next invocation

To make systemd-udevd not lose received uevents on restart. This may be
important on switching root, even though we typically trigger all devices
after switching root by systemd-udev-trigger.service, but it may be
disabled or modified by admin.

7 months agoresolve,import: always use openssl (#36937)
Daan De Meyer [Fri, 18 Apr 2025 13:30:33 +0000 (15:30 +0200)] 
resolve,import: always use openssl (#36937)

7 months agoVarious changes made as part of trying to run include-what-you-use on the systemd...
Daan De Meyer [Fri, 18 Apr 2025 13:07:33 +0000 (15:07 +0200)] 
Various changes made as part of trying to run include-what-you-use on the systemd repository (#37112)

I have been trying to run
https://github.com/include-what-you-use/include-what-you-use on the
systemd repository to hopefully get a handle on the rampant numbers of
includes we have in every file with no idea if any of the symbols coming
from that file are used or not.

While I haven't got it fully working yet, these changes still make sense
IMO and can be merged already.

Except the last commit, all other changes are about removing circular
dependencies between headers which trips up include-what-you-use.
Regardless of the tool, circular dependencies between headers are a code
smell and I think we should get rid of them regardless of whether we end
up using the tool or not.

7 months agotree-wide: Mark linux and sys includes as system includes 37112/head
Daan De Meyer [Sat, 12 Apr 2025 17:36:48 +0000 (19:36 +0200)] 
tree-wide: Mark linux and sys includes as system includes

Even though these are in our tree, we should still treat them as
system includes which helps various tools (clangd, iwyu, ...) understand
that these are system includes and <> should be used instead of "".

7 months agotree-wide: Remove references to src/shared/linux
Daan De Meyer [Thu, 17 Apr 2025 19:19:12 +0000 (21:19 +0200)] 
tree-wide: Remove references to src/shared/linux

This directory doesn't exist anymore.

7 months agobasic: Remove circular dependency between process-util.h and pidref.h
Daan De Meyer [Sat, 12 Apr 2025 17:45:49 +0000 (19:45 +0200)] 
basic: Remove circular dependency between process-util.h and pidref.h

7 months agobasic: Remove circular dep between alloc-util.h and memory-util.h
Daan De Meyer [Sat, 12 Apr 2025 14:59:43 +0000 (16:59 +0200)] 
basic: Remove circular dep between alloc-util.h and memory-util.h

7 months agobasic: Move macro.h include in list.h to the top of the file
Daan De Meyer [Sat, 12 Apr 2025 14:50:36 +0000 (16:50 +0200)] 
basic: Move macro.h include in list.h to the top of the file

Now that the circular dependency between log.h, macro.h and list.h
is gone, we can move the include to the top.

7 months agobasic: Stop including log.h in macro.h
Daan De Meyer [Sat, 12 Apr 2025 14:47:29 +0000 (16:47 +0200)] 
basic: Stop including log.h in macro.h

Now that the necessary functions from log.h have been moved to macro.h,
we can stop including log.h in macro.h. This requires modifying source
files all over the tree to include log.h instead.

7 months agofundamental: Always use _Static_assert for assert_cc()
Daan De Meyer [Fri, 18 Apr 2025 09:50:18 +0000 (11:50 +0200)] 
fundamental: Always use _Static_assert for assert_cc()

Let's get rid of the assert.h include in macro-fundamental.h by always
using the builtin. Behavior is unchanged.

7 months agobasic: Move assertion specific functions to assert-util.h
Daan De Meyer [Sat, 12 Apr 2025 12:14:04 +0000 (14:14 +0200)] 
basic: Move assertion specific functions to assert-util.h

Various functions in log.h are only used by asserts, and there's
enough assertion related stuff in macro.h to justify a separate header
which also makes it easier to avoid circular dependencies.

Let's introduce assert-util.h and an accompanying fundamental header
and move all the assertion related stuff over there. PROJECT_FILE is
moved over to macro.h.

7 months agofundamental: Move alignment logic to memory-util-fundamental.h
Daan De Meyer [Fri, 18 Apr 2025 09:26:43 +0000 (11:26 +0200)] 
fundamental: Move alignment logic to memory-util-fundamental.h

Aligning is closely related to memory management, so let's move these
macros and functions to memory-util-fundamental.h. This will allow us
to move assertion related logic out of macro-fundamental.h as well in
a later commit.

7 months agomacro: Move definition of dummy_t to macro-fundamental.h
Daan De Meyer [Sat, 12 Apr 2025 12:04:19 +0000 (14:04 +0200)] 
macro: Move definition of dummy_t to macro-fundamental.h

There is code in macro-fundamental.h that makes use of dummy_t so
let's make sure to declare dummy_t in macro-fundamental.h as well.

7 months agobasic: Remove stdio-util.h include from log.h
Daan De Meyer [Sat, 12 Apr 2025 09:28:27 +0000 (11:28 +0200)] 
basic: Remove stdio-util.h include from log.h

7 months agobasic: Remove list.h include from log.h
Daan De Meyer [Sat, 12 Apr 2025 09:22:52 +0000 (11:22 +0200)] 
basic: Remove list.h include from log.h

7 months agobasic: Move trivial cleanup/ref/unref macros from macro.h to memory-util.h
Daan De Meyer [Fri, 18 Apr 2025 09:01:10 +0000 (11:01 +0200)] 
basic: Move trivial cleanup/ref/unref macros from macro.h to memory-util.h

Let's keep macro.h for the extremely generic macros that don't fit anywhere
else. Since CLEANUP_ARRAY() is already in memory-util-fundamental.h, we can
make a good case for moving the other cleanup macros in there as well.

7 months agossh-proxy: add scp and rsync support
Matthieu Baerts (NGI0) [Mon, 7 Apr 2025 15:10:29 +0000 (17:10 +0200)] 
ssh-proxy: add scp and rsync support

ssh-generator and ssh-proxy are great features, it is very handy to be
able to do:

    ssh vsock/1

But, because of the '/' used as a separator, scp and rsync don't
interpret 'vsock/<CID>' as a hostname, e.g.

    $ scp /etc/machine-id vsock/2222:.
    cp: cannot create regular file 'vsock/2222:.': No such file or directory

    $ rsync /etc/machine-id vsock/2222:.
    rsync: [Receiver] change_dir#3 "(...)/vsock" failed: No such file or directory (2)
    rsync error: errors selecting input/output files, dirs (code 3) at main.c(829) [Receiver=3.4.1]

An alternative is to use ',' as separator, e.g.

    $ scp /etc/machine-id vsock,2222:.

This is what is being suggested here. The names with '/' are kept not to
break anything here.

Others are possible: '%', '=', '#', '@', ':', etc. As mentioned in
commit 0abd510f7f ("ssh-proxy: add ssh ProxyCommand tool that can
connect to AF_UNIX + AF_VSOCK sockets"), it is better to avoid ':' as it
is already taken by SSH itself when doing sftp, and "@" is already taken
for separating the user name. '#' will cause some issues with some
shells like ZSH when quotes are not used.

7 months agobasic: Move log context functions to log-context.h
Daan De Meyer [Fri, 18 Apr 2025 08:47:23 +0000 (10:47 +0200)] 
basic: Move log context functions to log-context.h

7 months agohwdb: add G-Mode key support (#37175)
Marcos Alano [Fri, 18 Apr 2025 08:43:26 +0000 (05:43 -0300)] 
hwdb: add G-Mode key support (#37175)

Add G-Mode key, usually Fn+F9.

Closes #30824

7 months agohashmap: kill hashmap_free_with_destructor() and friends (#37111)
Yu Watanabe [Fri, 18 Apr 2025 08:40:51 +0000 (17:40 +0900)] 
hashmap: kill hashmap_free_with_destructor() and friends (#37111)

Now destructor is always set in hash_ops when necessary. Hence,
hashmap_free_with_destructor() and friends are not necessary anymore.
Let's kill them.

7 months agobasic: Move ratelimit logging functions to ratelimit.h
Daan De Meyer [Sat, 12 Apr 2025 09:16:49 +0000 (11:16 +0200)] 
basic: Move ratelimit logging functions to ratelimit.h

The ratelimit logging functions are only useful in a few scenarios
so let's move them to ratelimit.h instead of keeping them in the
generic log.h

7 months agomeson: build tests for nspawn even -Dnspawn= is disabled
Yu Watanabe [Wed, 16 Apr 2025 14:43:33 +0000 (23:43 +0900)] 
meson: build tests for nspawn even -Dnspawn= is disabled

Follow-up for d95818f5221d9b9b19648cffa0cb2407f023b27e.
Fixes #36880.

7 months agoudev: several follow-ups for recent change about listening fds (#37162)
Zbigniew JÄ™drzejewski-Szmek [Fri, 18 Apr 2025 06:48:08 +0000 (08:48 +0200)] 
udev: several follow-ups for recent change about listening fds (#37162)

7 months agoNEWS: mention integration-tests meson option is deprecated
Yu Watanabe [Fri, 18 Apr 2025 00:35:54 +0000 (09:35 +0900)] 
NEWS: mention integration-tests meson option is deprecated

Follow-up for 710653d3bcc46d6c45d8771e0a74c8d5f6328bc4.

7 months agonetwork: update comment as hashmap_free_with_destructor() does not exist anymore 37111/head
Yu Watanabe [Sat, 12 Apr 2025 19:18:28 +0000 (04:18 +0900)] 
network: update comment as hashmap_free_with_destructor() does not exist anymore

7 months agohashmap: drop hashmap_free_with_destructor() and friends
Yu Watanabe [Sat, 12 Apr 2025 19:21:46 +0000 (04:21 +0900)] 
hashmap: drop hashmap_free_with_destructor() and friends

7 months agohashmap: drop unused free func arguments in hashmap_free() and hashmap_clear()
Yu Watanabe [Fri, 11 Apr 2025 03:11:49 +0000 (12:11 +0900)] 
hashmap: drop unused free func arguments in hashmap_free() and hashmap_clear()

7 months agoset: drop unused set_free_free()
Yu Watanabe [Fri, 11 Apr 2025 03:11:24 +0000 (12:11 +0900)] 
set: drop unused set_free_free()