Commit Graph

82091 Commits

Author SHA1 Message Date
Yu Watanabe
14dc330c9c libcrypt-util: include random-util.h
Necessary for crypto_random_bytes(), which is used in the branch that
HAVE_CRYPT_GENSALT_RA is false. Unfortunately, our CIs tested only the
other branch.
2025-06-09 22:45:23 +09:00
Yu Watanabe
6c12289fc8 meson: fix doubled # before include
Follow-up for b5337d1d52.
2025-06-09 10:20:54 +01:00
Luca Boccassi
f245fa0058 test: do not fail when lacking privs to create sysfs directory
4109s /* test_mdio_bus */
4109s src/libsystemd/sd-device/test-sd-device.c:55: Assertion failed: Expected "mkdir_p(syspath, 0755)" to succeed, but got error: Permission denied
4109s (mdio_bus) terminated by signal ABRT.
4109s src/libsystemd/sd-device/test-sd-device.c:37: Assertion failed: Expected "r = safe_fork("(mdio_bus)", FORK_CLOSE_ALL_FDS|FORK_DEATHSIG_SIGTERM|FORK_REOPEN_LOG|FORK_LOG|FORK_WAIT|FORK_NEW_MOUNTNS|FORK_MOUNTNS_SLAVE, NULL)" to succeed, but got error: Protocol error

Follow-up for 687a92a1b6
2025-06-09 15:11:30 +09:00
Daan De Meyer
1b4645d762 forward: Drop socklen_t forward declaration
This is glibc specific and doesn't exist on musl, since removing only
means adding one more include in selinux-util.h, let's drop it.

Fixes #37779
2025-06-08 10:58:56 +09:00
Lennart Poettering
1434ccf709 nspawn: do basic port to PidRef
THis is sometimes a bit superficial, but in many cases allows us to use
pidfd for various of our operations.
2025-06-07 00:28:07 +02:00
Lennart Poettering
790f516217 machined: open up machine registration for unpriv clients also via D-Bus
This is already opened up via Varlink. Let's also open it up via D-Bus
with the same polikit operation.
2025-06-07 00:27:11 +02:00
Lennart Poettering
02927af799 machined: properly open up all missing method calls via D-Bus to unpriv clients
These method calls all already have polkit hookup, hence actually allow
them to go through on all levels.

This is mostly playing catchup with a variety of calls added over the
years.
2025-06-06 22:15:25 +02:00
Zbigniew Jędrzejewski-Szmek
8ec2e177b0 coredump: fix 0-passed-as-pointer warning 2025-06-06 22:15:03 +02:00
Lennart Poettering
ac8c558629 nspawn: start polkit agent while we do polkit operations
Let's make sure unpriv nspawn can acquire privs even when invoked
outside of a desktop environment that has a polkit agent registered.
2025-06-06 22:14:50 +02:00
Yu Watanabe
b5bd717fcd test: extend timeout and enable generating debugging logs
Not sure why the test failed, but maybe the test environment is too
slow? Even this does not fix the failure, by enabling debugging logs,
this hopefully provides more useful information for debugging.

For issue #37685.
2025-06-06 19:43:32 +01:00
Yu Watanabe
c928defc08 run: ignore bus connection error in acquiring invocation ID (#37763)
This introduce bus_error_is_connection(), and use it where applicable.
Then, this makes connection errors in acquiring invocation ID by
systemd-run handled gracefully, like we already do other places.

Fixes #37675.
2025-06-07 01:55:21 +09:00
Yu Watanabe
6c2558a2fc tree-wide: allow building with -Wgnu-variable-sized-type-not-at-end option for clang (#37499)
Follow-up for #36993.
Closes #37497.
2025-06-07 01:02:38 +09:00
Yu Watanabe
eb09b4b546 run: ignore bus connection error in acquiring invocation ID
Similar to 2b983b43c6, but for acquiring
invocation ID.

Fixes #37675.
2025-06-07 00:01:15 +09:00
Yu Watanabe
687a92a1b6 sd-device: replace '!' with '/' before calling sd_device_new_from_subsystem_sysname()
Device ID uses device directory name as is, hence may contain '!', but
sd_device_new_from_subsystem_sysname() expects that the input is sysname.
So, we need to replace '!' with '/'.

Follow-up for 1393c5a2a4.
Fixes #37711.
2025-06-06 23:59:02 +09:00
Lennart Poettering
52c9a3c392 codeql: taint basename() 2025-06-06 23:53:53 +09:00
Lennart Poettering
0f64d570cb repart: fix CopyBlocks=auto for verity-sig partitions, even harder (#37704)
@DaanDeMeyer, this is for you.

Seems to work great here to duplicate ParticleOS onto another disk.
2025-06-06 16:06:26 +02:00
Lennart Poettering
113006a1f3 tree-wide: basename -> path_extract_filename (#34906) 2025-06-06 15:53:28 +02:00
Yu Watanabe
ac004f4cc9 tree-wide: introduce bus_error_is_connection() and use it where applicable 2025-06-06 21:42:25 +09:00
Lennart Poettering
6513646c62 repart: use partition_designator_is_verity_sig() + partition_designator_is_verity() more 2025-06-06 12:37:44 +02:00
Lennart Poettering
d3a6606cea repart: try harder to find verity-sig partitions for CopyBlocks=auto
verity-sig partitions are not kernel concepts, hence dm-verity won't
link them for us from the slaves/ subdir in sysfs. Hence let's instead
look up the partition via udev's database.

Hence: when we search for the data+verity+verity-sig partitions then
search for the first two as usual, but search for the latter by looking
up the udev props on the first two, and then following the paths
provided therein.

Fixes: #34835
2025-06-06 12:37:44 +02:00
Lennart Poettering
188467dfd9 udev: add udev properties that point to verity/verity sig metadata partitions from data partitions
This extends the dissect_image builtin to actually add device node
references to the device nodes where the associated data is placed, if
we can find it.

This is kept very generic, and independent from the roothash properties
and suchlike, since it makes sense to make it possible to set these
properties also independently of the dissect-image builtin.

The device path is a /dev/disk/by-diskseq/ symlink, so that we have
stable reference that are not subject to dev_t reuses.
2025-06-06 12:37:41 +02:00
Lennart Poettering
870d6da909 gpt: add partition_designator_is_verity() helper
And rework partition_designator_is_verity_sig() to be based on
partition_verity_sig_to_data(), so that we don't have to maintain two
lists of verity sig partition types.
2025-06-06 12:37:20 +02:00
Yu Watanabe
f2a8cc943d sd-lldp-rx: add VLAN ID parsing (#37725)
While the `port_vlan_id` field was already present in the
`sd_lldp_neighbor`, it wasn't currently parsed from the LLDP packet.
Added support for that as well as a small parsing test.

Closes #28354.
2025-06-06 19:12:48 +09:00
Yu Watanabe
b1bfa60254 TODO: drop completed entry 2025-06-06 19:09:49 +09:00
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
Lorenzo Arena
6b78f13b7e network: test-lldp-rx: set more variable as static const 2025-06-06 09:35:11 +02:00
Lorenzo Arena
496b21ab8e sd-lldp-rx: add VLAN ID parsing
Closes #28354.
2025-06-06 09:35:11 +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