Commit Graph
84229 Commits
Author SHA1 Message Date
Luca Boccassi e84aa21af8 man: RootImageOptions= is only supported for system services right now
Support via mountfsd is being worked on but will take more time,
fix the documentation to be correct in the meanwhile

Follow-up for fad01f798d
2025-10-22 17:22:03 +01:00
Luca Boccassi 53d49fbf3f mountfsd: allow privileged users to mount bare unprotected filesystems
This is useful when we start to call mountfsd from root, for example
from the tests where we just use a simple squashfs/erofs.
Note that this requires the caller to be root, and it will be rejected
otherwise, as such images are classified as 'unprotected' and the
enforced policy does not accept them for unprivileged users.
2025-10-22 16:47:46 +01:00
theSillywhat 3331d99b49 Missing policies for polkit as mentioned in freedesktop.org/software/systemd/man 2025-10-22 16:20:44 +02:00
Zbigniew Jędrzejewski-Szmek e39cde9585 Disable abort in log_assert in libsystemd/libudev (#39307)
See the second commit for details.

I think we might want to apply the same treatment to nss and pam
modules. Asserting in such "plugin code" seems iffy. But this PR doesn't
change those in any way.
2025-10-22 14:48:14 +02:00
Lennart Poettering b38dc56bab coredump: split coredump.c into small pieces (#39351) 2025-10-22 13:37:51 +02:00
Lennart Poettering aea2f059a3 tree-wide: use setenvf() more, where appropriate 2025-10-22 13:36:18 +02:00
Daan De Meyer 8e4f26a23b import: support in --user mode (#39322)
This is the first half of #38728, just the parts that immediately touch
importd to add a --user mode for it.
2025-10-22 12:59:46 +02:00
Ryan Brue e80c5eb6e6 man: Clarify usage of /usr/share/factory/ in programs
As discussed in this thread:
https://github.com/redhat-performance/tuned/issues/798#issuecomment-3197697654

/usr/share/factory/ is not intended to be read from by programs,
but the wording in the FHS can be misread to think that programs
should be using /usr/share/factory/ as the vendor supplied configuration
directory rather than something like /usr/lib/foo/ or /usr/share/foo/.

This commit points developers to the UAPI configuration spec for how to
make their programs hermetic /usr/ compatible.

Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
2025-10-22 11:07:23 +02:00
Zbigniew Jędrzejewski-Szmek 0bb0316f5e Do not use "critical assert_return" in libsystemd or libudev
Previously, when compiled in developer mode, a call into libsystemd with
invalid parameters would result in an abort. This means that it's effectively
impossible to install such libsystemd in a normal system, since various
third-party programs may now abort. A shared library should generally never
abort or exit the calling program.

In python-systemd, the test suite calls into libsystemd, to check if the proper
return values are received and propagated through the Python wrappers.
Obviously with libsystemd compiled from git, the test suite now fails
in a nasty way.

So rework the code to set assert_return_is_critical similarly to how we handle
mempool enablement: the function that returns true is declared as a week
symbol, and we "opt in" by linking a file that provides the function in
libsystemd-shared. Effectively, libsystemd and libudev always have
assert_return_is_critical==false, and our binaries and modules enable it
conditionally.
2025-10-22 10:10:24 +02:00
Zbigniew Jędrzejewski-Szmek 882dfbde1c basic/mempool: mark mempool_enabled as _pure_
The function internally does caching which means that the result must
always be the same, the definition of a pure function. The compiler might
be able to optimize some repeated calls to the function.
2025-10-22 10:06:07 +02:00
Daniel Foster c7a444a9c1 tree-wide: extend $LISTEN_FDS protocol with $LISTEN_PIDFDID
Although extremely unlikely, there is a race present in solely checking the
$LISTEN_PID environment variable, due to PID recycling. Fix that by introducing
$LISTEN_PIDFDID, which contains the 64-bit ID of a pidfd for the child process
that is not subject to recycling.
2025-10-22 09:34:14 +02:00
Septatrix 93b6d43253 Remove dns0.eu from default DNS servers
The service has ceased operation.
Partially reverts 02527e95b5.
2025-10-22 01:39:41 +02:00
Lennart Poettering 25dbf586b2 importd: downgrade log message about bound capability set dropping + netns
An unprivileged process cannot reduce its own capability bounding set,
hence, while it is nice to reduce the set, let's not log about it
loudly, in case we are invoked unpriv (which we explicity support these
days after all).

An unpriv process also cannot detach from its netns, hence also
downgrade the warning to a debug message.
2025-10-21 23:09:50 +02:00
Lennart Poettering 1be8caa6be importd: support unpacking tarballs to foreign UID range
When invoked unprivileged, let's use a transiently allocated userns, so
that we can properly untar UIDs/GIDs so that the trees appear owned by
the foreign UID/GID range.
2025-10-21 23:09:50 +02:00
Lennart Poettering d9c10bf1d2 importd: clean up how we determine image root in importd backends
Let's introduce a single helper that determines where to download images
to, taking all three primary parameters into account: the image class,
the runtime scope and whether to do runtime or persistency.

Then port everything over to this.

This not only cleans things up, but makes sure the importd backends
actually properly can deal with per-user downloads, as before we never
took the runtime scope into account for determining download location.
2025-10-21 23:09:50 +02:00
Lennart Poettering 0960b905bc importctl: add --user/--system switches 2025-10-21 23:09:50 +02:00
Lennart Poettering f7c72e8725 importd: properly support operation in per-user mode 2025-10-21 23:09:50 +02:00
Lennart Poettering b76a76ac15 importd: teach all backends --system/--user mode
The runtime scope logic is internally already in place, let's expose
this via getopt() command line too. This way importd later can propagate
the invocation scope down to the backends.
2025-10-21 23:09:50 +02:00
Lennart Poettering 570366b6e1 install-file: add flags to handle RO and syncing failures graceful
When operating in unprivileged mode we might not be able to execute the
necessary operations to make a disk image read-only (because
FS_IMMUTABEL_FL needs privs for example), and syncing (because for that
we might need to open the root inode, but that might not be possible
from the outside).

Let's deal with that by making these operation optional: if they work
great, if not they don't.
2025-10-21 23:09:50 +02:00
Lennart Poettering 69332065e2 copy: make copy_tree_at_full()'s 'to' parameter optional
Sometimes it's quite useful to pin a source dir via an fd, as well as a
target dir the same way, and then ask copy_tree_at_full() to copy the
contents from one to the other. Make this possible, by allowing 'to' be
NULL. (Previously, it had to be non-NULL, i.e. the function would always
create a new dir, no matter what.)

Note that we only support that for dir inodes.
2025-10-21 23:09:50 +02:00
Lennart Poettering 0a9e2e45f0 copy: optionally apply source inode's stat() when doing a merge copy 2025-10-21 23:09:50 +02:00
Lennart Poettering bcafa70974 nsresource: add constants for the only supported UID range size allocations
As requested: https://github.com/systemd/systemd/pull/39322#discussion_r2447366728
2025-10-21 23:09:50 +02:00
Lennart Poettering b3e5e00d45 dissect-image: explain one more error 2025-10-21 22:02:22 +09:00
Yu Watanabe 02fea5b412 ci/oss-fuzz: switch to Ubuntu 24.04
With
https://github.com/google/oss-fuzz/pull/14112 and
https://github.com/google/oss-fuzz/pull/14128,
we can now use Ubuntu 24.04. Let's bump the image version.

Note, the i386 build failure mentioned in the removed comment is related to
https://bugs.launchpad.net/ubuntu/+source/linux-signed-azure/+bug/2071445
https://github.com/actions/runner-images/issues/9977
and has been already fixed.
2025-10-21 15:09:24 +09:00
Yu Watanabe f88f0271f8 TEST-75-RESOLVED: stop socket units before stopping the main service
Fixes the following warning:
TEST-75-RESOLVED.sh[2251]: ++ restart_resolved
TEST-75-RESOLVED.sh[2251]: ++ systemctl stop systemd-resolved.service
TEST-75-RESOLVED.sh[2271]: Stopping 'systemd-resolved.service', but its triggering units are still active:
TEST-75-RESOLVED.sh[2271]: systemd-resolved-monitor.socket, systemd-resolved-varlink.socket
2025-10-21 15:07:53 +09:00
Hans de Goede b8490c9e51 hwdb: Add V64x_V65xAU to list of Clevo models where scancode f7+f8 get mapped to touchpad-toggle
Fn + F1 which is the shortcut for toggling the touchpad on/off sends
atkbd scancodes f7 (first press) + f8 (second press) just like on various
other Clevo models. Add the V64x_V65xAU model to the list of models where
these scancodes are mapped to touchpad-toggle.
2025-10-21 07:56:02 +09:00
Lennart Poettering b61f2969c2 networkd: minor units to unit file Description= strings (#39386) 2025-10-20 22:14:17 +02:00
Lennart Poettering 15fec4b646 units: use Title Case for network generator description string
We use Title Case for all other units, do so here too.
2025-10-20 18:17:47 +02:00
Lennart Poettering 1f3f40f0ff networkd: call networkd a "network management" rather "network configuration" tool
This has irked me for a while. For me network configuration is the stuff
we store on disk in configuration file. And networkd then *applies* the
configuration. But the units so far claimed that networkd was the
"configuration" itself. Which I guess might make sense to some, but to
me sounds a bit unprecise. Let's clean this up, and call what networkd
is doing "Network Management".
2025-10-20 18:17:29 +02:00
Daan De Meyer cbbc7e51ec core: adding cgroup/invocationid lookups to io.systemd.Unit.List (#38032) 2025-10-20 17:15:34 +02:00
Yu Watanabe 97d38155db Several preparations for supporting new coredump interface (#39350) 2025-10-20 20:44:22 +09:00
Yu Watanabe 94a23e9c44 coredumpctl: fix condition for checking coredump journal entry
If one of PID, UID, GID, or SIGNAL is missing, then parse_uid() and
friends in the below will trigger assertion. This fixes that.

Also, only PID, UID, GID, SIGNAL, and COMM are mandatory fields, but
others are not, hence this drops others from the condition.

Moreover, this mekes 'coredumpctl --list' not fail even if there exists a
broken coredump entry in journal.
2025-10-20 20:43:45 +09:00
Lennart Poettering 342084b035 loop-util: explain why we propagate discard_max_bytes from backing block device to loopback block device
Follow-up for: 29ee9c6fb7
2025-10-20 12:33:50 +01:00
Yu Watanabe 20332d7caf network/dhcp-server: several follow-ups for domain option (#39380)
Follow-ups for 3eb7b881bd (#39260).
2025-10-20 20:17:59 +09:00
Ivan Kruglov 959a8e49f4 core: enable SELinux checks in io.systemd.Unit.List 2025-10-20 03:58:55 -07:00
Ivan Kruglov 8b1f7f13f0 test: lookup a unit by cgroup and invocationID in TEST-74-AUX-UTILS.varlinkctl 2025-10-20 03:58:55 -07:00
Ivan Kruglov 6c2c2e0598 core: io.systemd.Unit.List can lookup by InvocationID 2025-10-20 03:58:53 -07:00
Ivan Kruglov 6b78d931cd core: io.systemd.Unit.List can lookup unit by CGroup 2025-10-20 03:58:39 -07:00
nkraetzschmar 29ee9c6fb7 loop-util: mirror discard limits from backing device 2025-10-20 12:49:39 +02:00
Yu Watanabe d19294e92a sd-dhcp-server: fix conditions for checking if static address is assigned to another host
Even if a static lease may be configured for a host, another address may
be previously assigned to the host. Let's not refuse to assign the
static lease to the host even in that case.

Fixes an issue reported at
https://github.com/systemd/systemd/issues/35781#issuecomment-3369545753.
2025-10-20 11:45:45 +01:00
jouyouyun 85eae6ba35 gitignore: add aider
Aider is an open-source AI coding assistant. When used, it generates history,
cache, and other files in the project. To prevent these files from being committed, you need to add .aider* to your .gitignore file
2025-10-20 11:39:25 +01:00
Daan De Meyer 9c3359f28a ptyfwd: Always prioritize $SYSTEMD_TINT_BACKGROUND
By giving priority to --background= we prevent users from opting
out of coloring if an explicit color is chosen by a tool wrapping
one of our own tools. Instead, let's give priority to the environment
variable, so that even if our tools are wrapped by another tool with
a different background, users can still opt out of coloring just by
setting the environment variable, which has a high chance of being
forwarded to the invocation of our own tools which makes it easy to
use to disable color tinting globally if requested by the user.
2025-10-20 12:20:35 +02:00
Daan De Meyer 5c54ffa208 resolved: move DNS RR/key/naswer/question/packet code to shared/ + other tweaks (#39324) 2025-10-20 12:20:10 +02:00
Ivan Kruglov 4ddd3fe1fb core: make name/pid lookup params use AND logic in io.systemd.Unit.List 2025-10-20 02:10:57 -07:00
Ivan Kruglov 366f57bff4 basic: pidref_is_set_or_automatic() 2025-10-20 02:10:00 -07:00
Lennart Poettering e5dc5821ff dns-domain: make dns_name_change_suffix() work with an empty/null suffix 2025-10-20 10:35:23 +02:00
Lennart Poettering 970bedb6d8 dns-rr: when decoding an RR from json, make class optional
The DNS RR class is a weird thing, and IRL always set to IN (i.e. 0x1).
Let's hence make it something that can be specified optionally, and
imply IN if not specified.

This makes it a bit nicer to put together suitable json resource record
keys from the command line.
2025-10-20 10:35:23 +02:00
Lennart Poettering 5751b236a5 resolved: move DNS RR/key/answer/question/packet tools to shared/
We want to reuse these generic DNS concepts in resolved hook
implementations, hence move them to shared code.

(This also enables us to immediately remove som SVCB record handling
duplicate definitions.)

No real code changes, just some moving around of things.
2025-10-20 10:35:23 +02:00
Thomas Mühlbacher 226e050a0d stub: check load options a little more carefully
This can lead to booting with a completely garbled command line with characters
being interpreted as miscellaneous CJK or symbols.

According to the UEFI spec, the optional data of the load option is just a
binary data buffer.
2025-10-20 10:28:41 +02:00
Nick Labich 942ad8503a sysext: Configure overlayfs mount options via envvar
Implements #39314
2025-10-20 09:59:02 +02:00