Commit Graph
82059 Commits
Author SHA1 Message Date
Yu Watanabe 44875628ff systemctl: replace basename() with path_extract_filename() 2025-06-06 19:06:48 +09:00
Yu Watanabe 59829bb37a delta: rework how enumerate files 2025-06-06 19:06:48 +09:00
A. Wilcox 6b783209a8 tree-wide: basename -> path_extract_filename 2025-06-06 19:06:48 +09:00
Lennart Poettering ee96d65e50 update TODO 2025-06-06 12:03:16 +02:00
Lennart Poettering f7a79c7c43 generator: improve scope check (#37761)
Fixes: #35723
2025-06-06 12:02:25 +02:00
Lennart Poettering da12ce285b generator: check $SYSTEMD_SCOPE rather than cgroup membership
This is more explicit and ensures that even in testing environments we
operate the same way.

As side effect it also avoids the mess around SELinux blocking access to
cgroupfs.

Fixes: #35723
2025-06-06 09:04:45 +02:00
Lennart Poettering d65dc4c593 core: break lines in some overly long function calls 2025-06-06 09:04:45 +02:00
Lennart Poettering 1de31f23a0 conf-files: use proper enum for flags parameters 2025-06-06 09:04:38 +02:00
Lennart Poettering aab61a4ebc journal: concurrent update fixes (#37757)
Fixes: #35229 #32436
2025-06-06 08:24:16 +02:00
Yu Watanabe eefcf8de64 core: adding CGroup for io.systemd.Unit.List (second PR) (#37646)
This PR adds CGroup context/runtime for io.systemd.Unit.List method.

This is follow up for https://github.com/systemd/systemd/pull/37432.
2025-06-06 06:07:35 +09:00
Yu Watanabe 3b1850d906 Bugprone argument comment 10 (#37755)
Follow up from https://github.com/systemd/systemd/pull/37712
2025-06-06 06:07:05 +09:00
Lennart Poettering 5ee8b3edb3 journal: replace a bunch of assert() with friendlier checks
We should not rely that data stored in the journal files remains
entirely untouched at all times. Because we unallocate files, data might
go away any time. Hence, never assert() on any expectations on what the
file contains. Instead, handle it more gracefully as a corruption issue,
and return EBADMSG.

Fixes: #35229 #32436
2025-06-05 22:31:41 +02:00
Lennart Poettering 813facd3ba journal: add 'const' at one more place 2025-06-05 22:31:40 +02:00
Lennart Poettering b16cb30edd journal: determine compression once, not twice
This is just paranoia: let's determine the compression to use once,
instead of twice, after all te data is in journal files which might be
corrupted any time, and it would be weird if we came to different
results here each time.
2025-06-05 22:31:39 +02:00
Lennart Poettering 7d52a60843 journal: use EBADMSG for invalid data in file mmap
We must assume that any data in the mmap can change anytime because the
file is deallocated or similar. Let's strictly use EBADMSG for reporting
invalid file contents though (as opposed to using EINVAL if our own code
passes a wrong parameter somwhere).
2025-06-05 22:31:21 +02:00
Mike Yuan 29d1082002 core/varlink: split out dynamic-user stuff into its own source files 2025-06-06 04:31:42 +09:00
SoloSaravanan 4344ef73a0 hwdb: Acer Nitro ANV15-51 Mic Toggle 2025-06-05 18:43:45 +01:00
Lennart Poettering 9ace4f1c30 mountfsd: support processing block devices with MountImage() (#37746)
Fixes: #35111
2025-06-05 16:51:06 +02:00
Daan De Meyer fdbfda7245 core: Various fixes for cgroup and pid namespaces (#36815) 2025-06-05 15:21:59 +02:00
Daan De Meyer a292b55980 meson: Don't fail install script if file doesn't exist
Depending on which optional features are enabled, the NSS module
might not have been built, which means the custom install script
will fail to remove the file. Let's pass -f so it succeeds regardless
of whether the file exists or not.
2025-06-05 15:18:30 +02:00
Lennart Poettering c91f1a3db8 man: suggest using --unlock-tpm2-device=auto in cryptenroll example
When refreshing a tpm2 enrollment, it makes sense to use tpm2 to unlock
the device.

Fixes: #35279
2025-06-05 14:10:32 +01:00
Daan De Meyer d1ee3889cf meson: Add libmount feature
Let's reduce the dependencies required to build just libsystemd by
making libmount optional. The meson disabler feature makes this quite
trivial.
2025-06-05 14:51:03 +02:00
Lennart Poettering 6315106268 add CITATION.cff file
As per spec: https://citation-file-format.github.io/

Fixes: #35260
2025-06-05 14:39:20 +02:00
Lennart Poettering c882e7f124 mountfsd: slightly relax check on image fds
Fixes: #35111
2025-06-05 14:28:33 +02:00
Lennart Poettering 01e82dfa96 dissect-image: port to varlink_callbo_and_log() 2025-06-05 14:28:31 +02:00
Lennart Poettering a589e1bd9e varlink-util: format system errors via %m in varlink_call_and_log()
This kinda does what bee59ab901 did for
varlinkctl also for the generic varlink_call_and_log() handler.
2025-06-05 14:28:14 +02:00
Lennart Poettering 4bd37b94b8 fixes for --machine= handling in run0 and journalctl (#37741)
Fixes: #32997
2025-06-05 14:02:26 +02:00
Lennart Poettering 6d83b6afbb resolvectl: --raw improvements (#37743)
Fixes: #37737
2025-06-05 14:02:00 +02:00
Ivan Kruglov 8006ab9047 core: adding CGroup runtime for io.systemd.Unit.List 2025-06-05 04:05:05 -07:00
Ivan Kruglov dffde7708a core: adding CGroup context for io.systemd.Unit.List 2025-06-05 04:05:05 -07:00
Ivan Kruglov 27a10f4f2a core: *ret = NULL for early return in unit_mounts_for_build_json() 2025-06-05 03:59:36 -07:00
Mike Yuan 199ccd70f6 core: rework how we track cgroup realized state (#37733) 2025-06-05 12:56:31 +02:00
Lennart Poettering 79226d797d sd-bus: treat '@' as equivalent to '@.host'
We allow omission of the part before and the part after the @. But so
far we didn't allow omitting both. There's no real reason for
disallowing that, hence be systematic and allow it.
2025-06-05 12:49:42 +02:00
Lennart Poettering 2ae32e9d8f sd-bus: port to split_user_at_host() 2025-06-05 12:49:35 +02:00
Lennart Poettering 137a8ce14d journalctl: politely refuse if non-root usernames are specified for --machine=
We currently cannot support that (supporting that would probably require
some active component in the machine, or alternatively idmapped mounts
or so), hence politely refuse it.

See: https://github.com/systemd/systemd/issues/32997#issuecomment-2127700945
2025-06-05 12:49:35 +02:00
Lennart Poettering 994a42a096 run: chop off username from --machine= argument before calling OpenMachinePTY()
Let's be compatible with sd-bus' logic to talk to machine, and support
the usual user@host syntax. We only want the host part, hence chop if
off before passing it to OpenMachinePTY().

Fixes: #32997
2025-06-05 12:45:37 +02:00
Lennart Poettering 020d6c1dce machined: open up OpenMachinePTY() for unpriv clients
The method call already does a PK check, it was just forgotten to
allowlist this in the dbus policy. And in the dbus vtable for
OpenMachinePTY() call. (It was allowlisted in the per-machine
vtable…)

Anyway, clean this up.
2025-06-05 12:44:08 +02:00
Lennart Poettering 4295c0db5f hostname-util: add new helper split_user_at_host()
Let's introduce a common helper for splitting user@host specifications
like we use them for --machine=.
2025-06-05 12:44:08 +02:00
Lennart Poettering 231a0417cd resolvectl: improve error message if we do not support dumping payload of RR 2025-06-05 12:43:36 +02:00
Lennart Poettering 317054365e man: reword --raw= explanation a bit
Explain what we mean by "payload", and for which RR types this is
intended.

And don#t claim we'd output a full packet, because we don't. We output
only the RR in binary.

Fixes: #37737
2025-06-05 12:38:28 +02:00
Lennart Poettering 141894f53a resolvectl: output slightly more data when --raw=payload is used
Let's also show A/AAAA data in binary form if --raw=payload is used. For
these RR types there's only a single data field, hence it's obbviously
meant.

Inspired by: #37737
2025-06-05 12:38:28 +02:00
Daan De Meyer f8f67eab70 core: Make sure we handle DelegateSubgroup= in combo with cgroupns
Currently, if we use a cgroup namespace together with DelegateSubgroup=,
the subgroup becomes the root of the cgroup namespace because we move the
service process to the subgroup before we unshare the cgroup namespace, and
the current cgroup becomes the root of the cgroup namespace when we unshare
the cgroup namespace.

Let's fix the problem by not moving the service process to the subgroup until
we've unshared the cgroup namespace. Note that this doesn't break the primary use
case of CLONE_INTO_CGROUP since we still use it to immediately clone into the service
main cgroup, just not anymore into the subgroup, but this shouldn't matter in practice.

Additionally, we need special handling for control processes, as those *do*
need to get spawned into the subcgroup immediately if delegation is configured to
avoid violating the cgroupsv2 "no inner processes" rule.

Effectively, this leaves us with the following logic:
- In exec_spawn(), spawn into subgroup if we're spawning a control process
  that needs to be spawned into a subgroup immediately. Otherwise, spawn into
  main service cgroup.
- In exec_invoke(), move into subgroup early if we don't need a cgroup namespace.
  Otherwise, move into subgroup after we've unshared the cgroup namespace.
2025-06-05 12:37:02 +02:00
Daan De Meyer 2d8191f4af core: Disable pid namespacing for control processes
PID namespaces frankly don't make any sense for control processes, so
let's gracefully degrade to no pid namespaces for control processes.
2025-06-05 12:37:02 +02:00
Daan De Meyer 770489c1e0 meson: Remove unnecessary deps from libsystemd-static build
blkid, libmount and openssl are not used in src/basic or src/libsystemd,
and so shouldn't be required as deps of libsystemd static, so let's drop
them.
2025-06-05 12:09:54 +02:00
Yu Watanabe 23f9ff4724 ptyfwd: introduce pty_forward_set_window_title() helper function 2025-06-05 19:06:02 +09:00
tytan652 1c814f3500 hwdb: add support for Loupedeck devices
Razer has partnered with Loupedeck to develop some devices.

Add support for the following devices:
- Loupedeck CT
- Loupedeck Live
- Loupedeck Live S
- Razer Stream Controller
- Razer Stream Controller X
2025-06-05 19:05:20 +09:00
Lennart Poettering f27d1bfdce sd-daemon: add sd_pidfd_get_inode_id() (#37679) 2025-06-05 09:31:48 +02:00
Sam Leonard 305e58936f vmspawn: fix call to GetUnitByPID
This commit also adds a handler for SIGRTMIN+4 which is another signal
used to shutdown systemd.
2025-06-05 08:44:20 +09:00
Mike Yuan b8194aa8b7 test-daemon: add test case for sd_pidfd_get_inode_id() 2025-06-05 01:35:08 +02:00
Mike Yuan 46b0844743 sd-daemon: add sd_pidfd_get_inode_id()
We nowadays expose pidfdid at various places, e.g. envvars
and dbus properties. Also the sd_notify() MAINPID= message
has been complemented with MAINPIDFDID=. But acquiring
pidfdid is actually non-trivial especially considering
the 32-bit case, hence let's introduce a public helper
in sd-daemon specifically for that purpose.
2025-06-05 01:35:08 +02:00