1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-25 10:04:04 +03:00

74871 Commits

Author SHA1 Message Date
Lennart Poettering
452cfd91fe dissect-image: generate better log message for EUCLEAN dissect error
Fixes: #31799
(cherry picked from commit 2186334e00acba6e6c1a4564bce60474eecfbf16)
2024-11-13 19:48:10 +00:00
Lennart Poettering
f2833a50bd dissect-image: uppercase first char of dissect error message systematically
Some of the log message stricts used proper uppercasing, others didn't.
Fix that to make it uniform.

(cherry picked from commit 620a03f669a9075f2d78c2fcf7db45f7046481bc)
2024-11-13 19:48:10 +00:00
Lennart Poettering
7280607377 resolved: refresh resolv.conf files when link goes away
This might have the effect that some DNS server or search domain
disappears, hence rewrite the relevant files.

See: #27543
(cherry picked from commit 562f7bde8872b4fd03db11bf25c9dd294fd2c186)
2024-11-13 19:48:10 +00:00
Lennart Poettering
dc47ba69fc networkd: raise limits on number of address 8x
Limits should be enforced, but not in a way real setups collide with
them.

There have been multiple reports that current limits are too low, hence
raise them 8x.

Fixes: #24852
(cherry picked from commit af7674f4ad30e83efc84f04c45f01e6eff137702)
2024-11-13 19:48:10 +00:00
Adrian Vovk
b3fc902116 GREEDY_REALLOC_APPEND: Make more type safe
Previously, GREEDY_REALLOC_APPEND would compile perfectly fine and cause
subtle memory corruption if the caller messes up the type they're passing
in (i.e. by forgetting to pass-by-reference when appending a Type* to an
array of Type*). Now this will lead to compilation failure

(cherry picked from commit fafc3c2d5c7fae6bad0f6dc51611ae9390589ade)
2024-11-13 19:48:10 +00:00
Lennart Poettering
7803507b6e udev: consider serial ports as unconfigured only if both port and iomem_base sysattr is zero
Various archs do not know the "io port" concept, hence check for the
"iomem" configuration, too.

Fixes: #34800
(cherry picked from commit 9da582984b632a75f562a304ff96dd1043281430)
2024-11-13 19:48:10 +00:00
Yu Watanabe
b0a0156bc9 TEST-60-MOUNT-RATELIMIT: disable journal ratelimiting
Otherwise, journal check in testcase_mount_ratelimit() may fail and we
need to wait 2 minutes.

(cherry picked from commit 73970cdcd1cebe49a2858ce016c0cd4ce6037b2e)
2024-11-13 19:48:10 +00:00
Yu Watanabe
dcae004218 TEST-60-MOUNT-RATEMINIT: split into small test cases
Then, use run_testcases().

(cherry picked from commit 805d0eed0b51e2ef761fc522f092b71dc028f700)
2024-11-13 19:48:10 +00:00
Yu Watanabe
3b171cb7bc TEST-60-MOUNT-RATELIMIT: wait for mount unit being started or stopped
(cherry picked from commit c5928a768417b298eb2741107fa7492e93d637fc)
2024-11-13 19:48:10 +00:00
Luca Boccassi
2590b77f39 Fix maybe-uninitialized warnings with gcc 14.2
../src/resolve/resolved-bus.c: In function ‘call_link_method’:
../src/resolve/resolved-bus.c:1769:16: warning: ‘l’ may be used uninitialized [-Wmaybe-uninitialized]
 1769 |         return handler(message, l, error);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/resolve/resolved-bus.c:1755:15: note: ‘l’ was declared here
 1755 |         Link *l;
      |               ^
../src/resolve/resolved-bus.c: In function ‘bus_method_get_link’:
../src/resolve/resolved-bus.c:1828:13: warning: ‘l’ may be used uninitialized [-Wmaybe-uninitialized]
 1828 |         p = link_bus_path(l);
      |             ^~~~~~~~~~~~~~~~
../src/resolve/resolved-bus.c:1816:15: note: ‘l’ was declared here
 1816 |         Link *l;
      |               ^

(cherry picked from commit 5f911aca8434b4163514019fcb4c1c967a50617c)
2024-11-13 19:48:10 +00:00
Yu Watanabe
28f7c958fb journalctl: erase verify key before free
Even optarg is erased, copied string was not erased.
Let's erase the copied key for safety.

(cherry picked from commit d0ad4e88d4e6b5e312c359a6505125f7e088f3e3)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4042a6a8f6 TEST-55-OOMD: check slice property before stressing slice
(cherry picked from commit a6092b532e1de0e1f9702f432c0c4c7de495bf4f)
2024-11-13 19:48:10 +00:00
Yu Watanabe
0dfd4d6996 TEST-55-OOMD: stop test units when unnecessary
Then, sleep becomes not necessary anymore. This greatly improve performance.

(cherry picked from commit 98a0bb8a6487a1bd0767223f3738525c2b3eae52)
2024-11-13 19:48:10 +00:00
Yu Watanabe
0932445e1e TEST-55-OOMD: split into small testcases
Then, we can run each small test cases separately.

(cherry picked from commit 6bba058076cf4ce91fd470841d5ced47c8d32d6a)
2024-11-13 19:48:10 +00:00
Yu Watanabe
fe5e2af10e TEST-55-OOMD: check global config earlier
'Default Memory Pressure Duration' field in oomctl, which can be configured
with DefaultMemoryPressureDurationSec= in oomd.conf, is a global config.
Let's check it earlier.

This also drops unnecessary cleanup at the beginning.

(cherry picked from commit 23fb9b63cd12f2040419dbc846d7a87e5193935c)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4c9e59ec9a TEST-55-OOMD: set ManagedOOMMemoryPressure= and friends in a drop-in config
Fedora and friends has a drop-in config for the settings in
/usr/lib/systemd/user/slice.d/ . Hence, settings in the main .slice may be
overridden. Let's set below in a drop-in with higher decimal prefix.

Also, rename override.conf -> 99-managed-oom-preference.conf for the same reason.

(cherry picked from commit 1473836a1e3c528221439e3b0ce90e729b31adb3)
2024-11-13 19:48:10 +00:00
Yu Watanabe
04bf8544ba TEST-19-CGROUP: add test cases for IPAddressAllow=/IPAddressDeny=
(cherry picked from commit 5f3cfb9d5ee334c53cc407308ba677401a6ba1cd)
2024-11-13 19:48:10 +00:00
Yu Watanabe
a94b2c39f9 core/cgroup: fix IPAddressAllow=/IPAddressDeny= set through DBus
Fixes a regression caused by 84ebe6f01381c21b88e37e856956c9c9ee6781d6 (v250).
Fixes #34773.

(cherry picked from commit 77bbd9f1bd2b01bcb2a49ed42c6dc06613532bcf)
2024-11-13 19:48:10 +00:00
Michael Ferrari
b6d84bff7a gpt-auto: remove directory check for ESP mount
Ensure that we always attempt to mount the `ESP` partition to `/boot`
when there is no `XBOOTLDR` partition.

Fixes an issue when booting without a `XBOOTLDR` partition and an empty
root partition, since it would mount the `ESP` partition to `/efi/`
unconditionally causing boot entries to not be under `/boot/` as
recommended by the Boot Loader Specification.

(cherry picked from commit 28dbee46d5bfdcfa601e80e248dbde22b8d65664)
2024-11-13 19:48:10 +00:00
Luca Boccassi
d2c8426a59 core: do not fail if ignorable img.v/ vpick dir is missing
Do not fail if the directory is missing entirely, other than just empty

Follow-up for 00f546e25e8
Follow-up for 5e79dd96a88
Follow-up for 622efc544dc

(cherry picked from commit e1efa9d8044a7564844b8d599eda4b59eb1152e9)
2024-11-13 19:48:10 +00:00
Luca Boccassi
2494dc1961 core: do not fail if ignorable img.v/ vpick dir is empty
If the vpick directory is configured to be ignored if missing, do not
fail and just skip ahead.

Follow-up for 5e79dd96a88
Follow-up for 622efc544dc

(cherry picked from commit 00f546e25e8e46e5e289e1f2fc2ed3dcc6999223)
2024-11-13 19:48:10 +00:00
John A. Leuenhagen
799ae7fa38 TEST-74-AUX-UTILS: add tests for 'run0 -D'
(cherry picked from commit 4ca75488d935431e772c25eb6cf060ea85553158)
2024-11-13 19:48:10 +00:00
John A. Leuenhagen
7c965fe62c run: fix bug causing run0 to ignore -D /.
Since the root directory was being suppressed to NULL, the subsequent
check would erroneously think that no working directory was specified.
This caused the default working directory to be applied instead.

(cherry picked from commit 0054a2acc3894e45171806bd64887211820b8eaf)
2024-11-13 19:48:10 +00:00
Yu Watanabe
30cf66855b network/dhcp6: set hostname even if UseAddress=no
Follow-up for f963f8953daeab03b892616ce0c65f7572932187 and
1536b7b2d00819615bf8eba194de7ccd20c3689f.

(cherry picked from commit 8fead9c9e46e5f71ae6f6b038ff7f72c5a13b663)
2024-11-13 19:48:10 +00:00
Yu Watanabe
864a42f309 udev: do not try to lock whole block device on remove event
As another device may be created with the same device node while udevd
is processing the remove event of the previous owner of the device node.

This also adds comment why we skip watching device node on remove.

(cherry picked from commit e8df18c9e171c87aebb2df8ac3bdd8f116236892)
2024-11-13 19:48:10 +00:00
Gaël PORTAY
6a288cd999 docs: add a missing : character
This adds the missing colon character to the section systemd-sysusers.

(cherry picked from commit 8ef5ea2bf6d8c9ef12b00ab3838b9af81e30bf5d)
2024-11-13 19:48:10 +00:00
Lennart Poettering
1f0d68c6e9 man: document preference for secure_getenv() in coding style
(cherry picked from commit c9b477415a6293b74df67c8118bafb0ef8662819)
2024-11-13 19:48:10 +00:00
Yu Watanabe
63797be0e9 test: add test for local outbounds with preferred source address
(cherry picked from commit 0343ef97644c38e215e97ef9d1b6d942b08bb8ef)
2024-11-13 19:48:10 +00:00
Yu Watanabe
b34a93d61a local-addresses: honor RTA_PREFSRC field of gateway
Fixes #34739.

(cherry picked from commit 4adf2653e2a68d4d593b46734fd9e24721a8d449)
2024-11-13 19:48:10 +00:00
Yu Watanabe
ba58edb8ff local-addresses: use FOREACH_ARRAY() macro
(cherry picked from commit 418641f73f78e651c6b0ecd05e055f790cb1eae7)
2024-11-13 19:48:10 +00:00
Yu Watanabe
ec37980695 TEST-64-UDEV-STORAGE: insert udevadm settle more
Hopefully fixes #34073.

(cherry picked from commit acadc9a84925fa725de1a4dbcfe2355432c0769a)
2024-11-13 19:48:10 +00:00
Yu Watanabe
d600880c99 TEST-58-REPART: drop duplicated inclusion of util.sh
(cherry picked from commit 4ca7b553295315c759a622a47240af56e2d06b46)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4abbd3a9c6 mkosi: replace PackageManagerTrees= with SandboxTrees=
(cherry picked from commit 4e3f16b5ef122996f9545d883af74ff1235833eb)
2024-11-13 19:48:10 +00:00
Jörg Behrmann
39a46aced6 ukify: Require both key and cert be set in generate_keys
If either is None the write in this branch of the code will fail.

(cherry picked from commit 9ba53499b97d59cc57ce763b8ba7f272a876dd25)
2024-11-13 19:48:10 +00:00
Daan De Meyer
c7762098ec systemd-update-helper: Show executed commands if debug logging is enabled
(cherry picked from commit 8b8668b9e71837cb541cd432bc37e4c9405e49cd)
2024-11-13 19:48:10 +00:00
Lennart Poettering
389fbf4649 seccomp: allowlist uretprobe() syscall
This is a new syscall provided by the kernel used to implement faster
uprobes. It's not supposed to be called by userspace, but only by kernel
generated uprobe code.

It should be fine to allow this, as the kernel authenticates the
invocation itself, and we shouldn't break compat with things.

Note that this allowlisting is not sufficient to make ureprobe() work.
libseccomp must be tought the syscall too, but this can happen
independently.

Fixes: #34615
(cherry picked from commit d693c483a2bb3eae490fd78d68fc16d0a731fee2)
2024-11-13 19:48:10 +00:00
Daan De Meyer
4d2999eb53 mkosi: Fix up ownership of testuser home directory on first boot
When building unprivileged, the testuser home directory ends up
owned by root:root because mkosi can't chown directories to other
owners when running unprivileged. So let's fix up the testuser
ownership on first boot with tmpfiles instead.

(cherry picked from commit 0d0ecaab000cf2768a3edf1e73119bf2fce952b0)
2024-11-13 19:48:10 +00:00
David Rheinsberg
a9aa75145b docs/DESKTOP_ENVIRONMENTS: clarify name aliases
Add a note to the service-file naming scheme that reminds developers
that those names might be aliases. Hence, when parsing such unit names,
the entire name-array of a unit must be parsed, rather than just the
unit ID.

The service-name of existing applications might be already part of their
API. Hence, not all applications can switch the service ID to this new
naming scheme, but can provide suitable aliases. Document this behavior.

(cherry picked from commit b3b7cf8b7c35df14c6eb4f79da1a241dc0aa8c7e)
2024-11-13 19:48:10 +00:00
David Rheinsberg
361021a522 docs/DESKTOP_ENVIRONMENT: clarify <RANDOM> usage
The <RANDOM> part is optional in the naming scheme of application units.
However, this is only true for service files. Scope units must include
the <RANDOM> part, otherwise it would be impossible to parse:

The schema would be:

    `app[-<launcher>]-<ApplicationID>[-<RANDOM>].scope`

in which case a two-part name would be impossible to parse, since it is
unclear whether the launcher of the random bit where omitted.

(cherry picked from commit cbaebf811e6edb79279f72950b2d63189be314d3)
2024-11-13 19:48:10 +00:00
Lennart Poettering
c14a47547d meson: sort includes
(cherry picked from commit 882032faaf9e2d2524936e82ccc770903d4c38d6)
2024-11-13 19:48:10 +00:00
Mike Yuan
f4df9627ae core/manager: still send out STATUS=Ready for user manager
This effectively reverts 37d15cd132f3a8a0bf42fb252c1604e804171ff2.

The offending commit wrongly assumed that the second READY=1
notification is for system scope only, but it also serves the purpose
of flushing out previous STATUS= containing user unit job status.

(cherry picked from commit da81a108653e2ef19102698dbc0184bd18b084d9)
2024-11-13 19:48:10 +00:00
David Rheinsberg
3a0c77aeb9 docs/DESKTOP_ENVIRONMENTS: fix formatting
The annotation about omittance is meant to be about the `RANDOM` string.
However, the current formatting makes it look like the entire naming
scheme is optional. Fix this.

(cherry picked from commit 5697bce82b1b37602255ac12e4a8f4a12305dc03)
2024-11-13 19:48:10 +00:00
Lennart Poettering
ca9b0afd91 docs: don't mention split-usr path anymore
We don't support split /usr/ anymore. Hence fix the paths. This
apparently matters because of PK validating the binary path.

Fixes: #34712
(cherry picked from commit c28a13b5afcf021191494bfa565c55b784dc08fa)
2024-11-13 19:48:10 +00:00
Yu Watanabe
d9d4cbfe5f mkosi: fix sections for settings
Follow-up for 963157ca78429c51feb3103828d8cc94440956f3.

(cherry picked from commit 727dc1f23a2e16da7f1e24810157d5b7c9136525)
2024-11-13 19:48:10 +00:00
Lennart Poettering
ff667d8c2e man: reword comment a bit regarding ExecStartPre= multiple commands
The documentation claimed that ExecStartPre=/ExecStartPost= accepts
multiple command lines, in contrast to ExecStart=. This is half an
untruth, because ExecStart= allows that too – as long as Type=oneshot is
set.

Hence, reword this a bit, and do not emphasize the contrast.

Prompted by: #34570

(cherry picked from commit c3069a6bfb454a0e02607ad21b5badf9847fe11a)
2024-11-13 19:48:10 +00:00
Jörg Behrmann
50b42bb82b ukify: Fix systemd-measure detection in tests
Fixes: 206fa93c854e3d5c94e56da9b53e107245f31503
(cherry picked from commit e9984357ad60f087528fbdfd6f4577e93fca8cee)
2024-11-13 19:48:10 +00:00
WilliButz
b96e3bbd9f test/repart: add test case for hash size derived from max data size
(cherry picked from commit e16153a40342b3da984ffbf4e382e16e713f447a)
2024-11-13 19:48:10 +00:00
WilliButz
5ea69f9f6d repart: derive hash partition size from SizeMaxBytes= of data sibling
This change makes it possible for repart to create dm-verity hash
partitions for a custom amount of protected data. When the property
`SizeMaxBytes=` is specified for a dm-verity data partition, the size
of the corresponding hash partition is set to accommodate hash data
for this maximum size, rather than the actual contents its data
sibling. However, the contained hash data continues to be generated
from said sibling.

(cherry picked from commit d3032e651e2131c47d276e3fbdcbdf9fc51c8ef9)
2024-11-13 19:48:10 +00:00
Chen Guanqiao
44e1774660 mount: optimize mountinfo traversal by decoupling device discovery
In mount_load_proc_self_mountinfo(), device_found_node() is synchronously called
during the traversal of mountinfo entries. When there are a large number of
mount points, and the device types are not significantly different, this results
in excessive time consumption during device discovery, causing a performance
bottleneck. This issue is particularly prominent on servers with a large number
of cores in IDC.

This patch decouples device discovery from the mountinfo traversal process,
avoiding redundant device operations. As a result, it significantly improves
performance, especially in environments with numerous mount points.

Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
(cherry picked from commit 00ad3f02275b507a753495ace5e5f84cb38b604d)
2024-11-13 19:48:10 +00:00
David Joaquín Shourabi Porcel
697d247e30 man: machinectl(1): Fix description of subcommand poweroff
(cherry picked from commit a41da1e7037dc36a601d3428343bbc7f0eed3e20)
2024-11-13 19:48:10 +00:00