]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 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()

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

6 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()

6 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

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

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

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

6 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"

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

6 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

6 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

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

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

Follow-up for bbeeea43625d22d2ab92b26ed93378acbad8ca66.

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

6 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

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

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

6 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 "".

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

6 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

6 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

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

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

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

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

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

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

6 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

6 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

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

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

6 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

6 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

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

6 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

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

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

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

6 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

6 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

6 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()

6 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()

6 months agotest: make the copied set not take the ownership of elements
Yu Watanabe [Fri, 11 Apr 2025 03:00:51 +0000 (12:00 +0900)] 
test: make the copied set not take the ownership of elements

6 months agotest: use string_hash_ops_free
Yu Watanabe [Fri, 11 Apr 2025 02:56:57 +0000 (11:56 +0900)] 
test: use string_hash_ops_free

6 months agodaemon-util: remove existing fds with the same name from fdstore 37162/head
Yu Watanabe [Fri, 18 Apr 2025 00:00:35 +0000 (09:00 +0900)] 
daemon-util: remove existing fds with the same name from fdstore

Currently, all use cases of notify_push_fd()/notify_push_fdf()
assume that the name of each fd in the fdstore is unique.
For safety, let's remove the existing fds before pushing a new one
to avoid multiple fds with the same name stored in the fdstore.

6 months agoudev: re-add unintentionally dropped error log
Yu Watanabe [Wed, 16 Apr 2025 19:12:27 +0000 (04:12 +0900)] 
udev: re-add unintentionally dropped error log

Follow-up for 9b6bf4e10e7464784609989c77b6a6fb1d38066e.

6 months agorules: Make ADB and fastboot work out-of-the-box
LuK1337 [Tue, 1 Apr 2025 20:23:06 +0000 (22:23 +0200)] 
rules: Make ADB and fastboot work out-of-the-box

https://android.googlesource.com/platform/packages/modules/adb/+/d0db47dcdf941673f405e1095e6ffb5e565902e5/adb.h#199
https://android.googlesource.com/platform/system/core/+/7199051aaf0ddfa2849650933119307327d8669c/fastboot/fastboot.cpp#244

6 months agoshutdown: handle gracefully if a device disappears while we detach it
Lennart Poettering [Thu, 17 Apr 2025 12:39:34 +0000 (14:39 +0200)] 
shutdown: handle gracefully if a device disappears while we detach it

Let's gracefully handle cases where a device disappears in the time we
between our discovery and when we want to detach it, due to "auto-clear"
or a similar logic.

The loopback case already handled this quite OK, do the same for MD and
swap too.

Switch to ERRNO_IS_DEVICE_ABSENT() for all checks, just in case.

Also improve debug logging for all these cases, so we know exactly what
is going on.

This is inspired by #37160, but shouldn't really fix anything there, I
am pretty sure the ENODEV seen in that output stems from the STOP_ARRAY
call, not from the open().

Note that this does not change anything for the device mapper case,
because the DM subsystem does not return useful error codes to
userspace, hence everything is a complete mess there.

6 months agonetwork/manager: hash_ops related cleanups (#37121)
Yu Watanabe [Thu, 17 Apr 2025 21:00:15 +0000 (06:00 +0900)] 
network/manager: hash_ops related cleanups (#37121)

6 months agonetwork/network: hash_ops related cleanups (#37120)
Yu Watanabe [Thu, 17 Apr 2025 20:59:47 +0000 (05:59 +0900)] 
network/network: hash_ops related cleanups (#37120)

6 months agomisc: hash_ops related cleanups (#37117)
Yu Watanabe [Thu, 17 Apr 2025 20:59:15 +0000 (05:59 +0900)] 
misc: hash_ops related cleanups (#37117)

6 months agolibudev: several trivial cleanups (#37106)
Yu Watanabe [Thu, 17 Apr 2025 20:58:41 +0000 (05:58 +0900)] 
libudev: several trivial cleanups (#37106)

6 months agomissing_fcntl: Introduce O_ACCMODE_STRICT
Stefan Hansson [Sun, 13 Apr 2025 18:35:49 +0000 (20:35 +0200)] 
missing_fcntl: Introduce O_ACCMODE_STRICT

On musl, O_ACCMODE is defined as (03|O_SEARCH), unlike glibc which
defines it as (O_RDONLY|O_WRONLY|O_RDWR). Additionally, O_SEARCH is
simply defined as O_PATH.

This causes problems for systemd on musl, as it changes the
behaviour of open_mkdir_at_full() to return -EINVAL if O_PATH is
included in flags due to the fact that O_ACCMODE includes O_SEARCH
(i.e. O_PATH). Consequently, this makes the test-fs-util test fail.

Upstream musl seems content with this behaviour and doesn't seem
interested in matching glibc's behaviour due to that defining it this
way allows for O_SEARCH to match POSIX better by allowing it to open
directories where read permission is missing. Apparently musl does some
emulation in other places to make this work more consistently as well.

Initially I took the approach of working around this by redefining
O_SEARCH as O_RDONLY if O_SEARCH == O_PATH. This fixes the test and is
the approach taken by both XZ[1] and Gzip[2][3], but was not taken as
redefining system headers potentially could be problematic.

Instead, introduce O_ACCMODE_STRICT which just is a copy of glibc's
O_ACCMODE and use it everywhere. This way we don't have to deal with
unusual definitions of O_ACCMODE from C standard libraries other than
glibc.

 [1]: https://git.tukaani.org/?p=xz.git;a=blob;f=src/xz/file_io.c;h=8c83269b13fa31284f7ea5f3627a1dfbce7d6e14;hb=HEAD#l72
 [2]: https://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/fcntl.in.h
      (lines 380 and 396, commit d7f551b30f3f2a0fa57c1b10c12f4eea41a9b89e)
 [3]: https://lists.gnu.org/archive/html/bug-gzip/2025-01/msg00000.html

6 months agotest: Use meson add_test_setup() instead of environment variables
Daan De Meyer [Thu, 17 Apr 2025 11:29:16 +0000 (13:29 +0200)] 
test: Use meson add_test_setup() instead of environment variables

We add a default test setup that excludes the integration-tests suite
so that the integration tests don't run by default. This allows us to
get rid of $SYSTEMD_INTEGRATION_TESTS. Then, we add two extra setups:
'integration' and 'shell'. The 'integration' setup does not exclude the
integration-tests suite, and so can be used to run the integration tests.
The 'shell' setup does the same, but additionally sets $TEST_SHELL=1,
allowing to get rid of $TEST_SHELL in the docs.

6 months agomkosi: update mkosi commit reference to dbb4020beee2cdf250f93a425794f1cf8b0fe693
Daan De Meyer [Thu, 17 Apr 2025 14:02:47 +0000 (16:02 +0200)] 
mkosi: update mkosi commit reference to dbb4020beee2cdf250f93a425794f1cf8b0fe693

dbb4020bee mkosi: Use tools tree by default in repository config
a2407a305c dnf: Stop messing around with plugins
eee382ebc6 Fix mkosi help
8d4f9969bb mkosi-obs: simplify generation of signed UEFI auth files
*   364dfc65eb Merge pull request #3661 from septatrix/ssh-runtime
|\
| * ab3b52841c Improve Ssh= documentation
| * 79878d7e6c Add new Ssh=auto and Ssh=runtime options
*   49036322c2 Merge pull request #3682 from DaanDeMeyer/history
|\
| * 96e512fe6e installer: Make sure package manager state is preserved in the image
| * b859a7cf0a Only copy repository metadata from specific subdirs from /var
| * c8bf8e4278 Rename cache_subdirs() to package_subdirs()
* |   54b59c4a2e Merge pull request #3696 from DaanDeMeyer/history-cli
|\ \
| * | 898d89e887 Rework version bumping
| * | cc45fe3bad Only write CLI arguments to history instead of full config
| * | 1def443097 Disallow using --rerun-build-scripts with --force again
| * | 87b03ee264 Rename get_configdir() to finalize_configdir()
| * | 9c1217a217 Get rid of to_json() methods on Args and Config
| |/
* | 124f551e77 mkosi-obs: do not publish roothash
* | fc86100e51 mkosi-obs: append certs from mkosi.uefi.db/ to 'db'
* | 8bee4cb8e2 Make sure sync scripts are executable
|/
a7e90514fa Simplify tools tree out of date error
f9956daba7 Fail if --rerun-build-scripts is used and tools is out of date
d94bf56ae8 mkosi-initrd: add specific configuration for plymouth in Debian
8235ddbc5b Take shared lock in copy_ephemeral()
19c74d5ba5 Two follow ups for #3678
*   0d6f15e8c3 Merge pull request #3678 from DaanDeMeyer/history
|\
| * 5410c4c7af tests: Require genkey to be run once upfront
| * 86b8c611a1 tests: Drop unused tools field
| * c3d1bd0dde Rework history <=> sandbox integration
fce4db970f zypper: display debugging output if ARG_DEBUG is set
2c052b9d45 Allow PCR signing settings to be overridden in sub-images
00c220225b zypper: do not fail if a package configured to be removed is not found

6 months agoRevert "mkosi: temporarily disable panic_on_warn"
Luca Boccassi [Fri, 4 Apr 2025 12:48:31 +0000 (13:48 +0100)] 
Revert "mkosi: temporarily disable panic_on_warn"

The BRTFS issue that caused a spurious WARN has been fixed and
backported to Noble, so we can enable panic_on_warm again.

This reverts commit 930d65ccca8193a8cb635099c55852b677f5d58a.

6 months agonetlink-socket: extend comments a bit
Lennart Poettering [Thu, 17 Apr 2025 06:19:43 +0000 (08:19 +0200)] 
netlink-socket: extend comments a bit

Follow-up for 90755dac69dfb0c64e0e042aef0257c5dedb06c4.

6 months agomkosi: Rename mkosi.prepare scripts for systemd deps to systemd.prepare
Daan De Meyer [Thu, 17 Apr 2025 10:40:17 +0000 (12:40 +0200)] 
mkosi: Rename mkosi.prepare scripts for systemd deps to systemd.prepare

These scripts are reused by multiple images, so let's give them a
non-standard name to indicate that. Otherwise it's all too easy to add
something to mkosi.prepare for the main image and accidentally have it
included in all the subimages as well even though that's not desired.

6 months agosd-netlink: don't fail on netlink message truncation if we pass a zero sized buffer...
Zbigniew Jędrzejewski-Szmek [Thu, 17 Apr 2025 11:11:13 +0000 (13:11 +0200)] 
sd-netlink: don't fail on netlink message truncation if we pass a zero sized buffer (#37165)

Alternative to #37163

6 months agonetlink-socket: ignore ECHRNG/EXFULL errors from recvmsg_safe() if we expect truncation 37165/head
Lennart Poettering [Thu, 17 Apr 2025 06:19:43 +0000 (08:19 +0200)] 
netlink-socket: ignore ECHRNG/EXFULL errors from recvmsg_safe() if we expect truncation

When we receive a netlink messages from userspace we need to drop it
from the queue. Hence we need call recvmsg() on the socket for it. We do
this with a zero-size socket read() buffer, so that the message would be
truncated when copied to userspace, and we do not have to allocate any
memory for it, but it's still dropped.

This was broken in ad501930d749e00f9686d29692b3142c36914f31, which
turned datagram truncation into an error (rightfully so I think – for
the common case). That broke this code here, because here we *expect*
truncation, and need to handle it gracefully.

Hence simply check for the two error codes for truncated payload or
cdata, and eat it up.

6 months agoRevert "sd-netlink: prepare buffer for dropping unexpected message"
Lennart Poettering [Thu, 17 Apr 2025 06:15:11 +0000 (08:15 +0200)] 
Revert "sd-netlink: prepare buffer for dropping unexpected message"

This reverts commit bf478dcffbc3c568fb3a3c8e8b93b3e7b66f4228.

I think we should avoid allocating memory needlessly just to free it
again, in particular if this can be triggered by some rogue peer.

6 months agosd-netlink: prepare buffer for dropping unexpected message
Yu Watanabe [Wed, 16 Apr 2025 19:47:49 +0000 (04:47 +0900)] 
sd-netlink: prepare buffer for dropping unexpected message

Follow-up for c7460cce79fd358f2745bd390bd2e7ded450ee62 (v219).

Fixes #35654.

6 months agonetwork: fix handling of routing policy rule fwmask
Beniamino Galvani [Tue, 15 Apr 2025 20:13:11 +0000 (22:13 +0200)] 
network: fix handling of routing policy rule fwmask

The firewall mask should be applied even if the mark is 0, to allow defining a
value of e.g. 0/255.

Fixes #36973

6 months agoresolve: query the parent zone for DS records
MaxHearnden [Tue, 15 Apr 2025 00:16:48 +0000 (01:16 +0100)] 
resolve: query the parent zone for DS records

RFC 4035 Section 4.2 requires that missing DS records are queried for in
the parent zone rather than the child zone, the old behaviour could
cause subdomains under home.arpa (RFC 8375) to fail validation.

This commit assumes that QDCOUNT = 1 as per RFC 9619

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

6 months agonetwork/netdev: hash_ops related cleanups (#37119)
Yu Watanabe [Wed, 16 Apr 2025 18:22:36 +0000 (03:22 +0900)] 
network/netdev: hash_ops related cleanups (#37119)

6 months agonetwork/macsec: use hash_ops with destructor 37119/head
Yu Watanabe [Sat, 12 Apr 2025 17:20:24 +0000 (02:20 +0900)] 
network/macsec: use hash_ops with destructor

6 months agonetwork/macsec: replace security_association_init() with structured initializer
Yu Watanabe [Sat, 12 Apr 2025 17:18:50 +0000 (02:18 +0900)] 
network/macsec: replace security_association_init() with structured initializer

6 months agonetwork/wireguard: use hash_ops with destructor for managing WireguardPeer
Yu Watanabe [Sat, 12 Apr 2025 16:46:27 +0000 (01:46 +0900)] 
network/wireguard: use hash_ops with destructor for managing WireguardPeer

6 months agonetwork/l2tp: use hash_ops with destructor for managing sessions
Yu Watanabe [Sat, 12 Apr 2025 16:42:59 +0000 (01:42 +0900)] 
network/l2tp: use hash_ops with destructor for managing sessions

6 months agomkosi: Two improvements (#37155)
Daan De Meyer [Wed, 16 Apr 2025 13:12:15 +0000 (15:12 +0200)] 
mkosi: Two improvements (#37155)

6 months agomkosi: Reuse main image prepare scripts in subimages 37155/head
Daan De Meyer [Wed, 16 Apr 2025 12:04:33 +0000 (14:04 +0200)] 
mkosi: Reuse main image prepare scripts in subimages

In the subimages we also want to make sure all dependencies of the
systemd packages are cached so reuse the same prepare scripts from
the main image to do that.

We only want required dependencies in the subimages, not recommended
or suggested dependendencies, so add an environment variable
$SYSTEMD_REQUIRED_DEPS_ONLY which the prepare scripts can check for
and enable it for the subimages.

6 months agomkosi: Make sure coreutils is installed in initrd/exitrd
Daan De Meyer [Wed, 16 Apr 2025 12:20:41 +0000 (14:20 +0200)] 
mkosi: Make sure coreutils is installed in initrd/exitrd

This is already installed but Fedora/CentOS systems are nudged towards
installing coreutils-single which then later causes issues when we try
to install coreutils as a dependency of systemd so let's make sure we
pick coreutils from the beginning.

6 months agobootctl: replace --no-variables by --variables=BOOL
Lennart Poettering [Tue, 15 Apr 2025 15:20:07 +0000 (17:20 +0200)] 
bootctl: replace --no-variables by --variables=BOOL

I think the current behaviour of not doing EFI variables when we are run
in a container makes a ton of sense, but in some cases it's useful to
do EFI var setup even when a set of namespaces is set up for us, for
example to recover a hosed installation from a rescue disk.

While we are at it, let's remove some duplicate checks, and
systematically output information why we skip various operations.

Fixes: #36174 #35005
6 months agoelf2efi: Add back python 3.7 compat
Daan De Meyer [Wed, 16 Apr 2025 10:00:06 +0000 (12:00 +0200)] 
elf2efi: Add back python 3.7 compat

The walrus operator was introduced in python 3.9 so using it
accidentally bumped the minimum python version to 3.9 from 3.7 and
bluca still cares about keeping this working on 3.8 so let's remove
the usage of the walrus operator.

Follow up for d6a29eee2be6ec8ef1473b8097f6d0a2b9e09f4b

6 months agouse hashmap_dump_sorted() and friends at more several places (#37150)
Yu Watanabe [Wed, 16 Apr 2025 10:20:19 +0000 (19:20 +0900)] 
use hashmap_dump_sorted() and friends at more several places (#37150)

6 months agoupdate TODO
Lennart Poettering [Wed, 16 Apr 2025 08:48:31 +0000 (10:48 +0200)] 
update TODO

6 months agodocs: fix mkosi section for Environment= setting
Yu Watanabe [Tue, 15 Apr 2025 23:30:25 +0000 (08:30 +0900)] 
docs: fix mkosi section for Environment= setting

6 months agoconf-files: use hashmap_dump_sorted() at one more place 37150/head
Yu Watanabe [Tue, 15 Apr 2025 20:49:24 +0000 (05:49 +0900)] 
conf-files: use hashmap_dump_sorted() at one more place

6 months agoresolve: use set_dump_sorted() at one more place
Yu Watanabe [Tue, 15 Apr 2025 20:38:13 +0000 (05:38 +0900)] 
resolve: use set_dump_sorted() at one more place

6 months agoresolve: fix memleak
Yu Watanabe [Tue, 15 Apr 2025 20:28:22 +0000 (05:28 +0900)] 
resolve: fix memleak

Follow-up for 5c274555c3f6d5e188cb7e3e0adafa9ae55d5f49.

6 months agoxattr: fix assert that breaks importctl (#37146)
Luca Boccassi [Tue, 15 Apr 2025 21:44:24 +0000 (22:44 +0100)] 
xattr: fix assert that breaks importctl (#37146)

getxattr_at_malloc() calls getxattr_pinned_internal() with size 0 to get
the size of the xattr, and then asserts because n > 0
```
Assertion '(size_t) n <= size' failed at src/basic/xattr-util.c:107, function getxattr_pinned_internal().
```

Follow-up for b8df25dcfe674e37ceb3d54e00a31e1d33e96057

6 months agocore: remove cgroup v1 properties (#37026)
Yu Watanabe [Tue, 15 Apr 2025 21:22:46 +0000 (06:22 +0900)] 
core: remove cgroup v1 properties (#37026)

6 months agocgroup-setup: use path_join() to get path to cgroup attribute 37026/head
Yu Watanabe [Mon, 14 Apr 2025 21:12:05 +0000 (06:12 +0900)] 
cgroup-setup: use path_join() to get path to cgroup attribute

We already have the path to the cgroup. Hence, it is not necessary to
call cg_get_path() again.

6 months agocgroup-setup: drop unnecessary controller argument
Yu Watanabe [Sun, 6 Apr 2025 19:25:32 +0000 (04:25 +0900)] 
cgroup-setup: drop unnecessary controller argument

This also removes unnecessary cg_{create,attach,trim}_everywhere(),
and rename cg_enable_everywhere() -> cg_enable().

6 months agocgroup-setup: drop cgroup v1 support
Yu Watanabe [Sun, 6 Apr 2025 18:47:16 +0000 (03:47 +0900)] 
cgroup-setup: drop cgroup v1 support

6 months agocore: drop several more cgroup version check
Yu Watanabe [Tue, 15 Apr 2025 18:39:24 +0000 (03:39 +0900)] 
core: drop several more cgroup version check

6 months agocore/bpf-foreign: drop unnecessary check for cgroup v1
Yu Watanabe [Tue, 8 Apr 2025 08:37:11 +0000 (17:37 +0900)] 
core/bpf-foreign: drop unnecessary check for cgroup v1

6 months agocore/bpf-devices: drop cgroup v1 support
Yu Watanabe [Sun, 6 Apr 2025 19:43:36 +0000 (04:43 +0900)] 
core/bpf-devices: drop cgroup v1 support

6 months agocore/cgroup: drop cgroup v1 specific code in unit_update_cgroup()
Yu Watanabe [Tue, 15 Apr 2025 18:29:55 +0000 (03:29 +0900)] 
core/cgroup: drop cgroup v1 specific code in unit_update_cgroup()

6 months agocore/cgroup: drop unnecessary cgroup version check in several getters
Yu Watanabe [Sun, 6 Apr 2025 18:16:53 +0000 (03:16 +0900)] 
core/cgroup: drop unnecessary cgroup version check in several getters

After 2b61489e5a53eb2611e1e573519c209ca07de98e, these checks are not
necessary anymore.

6 months agocore/cgroup: drop unnecessary _unified_ modifier from function names
Yu Watanabe [Tue, 8 Apr 2025 08:16:56 +0000 (17:16 +0900)] 
core/cgroup: drop unnecessary _unified_ modifier from function names

6 months agocore/cgroup: remove logic of CGroup v1 attribute assignment
Yu Watanabe [Tue, 15 Apr 2025 18:19:16 +0000 (03:19 +0900)] 
core/cgroup: remove logic of CGroup v1 attribute assignment

6 months agocore/cgroup: remove unused legacy parameters in CGroupContext
Yu Watanabe [Sun, 6 Apr 2025 07:53:19 +0000 (16:53 +0900)] 
core/cgroup: remove unused legacy parameters in CGroupContext

6 months agocore/cgroup: remove CGroup v1 settings in dump message
Yu Watanabe [Sun, 6 Apr 2025 01:02:19 +0000 (10:02 +0900)] 
core/cgroup: remove CGroup v1 settings in dump message

6 months agobus-unit-util: refuse setting CGroup v1 properties through DBus
Yu Watanabe [Sun, 6 Apr 2025 02:08:10 +0000 (11:08 +0900)] 
bus-unit-util: refuse setting CGroup v1 properties through DBus

6 months agocore: deprecate CGroup v1 DBus properties
Yu Watanabe [Sun, 6 Apr 2025 01:22:12 +0000 (10:22 +0900)] 
core: deprecate CGroup v1 DBus properties

6 months agocore: remove deprecated CGroup v1 settings
Yu Watanabe [Sun, 6 Apr 2025 00:44:41 +0000 (09:44 +0900)] 
core: remove deprecated CGroup v1 settings

6 months agotest: replace deprecated CGroup v1 settings with v2 ones
Yu Watanabe [Sun, 6 Apr 2025 06:27:25 +0000 (15:27 +0900)] 
test: replace deprecated CGroup v1 settings with v2 ones

6 months agojournal: hash_ops related cleanups (#37115)
Yu Watanabe [Tue, 15 Apr 2025 13:32:15 +0000 (22:32 +0900)] 
journal: hash_ops related cleanups (#37115)

6 months agoresolve: hash_ops related cleanups (#37116)
Yu Watanabe [Tue, 15 Apr 2025 13:31:57 +0000 (22:31 +0900)] 
resolve: hash_ops related cleanups (#37116)