]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 months agouserdb: Add userdb.user.* and userdb.group.* credentials
Daan De Meyer [Thu, 13 Mar 2025 14:22:34 +0000 (15:22 +0100)] 
userdb: Add userdb.user.* and userdb.group.* credentials

Let's allow providing extra userdb users and groups via credentials.
Similarly to systemd-udev-load-credentials.service, we ship
systemd-userdb-load-credentials.service which transform the JSON
user/group records provided via the corresponding credentials to static
userdb dropins in /etc/userdb.

Replaces #33811

7 months agomkosi: Make sure systemd-userdbd.socket is enabled
Daan De Meyer [Tue, 18 Mar 2025 12:51:35 +0000 (13:51 +0100)] 
mkosi: Make sure systemd-userdbd.socket is enabled

7 months agomkosi: Add unix_chkpwd to sanitizer wrapped binaries
Daan De Meyer [Tue, 18 Mar 2025 21:45:17 +0000 (22:45 +0100)] 
mkosi: Add unix_chkpwd to sanitizer wrapped binaries

unix_chkpwd will retrieve the user name of the uid it is invoked as
and as such needs the asan workaround.

7 months agomkosi: Bump to Fedora 42
Daan De Meyer [Tue, 18 Mar 2025 19:35:59 +0000 (20:35 +0100)] 
mkosi: Bump to Fedora 42

Beta was just released, let's switch to Fedora 42 which coincidentally
also has a crucial fix for its nsswitch.conf to make the next commits
actually work.

7 months agoSeveral fixes and cleanups around sd_listen_fds() (#36788)
Daan De Meyer [Tue, 18 Mar 2025 19:10:33 +0000 (20:10 +0100)] 
Several fixes and cleanups around sd_listen_fds() (#36788)

7 months agoupdate TODO
Lennart Poettering [Tue, 18 Mar 2025 17:12:23 +0000 (18:12 +0100)] 
update TODO

7 months agonspawn: make failure in sd_listen_fds() critical 36788/head
Yu Watanabe [Tue, 18 Mar 2025 16:38:18 +0000 (01:38 +0900)] 
nspawn: make failure in sd_listen_fds() critical

Also, drop doubled call of sd_listen_fds().

7 months agooomd: do not ignore failure in sd_lisen_fds()
Yu Watanabe [Tue, 18 Mar 2025 16:33:54 +0000 (01:33 +0900)] 
oomd: do not ignore failure in sd_lisen_fds()

Also, use -EBADF for an invalid file descriptor.

7 months agovmspawn: do not use r for loop count
Yu Watanabe [Tue, 18 Mar 2025 16:35:13 +0000 (01:35 +0900)] 
vmspawn: do not use r for loop count

In a future, we may call some functions and r may be used for storing
error code of them. Let's not use r for the maximum number of loop count.

7 months agosd-varlink: fix overwrite of loop count
Yu Watanabe [Tue, 18 Mar 2025 16:33:09 +0000 (01:33 +0900)] 
sd-varlink: fix overwrite of loop count

Fixes a bug introduced by 206504a594492f4b97259bbe345dde4e520df7dc (v255).

7 months agoinitctl: fix error handling
Yu Watanabe [Tue, 18 Mar 2025 16:32:12 +0000 (01:32 +0900)] 
initctl: fix error handling

Fixes a bug introduced by cc090ca7fec93cd6b41bd7a756cd5fe32df44764 (v246).

7 months agonsresourced: fix assignment of target_gid
Yu Watanabe [Tue, 18 Mar 2025 09:53:59 +0000 (18:53 +0900)] 
nsresourced: fix assignment of target_gid

Follow-up for 00b1f6731398d02409cf7deb6b9b803969fda89f.

Fixes CID#1593901.

7 months agoman: base64 is not hex
Lennart Poettering [Tue, 18 Mar 2025 10:40:14 +0000 (11:40 +0100)] 
man: base64 is not hex

7 months agoTODO
Lennart Poettering [Tue, 18 Mar 2025 10:48:27 +0000 (11:48 +0100)] 
TODO

7 months agoupdate TODO
Lennart Poettering [Tue, 18 Mar 2025 09:45:21 +0000 (10:45 +0100)] 
update TODO

7 months agogetty-generator: unify add_serial_getty() and add_container_getty()
Yu Watanabe [Mon, 17 Mar 2025 01:36:33 +0000 (10:36 +0900)] 
getty-generator: unify add_serial_getty() and add_container_getty()

This also makes the generator not trigger an assertion added by
1cd3c49d09bf78a2a2e4cf25cb3d388e1f08a709. If getty.ttys.container
credential contains a line prefixed with '/dev/', then the assertion
    assert(!path_startswith(tty, "/dev/"));
was triggered. This drops the offending assertion, and such lines
are handled gracefully now.

Also, an empty string, "/dev/", and "/dev/pts/" (that is, a directory
without tty name) are gracefully skipped now.

7 months agoxattr-util: refuse embedded NUL bytes in getxattr_at_malloc() (#36713)
Lennart Poettering [Tue, 18 Mar 2025 08:10:19 +0000 (09:10 +0100)] 
xattr-util: refuse embedded NUL bytes in getxattr_at_malloc() (#36713)

7 months agocgroup-util: remove cg_get_xattr(), it's apparently unused 36713/head
Lennart Poettering [Thu, 13 Mar 2025 11:45:31 +0000 (12:45 +0100)] 
cgroup-util: remove cg_get_xattr(), it's apparently unused

7 months agoxattr-util: rework getxattr_at_malloc()
Lennart Poettering [Wed, 12 Mar 2025 07:36:45 +0000 (08:36 +0100)] 
xattr-util: rework getxattr_at_malloc()

Let's return the size in a return parameter instead of the return value.
And if NULL is specified this tells us the caller doesn't care about the
size and expects a NUL terminated string. In that case look for an
embedded NUL byte, and refuse in that case.

This should lock things down a bit, as we'll systematically refuse
embedded NUL strings now when we expect strings.

7 months agohwdb: fix backspace not working on HP Pavilion laptop (#36777)
Sonia Zorba [Tue, 18 Mar 2025 00:25:51 +0000 (02:25 +0200)] 
hwdb: fix backspace not working on HP Pavilion laptop (#36777)

PR #34685 moved the handling of keys 66/65 from specific models to
generic HP laptops.

Key 66 has been linked to the `pickup_phone` function; however, this
action key is not available on all HP laptop models, particularly older
versions. On my HP Pavilion laptop, key 66 is mapped to the `backspace`
function, which caused the backspace key to stop working after the
change.

The following PR fixes the issue on my **HP Pavilion Laptop 15-eg0xxx**.
I have placed the modifications under the Pavilion section, but I cannot
guarantee that this solution will apply to all Pavilion models.

Additionally, I have included a line that checks for "HP" instead of
solely searching for "Hewlett-Packard," as my model is simply labeled as
HP.

7 months agosome user record fixes (#36776)
Yu Watanabe [Tue, 18 Mar 2025 00:24:05 +0000 (09:24 +0900)] 
some user record fixes (#36776)

Fixes: https://github.com/systemd/systemd/issues/36775
7 months agorun: Ref() the unit again after reconnecting to the bus
Mike Yuan [Mon, 17 Mar 2025 19:08:51 +0000 (20:08 +0100)] 
run: Ref() the unit again after reconnecting to the bus

Follow-up for c8f59296bff1ac1085c9073159ccaf8a333c5027

Currently, the unit is only reffed in transient_unit_set_properties()
via AddRef(), which however would be dropped if a reconnection
is attempted. Make sure to explicitly re-add reference in that case.

7 months agonsresourced,vmspawn: allow unpriv "tap" based networking in vmspawn (#36688)
Yu Watanabe [Mon, 17 Mar 2025 22:34:03 +0000 (07:34 +0900)] 
nsresourced,vmspawn: allow unpriv "tap" based networking in vmspawn (#36688)

This extends nsresourced to also allow delegation of a network tap
device (in addition to veth) to unpriv clients, with a strictly enforced
naming scheme.

also tightens security on a couple of things:

* enforces polkit on all nsresourced ops too (though by default still
everything is allowed)
* put a limit on delegated network devices
* forcibly clean up delegated network devices when the userns goes away

7 months agotree-wide: refuse user/group records lacking UID or GID 36776/head
Lennart Poettering [Mon, 17 Mar 2025 21:37:14 +0000 (22:37 +0100)] 
tree-wide: refuse user/group records lacking UID or GID

userdb allows user/group records without UID/GID (it only really
requires a name), in order to permit "unfixated" records. But that means
we cannot just rely on the field to be valid. And we mostly got that
right, but not everywhere. Fix that.

7 months agonspawn: go via user_record_home_directory() accessor for .home_directory UserRecord...
Lennart Poettering [Mon, 17 Mar 2025 21:22:59 +0000 (22:22 +0100)] 
nspawn: go via user_record_home_directory() accessor for .home_directory UserRecord field

Fixes: #36775
7 months agotree-wide: go via user_record_gid() accessor for UserRecord's .gid field
Lennart Poettering [Mon, 17 Mar 2025 21:21:58 +0000 (22:21 +0100)] 
tree-wide: go via user_record_gid() accessor for UserRecord's .gid field

Sometimes we went for the field directly, where we really should go via
the accessor. Fix it.

7 months agoupdate TODO 36688/head
Lennart Poettering [Mon, 10 Mar 2025 13:39:53 +0000 (14:39 +0100)] 
update TODO

7 months agotest: add test for nsresourced
Lennart Poettering [Tue, 11 Mar 2025 05:06:40 +0000 (06:06 +0100)] 
test: add test for nsresourced

7 months agonsresource: turn feature absence error into EOPNOTSUPP
Lennart Poettering [Wed, 12 Mar 2025 17:00:57 +0000 (18:00 +0100)] 
nsresource: turn feature absence error into EOPNOTSUPP

Let's make it easy for local clients to treat feature absence as a
simple EOPNOTSUPP check.

7 months agovarlink: add full introspection comments for io.systemd.NamespaceResource
Lennart Poettering [Tue, 11 Mar 2025 09:40:04 +0000 (10:40 +0100)] 
varlink: add full introspection comments for io.systemd.NamespaceResource

7 months agonsresourced: check polkit before executing our operations
Lennart Poettering [Mon, 10 Mar 2025 12:39:53 +0000 (13:39 +0100)] 
nsresourced: check polkit before executing our operations

Let's tighten rules on namespace operations: let's always ask PK for
permission before doing anything.

Note that if polkit is absent we'll still allow things, and the default
PK policy will also still allow things, but there's now a clear way how
people can not allow things if they want, by modifying the PK policy.

7 months agonsresourced: put a limit on delegated network interfaces too
Lennart Poettering [Mon, 10 Mar 2025 11:57:29 +0000 (12:57 +0100)] 
nsresourced: put a limit on delegated network interfaces too

7 months agonsresourced: explicitly remove network interfaces when their userns goes away
Lennart Poettering [Mon, 10 Mar 2025 11:39:35 +0000 (12:39 +0100)] 
nsresourced: explicitly remove network interfaces when their userns goes away

Let's tighten the screws a bit on the network interfaces we delegate,
and explicitly destroy them, just like we destroy delegated cgroups.

Ideally, this should happen automatically because the userns goes away
that pins the veth, or because the client holding an fd for a tap device
goes away as the userns goes away. But you never know who keeps a
reference, hence let's explicitly destroy this too.

7 months agovmspawn: support unpriv tap networking
Lennart Poettering [Mon, 10 Mar 2025 10:36:39 +0000 (11:36 +0100)] 
vmspawn: support unpriv tap networking

7 months agonsresource: add client-side wrapper for creating tap links
Lennart Poettering [Mon, 10 Mar 2025 10:36:05 +0000 (11:36 +0100)] 
nsresource: add client-side wrapper for creating tap links

7 months agonetwork: also manage namespace tap links
Lennart Poettering [Mon, 10 Mar 2025 10:20:29 +0000 (11:20 +0100)] 
network: also manage namespace tap links

7 months agonsresourced: add ability to delegate tap device
Lennart Poettering [Sun, 9 Mar 2025 07:14:09 +0000 (08:14 +0100)] 
nsresourced: add ability to delegate tap device

7 months agonsresourced: permit differing uid/gid
Lennart Poettering [Sun, 9 Mar 2025 07:13:07 +0000 (08:13 +0100)] 
nsresourced: permit differing uid/gid

7 months agonamespace: simplify apply_one_mount() a bit
Lennart Poettering [Mon, 10 Mar 2025 10:33:50 +0000 (11:33 +0100)] 
namespace: simplify apply_one_mount() a bit

Drop a bunch of unnecessary casts, format strings, and {} blocks.

7 months agonamespace-util: introduce userns_acquire_self_root()
Lennart Poettering [Mon, 10 Mar 2025 10:30:11 +0000 (11:30 +0100)] 
namespace-util: introduce userns_acquire_self_root()

This is a simple helper for creating a userns that just maps the
callers user to UID 0 in the namespace. This can be acquired unpriv,
which makes it useful for various purposes, for example for the logic in
is_idmapping_supported(), hence port it over.

(is_idmapping_supported() used a different mapping before, with the
nobody users, but there's no real reason for that, and we'll use
userns_acquire_self_root() elsewhere soon, where the root mapping is
important).

7 months agonamespace-util: make "setgroups" users property writable via userns_acquire()
Lennart Poettering [Mon, 10 Mar 2025 10:24:59 +0000 (11:24 +0100)] 
namespace-util: make "setgroups" users property writable via userns_acquire()

Unprivileged namespaces are only allowed if the "setgroups" file is set
to "deny" for processes. And we need to write it before writing the
gidmap. Hence add a parameter for that.

Then, also patch all current users to actually enable this. The usecase
generally don't need it (because they don't care about unprivileged
userns), but it doesn't hurt to enable the concept anyway in all current
users (none of them actually runs complex userspace in them, but they
mostly use userns_acquire() for idmapped mounts and similar).

Let's anyway make this option explicit in the function call, to indicate
that the concept exists and is applied.

7 months agobetter support for $COLORTERM (#36770)
Lennart Poettering [Mon, 17 Mar 2025 12:17:06 +0000 (13:17 +0100)] 
better support for $COLORTERM (#36770)

I recently noticed that our serial/VM terminals did not get fedora's
color shell prompt, nor got color support in "ls".

I spend a bit of time investigating and it's all a bit of a mess. If we
don't have any idea what kind of terminal we are talking to via serial
or hypervisor console then we so far just set TERM=vt220 as a reasonable
fallback: vt220 is quite universally defined in terminfo/termcap, and it
supports pageup/pagedown (unlike vt100).

However, real vt220 DEC terminals did not support color, and hence
termcap/terminfo says "no color, sorry". Which sucks, but actually
neither coreutils' "ls" (via `dircolors`) nor fedora's color shell
prompt actually care for termcap/terminfo. So why don't we get color?

In the coreutils case: it has it's own mini-database of terminals. A
very skewed one, where TERM=vt100 enables colors (and DEC vt100
definitely never ever had color support!), but vt220 does not. However,
what it actually does is check $COLORTERM. If that's set then it would
enable color.

In the fedora color prmpt case: it tries to derive color support by
looking for the word "color" in $TERM. Horrible hack if you ask me...

In order to make things better I did a bunch of things:

1. I think the idea of actually having a fully correct and up-to-date
termcap/terminfo database is kinda illusionary these days. But
apparently regarding color support $COLORTERM kinda took it place.
coreutils cares, and systemd itself cares too. To some point at least:
we consume it to determine color support, but we never propagate it in
nspawn, run0 and so on. So this PR fixes that.

2. Also, we are kinda stuck with vt220 I guess as default fallback for
serial terminals. But let's tweak it, and set $COLORTERM=truecolor as
default too. this means we default to a vt220 terminal, but with color.
Which is an ahistorical thing to do, but I think it's the best way out.

3. I also filed a bug against util-linux asking them to treat $COLORTERM
like $TERM, and let it propagate from getty into login shell:
https://github.com/util-linux/util-linux/issues/3463 – With that we
should get color support in ls by default now.

4. I also asked coreutils to treat vt220 the same as they already treat
vt100 and simply do color, even if though that's ahistorical:
https://github.com/coreutils/coreutils/issues/96

5. I then asked the fedora color prompt package to check $COLORTERM:
https://bugzilla.redhat.com/show_bug.cgi?id=2352650

6. I also asked the fedora ssh package to propagate $COLORTERM to remote
hosts by default, like they already cover $TERM. terminal emulators set
both these days generally, hence this would make sense.
https://bugzilla.redhat.com/show_bug.cgi?id=2352653

7. while at it, I figured it makes sense to not only propagate/consume
$COLORTERM at the same time as $TERM, but also consider $NO_COLOR. In
contrast to $COLORTERM for which no spec seems to exist, that one
actually does have a spec: https://no-color.org/

It might make sense for those interested in other distros than Fedora to
maybe ask for similar changes for their ssh and color shell prompt
packages (if they have something coresponding).

7 months agobuild: add C23 support (#35085)
Luca Boccassi [Mon, 17 Mar 2025 11:29:33 +0000 (11:29 +0000)] 
build: add C23 support (#35085)

To support C23, this introduces UTF8() macro to define UTF-8 literals,
as C23 changed char8_t from char to unsigned char.
This also makes pointer signedness warning critical, and updates C
standards table for tests.

7 months agoudev: several follow-ups and cleanups for builtin commands (#36768)
Lennart Poettering [Mon, 17 Mar 2025 09:42:55 +0000 (10:42 +0100)] 
udev: several follow-ups and cleanups for builtin commands (#36768)

7 months agocopy: Fix error handling in fd_copy_directory()
Daan De Meyer [Wed, 12 Mar 2025 16:06:43 +0000 (17:06 +0100)] 
copy: Fix error handling in fd_copy_directory()

7 months agonspawn,run,machinectl,socket-activate: propagate $COLORTERM + $NO_COLOR 36770/head
Lennart Poettering [Mon, 17 Mar 2025 08:52:52 +0000 (09:52 +0100)] 
nspawn,run,machinectl,socket-activate: propagate $COLORTERM + $NO_COLOR

When we pass information about our calling terminal on to some service
or command we invoke, propagate $COLORTERM + $NO_COLOR in addition to
$TERM, in order to always consider the triplet of the three env vars the
real deal.

7 months agomain: explicitly pick up $COLORTERM + $NO_COLOR from kernel cmdline where we pick...
Lennart Poettering [Mon, 17 Mar 2025 08:45:16 +0000 (09:45 +0100)] 
main: explicitly pick up $COLORTERM + $NO_COLOR from kernel cmdline where we pick up $TERM

I think we should work towards always picking up the triplet of $TERM +
$COLORTERM + $NO_COLOR where we so far picked up $TERM only. I think
it's safe to say that at this time, $TERM is not enough anymore to
clearly communicate terminal feature support. Hence, teach PID 1 to pick
$COLORTERM + $NO_COLOR wherever we pick up $TERM.

7 months agoexec: when we have no $TERM configuration, and we default to vt220, also set $COLORTERM
Lennart Poettering [Mon, 17 Mar 2025 08:34:49 +0000 (09:34 +0100)] 
exec: when we have no $TERM configuration, and we default to vt220, also set $COLORTERM

When we configure a serial or VM terminal and have no $TERM
configuration, then we default to vt220 as a fallback. This is a pretty
safe bet, since the termcap/terminfo definitions for vt220 are
relatively widely available (much like vt100), and (in contrast to
vt100) it supports pageup/pagedown keys. vt220 is a terminal without
color support however, but we do want color support, because in 2025
there's really no terminal emulator without color in this world.

The $COLORTERM env var is used my many emulators and tools to
communicate that ANSI color support is available, despite what $TERM
says. Hence, let's tweak systemd's logic to also set $COLORTERM in case
we set the vt220 $TERM fallback.

This means we define an ahistoric frankenterminal: a vt220 (that
historically definitely didn't have color) that is explicitly configured
to have color.

One effect of this is that coreutils' dircolors command will start to
output color sequences in systemd's serial or VM terminals. (Since it
actually honours $COLORTERM).

Also note that systemd itself checks $COLORTERM since a long time, hence
it makes sense for us to also set it.

Note that this unfortunately doesn't have the desired effect of
propagating $COLORTERM into any getty shell sessions yet. That's because
util-linux' login package currently fiters $COLORTERM (but lets $TERM
though). I filed a bug about that here:

https://github.com/util-linux/util-linux/issues/3463

7 months agoTEST-17-UDEV: add more test cases for udev builtins 36768/head
Yu Watanabe [Mon, 17 Mar 2025 03:04:52 +0000 (12:04 +0900)] 
TEST-17-UDEV: add more test cases for udev builtins

7 months agoshell-completion: add factory_reset udev builtin command
Yu Watanabe [Mon, 17 Mar 2025 02:24:14 +0000 (11:24 +0900)] 
shell-completion: add factory_reset udev builtin command

7 months agoudev-builtin-btrfs: refuse to call for irrelevant device node
Yu Watanabe [Mon, 17 Mar 2025 03:18:41 +0000 (12:18 +0900)] 
udev-builtin-btrfs: refuse to call for irrelevant device node

If btrfs builtin command is called, then check if the specified device
node is owned by the device.
This also allows the command is called specifying any device node.

7 months agoudev-builtin: make btrfs builtin command only check arguments when run in test mode
Yu Watanabe [Mon, 17 Mar 2025 03:04:24 +0000 (12:04 +0900)] 
udev-builtin: make btrfs builtin command only check arguments when run in test mode

7 months agoudev-builtin: add missing UDEV_RELOAD_BUILTIN_FACTORY_RESET
Yu Watanabe [Mon, 17 Mar 2025 03:03:12 +0000 (12:03 +0900)] 
udev-builtin: add missing UDEV_RELOAD_BUILTIN_FACTORY_RESET

7 months agoudev-builtin: align builtins table
Yu Watanabe [Mon, 17 Mar 2025 02:19:05 +0000 (11:19 +0900)] 
udev-builtin: align builtins table

7 months agopo: Translated using Weblate (Japanese)
Y T [Mon, 17 Mar 2025 03:11:07 +0000 (03:11 +0000)] 
po: Translated using Weblate (Japanese)

Currently translated at 100.0% (261 of 261 strings)

Co-authored-by: Y T <yi818670@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ja/
Translation: systemd/main

7 months agorun: trivial followups (#36765)
Yu Watanabe [Mon, 17 Mar 2025 03:27:49 +0000 (12:27 +0900)] 
run: trivial followups (#36765)

7 months agorun: refuse --pty-late for Type=oneshot services 36765/head
Mike Yuan [Sun, 16 Mar 2025 23:21:46 +0000 (00:21 +0100)] 
run: refuse --pty-late for Type=oneshot services

Such combination makes no sense, as by the time the start job
of the oneshot service finishes the main process has already
exited.

Addresses https://github.com/systemd/systemd/pull/36691#discussion_r1988116881

7 months agorun: void'ify sd_event_exit() call
Mike Yuan [Sun, 16 Mar 2025 23:11:12 +0000 (00:11 +0100)] 
run: void'ify sd_event_exit() call

7 months agorun: "trigger" consists of more than timer units
Mike Yuan [Sun, 16 Mar 2025 23:26:45 +0000 (00:26 +0100)] 
run: "trigger" consists of more than timer units

7 months agonspawn: introduce --cleanup option (#34776)
Yu Watanabe [Sun, 16 Mar 2025 21:53:46 +0000 (06:53 +0900)] 
nspawn: introduce --cleanup option (#34776)

This is useful when the previous invocation is unexpectedly killed.

Otherwise, if systemd-nspawn is killed forcibly, then unix-export
directory is not cleared and unmounted, and the subsequent invocation
will fail. E.g.
```
[   18.895515] TEST-13-NSPAWN.sh[645]: + machinectl start long-running
[   18.945703] systemd-nspawn[1387]: Mount point '/run/systemd/nspawn/unix-export/long-running' exists already, refusing.
[   18.949236] systemd[1]: systemd-nspawn@long-running.service: Failed with result 'exit-code'.
[   18.949743] systemd[1]: Failed to start systemd-nspawn@long-running.service.
```

7 months agomeson: Check for lxml before generating indicies
Jordan Petridis [Thu, 13 Mar 2025 14:17:45 +0000 (16:17 +0200)] 
meson: Check for lxml before generating indicies

Followup to c0cc01de8a0249fb80684c861e50c939aa67d91e

The targets that create indicies have
`install : want_html and have_lxml` but some other
code like the `install_symlink` was not gated by
accident.

We ican put the whole loop behind have_lxml as its
required for all the indicies.

7 months agocgroup v1 preliminaries (#36622)
Mike Yuan [Sun, 16 Mar 2025 19:27:48 +0000 (20:27 +0100)] 
cgroup v1 preliminaries (#36622)

7 months agoman: remove libsystemd reference to legacy hierarchy 36622/head
Mike Yuan [Wed, 5 Mar 2025 18:10:02 +0000 (19:10 +0100)] 
man: remove libsystemd reference to legacy hierarchy

7 months agocgroup-util: drop is_cgroup_fs()
Mike Yuan [Wed, 5 Mar 2025 17:59:09 +0000 (18:59 +0100)] 
cgroup-util: drop is_cgroup_fs()

No need to bother with any cgroup v1 stuff anymore.

7 months agocore/taint: we know we're always running on cgv2 now
Mike Yuan [Sun, 16 Mar 2025 14:24:18 +0000 (15:24 +0100)] 
core/taint: we know we're always running on cgv2 now

7 months agocore/main: refuse bootup with legacy cgroup hierarchy
Mike Yuan [Wed, 5 Mar 2025 17:55:41 +0000 (18:55 +0100)] 
core/main: refuse bootup with legacy cgroup hierarchy

First step towards a unified-only future (rework of internals
coming soon (TM))

7 months agocgroup-setup: drop hierarchy detection, always use v2
Mike Yuan [Wed, 5 Mar 2025 16:57:27 +0000 (17:57 +0100)] 
cgroup-setup: drop hierarchy detection, always use v2

7 months agomount-setup: remove cgroup v1 hierarchy mounting
Mike Yuan [Wed, 5 Mar 2025 16:53:44 +0000 (17:53 +0100)] 
mount-setup: remove cgroup v1 hierarchy mounting

7 months agosemaphore-runner: disable cgroup setup in lxc
Mike Yuan [Mon, 10 Mar 2025 18:42:05 +0000 (19:42 +0100)] 
semaphore-runner: disable cgroup setup in lxc

lxc tries to mount /sys/fs/cgroup/ following host hierarchy by default,
which is problematic for us since we want to unconditionally use
cgroup v2 in cgns. Disable it hence and let pid1 figure it out.

7 months agosemaphore-runner: drop outdated comment
Mike Yuan [Mon, 10 Mar 2025 18:18:47 +0000 (19:18 +0100)] 
semaphore-runner: drop outdated comment

7 months agomount-setup: generalize cgroupfs_recursiveprot_supported()
Mike Yuan [Thu, 6 Mar 2025 11:56:29 +0000 (12:56 +0100)] 
mount-setup: generalize cgroupfs_recursiveprot_supported()

7 months agotest-execute: use time event source rather than custom timeout check
Yu Watanabe [Sun, 16 Mar 2025 03:00:14 +0000 (12:00 +0900)] 
test-execute: use time event source rather than custom timeout check

Fixes CID#1593786.

7 months agoTEST-13-NSPAWN: re-enable KILL test 34776/head
Yu Watanabe [Tue, 15 Oct 2024 08:28:17 +0000 (17:28 +0900)] 
TEST-13-NSPAWN: re-enable KILL test

7 months agonspawn: introduce --cleanup option to clear propagation and unix-export directories
Yu Watanabe [Tue, 15 Oct 2024 08:25:09 +0000 (17:25 +0900)] 
nspawn: introduce --cleanup option to clear propagation and unix-export directories

This is useful when the previous invocation is unexpectedly killed.

Otherwise, if systemd-nspawn is killed forcibly, then unix-export
directory is not cleared and unmounted, and the subsequent invocation
will fail. E.g.
===
[   18.895515] TEST-13-NSPAWN.sh[645]: + machinectl start long-running
[   18.945703] systemd-nspawn[1387]: Mount point '/run/systemd/nspawn/unix-export/long-running' exists already, refusing.
[   18.949236] systemd[1]: systemd-nspawn@long-running.service: Failed with result 'exit-code'.
[   18.949743] systemd[1]: Failed to start systemd-nspawn@long-running.service.
===

7 months agomeson: update C standards table for building header tests 35085/head
Yu Watanabe [Sun, 16 Mar 2025 01:05:17 +0000 (10:05 +0900)] 
meson: update C standards table for building header tests

7 months agomeson: make pointer-sign warning critical
Yu Watanabe [Sun, 16 Mar 2025 01:10:28 +0000 (10:10 +0900)] 
meson: make pointer-sign warning critical

With the previous commit, no pointer signedness warning should be
triggered even built with C23. Let's make the warning critical.

7 months agomacro: Introduce UTF8() macro to define UTF-8 string literal
Yu Watanabe [Sun, 16 Mar 2025 00:31:43 +0000 (09:31 +0900)] 
macro: Introduce UTF8() macro to define UTF-8 string literal

C23 changed char8_t from char to unsigned char, hence assigning a u8 literal
to const char* emits pointer sign warning, e.g.
========
../src/shared/qrcode-util.c: In function ‘print_border’:
../src/shared/qrcode-util.c:16:34: warning: pointer targets in passing argument 1 of ‘fputs’ differ in signedness [-Wpointer-sign]
   16 | #define UNICODE_FULL_BLOCK       u8"█"
      |                                  ^~~~~
      |                                  |
      |                                  const unsigned char *
../src/shared/qrcode-util.c:65:39: note: in expansion of macro ‘UNICODE_FULL_BLOCK’
   65 |                                 fputs(UNICODE_FULL_BLOCK, output);
      |                                       ^~~~~~~~~~~~~~~~~~
========

This introduces UTF8() macro, which define u8 literal and casts to consth char*,
then rewrites all u8 literal definitions with the macro.
With this change, we can build systemd with C23.

7 months agoFix bootctl status to not print strange glyphs in logs (#36745)
Yu Watanabe [Sat, 15 Mar 2025 20:56:55 +0000 (05:56 +0900)] 
Fix bootctl status to not print strange glyphs in logs (#36745)

7 months agonetwork: fix unexpected removal of routes on restart even when KeepConfiguration...
Yu Watanabe [Sat, 15 Mar 2025 14:19:49 +0000 (23:19 +0900)] 
network: fix unexpected removal of routes on restart even when KeepConfiguration=yes (#36756)

7 months agobootctl: do not print special glyphs to the log 36745/head
Zbigniew Jędrzejewski-Szmek [Sun, 9 Mar 2025 09:50:04 +0000 (10:50 +0100)] 
bootctl: do not print special glyphs to the log

The log line looked like this:
  bootctl[1457]: ! Mount point '/efi' which backs the random seed file is world accessible, which is a security hole! !
which doesn't look nice.

Also upgrade the message to error. This is something to fix.

7 months agobasic/glyph-util: introduce optional_glyph() to wrap emoji_enabled()
Zbigniew Jędrzejewski-Szmek [Sun, 9 Mar 2025 09:43:25 +0000 (10:43 +0100)] 
basic/glyph-util: introduce optional_glyph() to wrap emoji_enabled()

7 months agobasic/glyph-util: rename "special glyph" to just "glyph"
Zbigniew Jędrzejewski-Szmek [Fri, 14 Mar 2025 09:42:04 +0000 (10:42 +0100)] 
basic/glyph-util: rename "special glyph" to just "glyph"

Admittedly, some of our glyphs _are_ special, e.g. "O=" for SPECIAL_GLYPH_TOUCH ;)
But we don't need this in the name. The very long names make some invocations
very wordy, e.g. special_glyph(SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY).
Also, I want to add GLYPH_SPACE, which is not special at all.

7 months agoseveral fixes for Coverity (#36753)
Luca Boccassi [Sat, 15 Mar 2025 11:46:14 +0000 (11:46 +0000)] 
several fixes for Coverity (#36753)

7 months agotest-cgroup-util: allow ESRCH in cg_pidref_get_path() and friends 36753/head
Yu Watanabe [Sat, 15 Mar 2025 01:46:36 +0000 (10:46 +0900)] 
test-cgroup-util: allow ESRCH in cg_pidref_get_path() and friends

As the process may be already dead.

Follow-ups for ca82f0cbe2db096bc7ff81280b5683ea1beae534.

7 months agotest-network: check that network configuration is stable with KeepConfiguration=yes 36756/head
Matteo Croce [Wed, 12 Mar 2025 13:36:14 +0000 (14:36 +0100)] 
test-network: check that network configuration is stable with KeepConfiguration=yes

Check that when networkd restarts, and the network configures
KeepConfiguration=yes, the network configuration is never changed.

Ensure this by dumping the `ip monitor` output when networkd is restarting.

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
7 months agonetwork: do not remove static routes on other interfaces that are currently in the...
Yu Watanabe [Sat, 15 Mar 2025 00:38:09 +0000 (09:38 +0900)] 
network: do not remove static routes on other interfaces that are currently in the pending state

Otherwise, even if .network file has KeepConfiguration=yes, routes on
an interfaces may be removed on restart.

Fixes a bug introduced by 8d01e44c1f0e00b414d36bd1b46ecff548242208.

7 months agotest: drop redundant parentheses in ASSERT_OK() and friends
Yu Watanabe [Sat, 15 Mar 2025 00:04:25 +0000 (09:04 +0900)] 
test: drop redundant parentheses in ASSERT_OK() and friends

This reverts 278e3adf50e36518c5a5dd798ca998e7eac5436e, and drop more
redundant parentheses, as they unfortunately does not suppress the
false-positive warnings by coverity.

7 months agomeson: handle bool-compare warning as error
Yu Watanabe [Fri, 14 Mar 2025 22:21:33 +0000 (07:21 +0900)] 
meson: handle bool-compare warning as error

Then we can detect the error fixed by the previous commit like the following:

../src/libsystemd/sd-device/test-sd-device.c: In function ‘test_sd_device_enumerator_add_all_parents’:
../src/shared/tests.h:225:51: error: comparison of constant ‘0’ with boolean expression is always true [-Werror=bool-compare]
  225 | #define ASSERT_OK(expr) __coverity_check__((expr) >= 0)
      |                                                   ^~
../src/libsystemd/sd-device/test-sd-device.c:547:9: note: in expansion of macro ‘ASSERT_OK’
  547 |         ASSERT_OK(sd_device_enumerator_add_all_parents(e) >= 0);
      |         ^~~~~~~~~

7 months agotest: fix wrong use of ASSERT_OK() and friends
Yu Watanabe [Fri, 14 Mar 2025 22:20:45 +0000 (07:20 +0900)] 
test: fix wrong use of ASSERT_OK() and friends

7 months agotests: replace ASSERT_OK() and friends with coverity firendy function
Yu Watanabe [Fri, 14 Mar 2025 21:51:18 +0000 (06:51 +0900)] 
tests: replace ASSERT_OK() and friends with coverity firendy function

We already have done the same for assert_se() since
d9fb7afb4890a93db478616e7bfc639b2129b466.

Hopefully this makes coverity silent about the false-positive side-effect
warnings.

7 months agotest-macro: CONST_MAX() and friends may return (void*)0 when built under coverity
Yu Watanabe [Fri, 14 Mar 2025 21:48:37 +0000 (06:48 +0900)] 
test-macro: CONST_MAX() and friends may return (void*)0 when built under coverity

See 963c6c90af87fdf8b7dcb942991fb018b87fea07.

7 months agojournal-remote: added custom headers support
Andrii Chubatiuk [Wed, 16 Oct 2024 12:06:19 +0000 (15:06 +0300)] 
journal-remote: added custom headers support

7 months agoudevadm: check number of passed arguments
Lennart Poettering [Fri, 14 Mar 2025 10:43:07 +0000 (11:43 +0100)] 
udevadm: check number of passed arguments

We didn't check the number of arguments first, hence ended up outputting
some ugly complaints with `(null)` in a format string. And what's worse
accepted any number of arguments, where we'd ignore all but the first
two though.

7 months agofirstboot: welcome user with emoji in firstboot wizard 🧙
Lennart Poettering [Fri, 14 Mar 2025 14:44:31 +0000 (15:44 +0100)] 
firstboot: welcome user with emoji in firstboot wizard 🧙

7 months agoRestore docs/PAX_CONTROL_GROUPS
Zbigniew Jędrzejewski-Szmek [Fri, 14 Mar 2025 10:33:55 +0000 (11:33 +0100)] 
Restore docs/PAX_CONTROL_GROUPS

This partially reverts 8d04b8198d4c0cca0118f731369ad7156f0726b6.
If we completely drop the file, users will get a 404. But this document
has been in place for a long time and is referred to in many other places,
incl. our old wiki at https://www.freedesktop.org/wiki/Software/.
The page already says that it's been replaced
("… Please consult this document only as a historical reference. …").
We should only remove it from the index (which
8d04b8198d4c0cca0118f731369ad7156f0726b6 did).

In general, let's be more careful about preserving link stability.
When we change something in a way that breaks URLs, we're creating
pain for users.

7 months agodocs/ROOTFS_DISCOVERY: removed doubled dot
Zbigniew Jędrzejewski-Szmek [Fri, 14 Mar 2025 10:06:37 +0000 (11:06 +0100)] 
docs/ROOTFS_DISCOVERY: removed doubled dot

Inadvertent change in 487b95d9b6eb42c5213f413308b915e8be17d509.

7 months agomkosi: update debian commit reference
Luca Boccassi [Thu, 13 Mar 2025 13:12:42 +0000 (13:12 +0000)] 
mkosi: update debian commit reference

d8c7f8f7f4 Update changelog for 257.4-2 release
f74cf88300 Split bootctl to new systemd-boot-tools package
10a8764966 Update changelog for 257.4-1 release

7 months agoanalyze: don't connect to bus from analyze test run (#36719)
Lennart Poettering [Thu, 13 Mar 2025 16:51:45 +0000 (17:51 +0100)] 
analyze: don't connect to bus from analyze test run (#36719)

This thing should not be "live", hence don't try to connect to the bus,
or bind the private bus socket.

Fixes: #36540
7 months agoemergency-action: sleep 5s before rebooting in various cases
Lennart Poettering [Wed, 12 Mar 2025 10:17:29 +0000 (11:17 +0100)] 
emergency-action: sleep 5s before rebooting in various cases

This adds a new EMERGENCY_ACTION_SLEEP_5S flag, which when set will
delay the emergency action for 5s. This is supposed to be used together
with EMERGENCY_ACTION_WARN so that users can actually read the message
we output.

We enable this with all emergency action requests that already set
EMERGENCY_ACTION_WARN, except for the 7x ctrl-alt-del burst reboot,
where the user knows what they do and there's no real reason to wait,
they don't need to be informed.

This also enables both EMERGENCY_ACTION_WARN + EMERGENCY_ACTION_SLEEP_5S
for FailureAction= processing of regular units, where these were so far
off. (it leaves this off for SuccessAction= however!). This is a good
thing to make things more debuggable: if something fails and we reboot
this really deserves notification of the user.

(For SuccessAction= this logic does not apply, since the shutdown action
induced here is apparently intended part of the codeflow, for example in
systemd-reboot.service or a similar unit, where the shutdown is goal and
not exception and derserves no additional noisy reporting).

Inspired by: https://github.com/systemd/systemd/pull/36705#issuecomment-2717014120

7 months agodocs/ROOTFS_DISCOVERY: minor wording and syntactic improvements
Zbigniew Jędrzejewski-Szmek [Thu, 13 Mar 2025 13:29:17 +0000 (14:29 +0100)] 
docs/ROOTFS_DISCOVERY: minor wording and syntactic improvements